mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-03 06:31:42 +01:00
Tab menu test: the clicked tab is not the active one (#11403)
The multi-document Move to New Window test now makes document 0 active and clicks the menu on tab 2, then checks that tab 2 floated and document 0 did not. Before, the clicked tab was also the active one, so a regression that floated the active document would have passed. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
1 parent
093cba6cc1
commit
7ea1eb13b0
1 file changed
+6
-1
@@ -166,10 +166,15 @@ fn move_to_new_window_floats_the_clicked_tab_even_with_one_document() {
|
||||
crate::menus::invoke(&mut h.state_mut().app, &ctx, id, params).unwrap();
|
||||
assert!(h.state().app.ui.windows.iter().any(|w| w.floating && w.document == 0));
|
||||
|
||||
// The clicked tab (2) is not the active document (0).
|
||||
let (mut h, _) = probe(3, 2, true);
|
||||
h.state_mut().app.session.set_active(0);
|
||||
assert_eq!(h.state().app.session.active_index(), Some(0));
|
||||
let (id, params) = click(&mut h, "Move to New Window");
|
||||
crate::menus::invoke(&mut h.state_mut().app, &ctx, id, params).unwrap();
|
||||
assert!(h.state().app.ui.windows.iter().any(|w| w.floating && w.document == 2), "the clicked tab, not the active one");
|
||||
let windows = &h.state().app.ui.windows;
|
||||
assert!(windows.iter().any(|w| w.floating && w.document == 2), "the clicked tab floats");
|
||||
assert!(!windows.iter().any(|w| w.document == 0), "the active document does not float");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in new issue
Block a user