From b2849e6ec696f63ca407cf3b77ca4d754bae6950 Mon Sep 17 00:00:00 2001 From: arnav-hiwarkar Date: Fri, 4 Dec 2026 19:16:29 +0530 Subject: [PATCH] test(ui): check the unsaved question's order on the OS its footer uses The order test asked cfg!(windows), but the footer orders by the shell's OS (os_of), which a test harness need not share with the host. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/tests/it/ui_unsaved_prompt.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/tests/it/ui_unsaved_prompt.rs b/crates/ui-egui/tests/it/ui_unsaved_prompt.rs index 0088db0d7..47228dbad 100644 --- a/crates/ui-egui/tests/it/ui_unsaved_prompt.rs +++ b/crates/ui-egui/tests/it/ui_unsaved_prompt.rs @@ -24,7 +24,8 @@ fn closing_a_modified_project_asks_with_the_shared_buttons_in_the_platform_order let button = |h: &Harness<'_, EffectcraftApp>, name: &str| h.query_all_by_role_and_label(Role::Button, name).last().map(|n| n.rect().min.x); let x = |h: &Harness<'_, EffectcraftApp>, name: &str| button(h, name).unwrap_or_else(|| panic!("{name:?} is a button")); let (save, dont_save, cancel) = (x(&h, "Save"), x(&h, "Don't Save"), x(&h, "Cancel")); - if cfg!(windows) { + // The footer orders by the OS the craft shell runs on, which need not be the machine running the test. + if craft_ui::runtime::windows::os_of(&h.ctx) == craft_host::target::Os::Windows { assert!(save < dont_save && dont_save < cancel, "Save, Don't Save, Cancel"); } else { assert!(dont_save < cancel && cancel < save, "Don't Save, Cancel, Save");