test: keep startup password assertions independent of worker order

This commit is contained in:
FredApps committed 2026-11-18 21:26:45 +01:00
1 parent bad6ac7fa2
commit f9bfa19e74
1 file changed
+8 -3
+8 -3
View File
@@ -2756,10 +2756,15 @@ fn a_startup_file_after_a_protected_one_keeps_its_password_prompt() {
if unlock {
h.state_mut().submit_password(Some("reader".into()));
support::wait_until(&mut h, "both files", |app| app.views.len() == 2);
// The other file opened while the password was being typed; the unlocked one comes
// after it and is the one in view.
assert_eq!(open_paths(h.state()), vec![other_path, locked_path]);
// The password retry has worker priority, so either file can finish first.
// Both must open exactly once; the last admitted tab is the active one.
let mut paths = open_paths(h.state());
paths.sort();
let mut expected = vec![other_path, locked_path];
expected.sort();
assert_eq!(paths, expected);
assert_eq!(h.state().active_ids().map(|(i, _)| i), Some(1));
assert!(h.state().password_prompt.is_none(), "successful unlock leaves no stale prompt");
} else {
h.state_mut().submit_password(None);
support::wait_until(&mut h, "the other file", |app| app.views.len() == 1);