From c1486da40b12e0da99cb8555712bfe5a5bdc12bb Mon Sep 17 00:00:00 2001 From: bflatastic Date: Tue, 10 Nov 2026 10:07:47 +0700 Subject: [PATCH] Updates test: answer the startup prompt before clicking in Preferences preferences_turn_the_check_at_start_off starts with the check at start on. That check answers on its own thread, and when its prompt opens between frames it takes the click meant for the Preferences check box, so the setting stays on. Windows runners hit it often. The test now waits for the prompt and answers Later first, like the prompt test beside it, through one shared helper. --- crates/ui-egui/tests/it/updates.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/tests/it/updates.rs b/crates/ui-egui/tests/it/updates.rs index e6cc09d7c5..61a0e03ee5 100644 --- a/crates/ui-egui/tests/it/updates.rs +++ b/crates/ui-egui/tests/it/updates.rs @@ -169,6 +169,8 @@ fn turning_the_check_at_start_on_waits_for_the_next_start() { #[test] fn preferences_turn_the_check_at_start_off() { let (mut h, _calls) = started_with(r#"{"update_check_at_start": true}"#); + // The check at start answers on its own thread; its prompt would take the click below. + later_on_the_startup_prompt(&mut h); h.state_mut().execute("app.preferences"); h.run_steps(3); h.get_by_label("Check for updates when PdfCraft starts").click(); @@ -196,6 +198,12 @@ fn the_check_at_start_offers_the_prompt_and_later_dismisses_it() { app.set_startup_update_check(true); app }); + later_on_the_startup_prompt(&mut h); + assert!(h.query_by_label_contains("is available").is_none(), "Later closes the prompt"); +} + +/// Waits for the check at start to offer its prompt, then answers Later. +fn later_on_the_startup_prompt(h: &mut Harness<'static, PdfCraftApp>) { let deadline = std::time::Instant::now() + std::time::Duration::from_secs(30); while h.query_by_label_contains("is available").is_none() { h.run_steps(2); @@ -204,5 +212,4 @@ fn the_check_at_start_offers_the_prompt_and_later_dismisses_it() { } h.get_by_label("LATER").click(); h.run_steps(3); - assert!(h.query_by_label_contains("is available").is_none(), "Later closes the prompt"); }