mirror of
https://github.com/storytold/texturecraft.git
synced 2026-11-30 10:03:56 +01:00
Switch the channel off on the layer the Manage channels test reads
The test read the set's bottom layer but switched roughness off on the selected one, so it stopped at its own precondition instead of checking textureSet.channels.
This commit is contained in:
1 parent
7b370383f2
commit
8032697c99
1 file changed
+3
-2
@@ -476,8 +476,9 @@ mod tests {
|
||||
fn channels_applied_to_every_set_keep_the_channels_a_layer_switched_off() {
|
||||
let mut s = Session::new_project("t", texturecraft_geom::primitives::material_ball(), "builtin:material_ball", None, 128).unwrap();
|
||||
crate::execute(&mut s, "layer.add.fill", &json!({})).unwrap();
|
||||
let layer = s.doc.project.texture_sets[0].stack[0];
|
||||
crate::execute(&mut s, "layer.blend", &json!({"channel": "roughness", "enabled": false})).unwrap();
|
||||
let layer = s.selected_layer().unwrap();
|
||||
// Switched off, as layer.blend {enabled: false} leaves it
|
||||
s.doc.project.layer_mut(layer).unwrap().channels.remove(&Channel::Roughness);
|
||||
let layer_has_roughness = |s: &Session| s.doc.project.layer(layer).is_ok_and(|l| l.channels.contains_key(&Channel::Roughness));
|
||||
assert!(!layer_has_roughness(&s));
|
||||
|
||||
|
||||
Reference in new issue
Block a user