From 8b2dafdffedfd5835d7680f9a46e22706ff22342 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 18:24:58 +0000 Subject: [PATCH] Close test: a clean window's close is checked without quitting The test asserts MaterialCraft's own close decision for a clean package, as it did with an injected quit, so it passes on macOS, where the platform's quit cancels the window close. Unsaved work still runs the whole close frame. --- crates/ui-egui/src/material_craft_app.test.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/material_craft_app.test.rs b/crates/ui-egui/src/material_craft_app.test.rs index 30e34881..1634b5f4 100644 --- a/crates/ui-egui/src/material_craft_app.test.rs +++ b/crates/ui-egui/src/material_craft_app.test.rs @@ -104,7 +104,8 @@ mod close_order_tests { let mut clean = MaterialCraftApp::headless(materialcraft_engine::sample_session(), UiState::default()); clean.fonts_ready = true; clean.session.modified = false; - assert!(!close_frame(&mut clean), "nothing to hold: the hook sees a close to take over"); + // Only the app's decision: a close that goes ahead ends in the platform's quit, which macOS answers by canceling it. + assert!(!crate::unsaved::close_requested(&mut clean), "nothing to hold: the hook sees a close to take over"); } }