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 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Sonnet 5 committed 2026-10-20 11:11:24 +08:00
1 parent 579b2dc6ef
commit 49204c5c8b
1 file changed
+8
+8
View File
@@ -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
);
}
}
}