mirror of
https://github.com/storytold/wordcraft.git
synced 2026-10-29 12:57:09 -06:00
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:
co-authored by
Claude Sonnet 5
parent
579b2dc6ef
commit
49204c5c8b
@@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user