From 49204c5c8bc9477e8d5537ea258d9b4bb192b940 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 20 Oct 2026 11:11:24 +0800 Subject: [PATCH] Strengthen the print-returns-to-document test's failure assertions Only checked that the Print page stayed open on a failed submission, which could pass even if some other backstage page ended up showing or the failure feedback itself wasn't retained. Also assert the Print page specifically is still the one up, and that Feedback::Failed with the actual error is still there to see. Co-Authored-By: Claude Sonnet 5 --- crates/ui-egui/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 73e76833a..1d3b60f2d 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -5298,6 +5298,14 @@ mod tests { let ctx = egui::Context::default(); ctx.run_ui(egui::RawInput::default(), |ui| a.logic(ui.ctx())).drop_without_applying_deltas(); assert_eq!(a.ui.backstage, !ok, "ok {ok}: whether the Print page is still open"); + if !ok { + assert_eq!(a.ui.backstage_page, "print", "the Print page is still the one showing, not some other backstage page"); + assert!( + matches!(&a.printing.message, Some(printing::Feedback::Failed(error)) if error == "no paper"), + "the failure is still visible: {:?}", + a.printing.message + ); + } } }