Keep selection test independent of the visible list's mutable borrow

This commit is contained in:
Nigel Ihza Firdausy
2026-10-12 09:27:55 +07:00
parent 559d340d1c
commit 3af5280ea6
+2 -1
View File
@@ -289,7 +289,8 @@ mod tests {
let pid = "lc.golden-hour";
session.execute("preset.apply", &json!({"id": pid})).unwrap();
let state = AppliedPreset::new(&session, pid.into(), 100.0);
let other = session.visible().iter().copied().find(|id| Some(*id) != session.active()).unwrap();
let active = session.active();
let other = session.visible().iter().copied().find(|id| Some(*id) != active).unwrap();
session.execute("library.select", &json!({"ids": [other.0]})).unwrap();
assert!(!state.is_current(&session), "the preset belongs to the earlier selection");
}