mirror of
https://github.com/storytold/effectcraft.git
synced 2026-12-05 08:21:21 -05:00
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user