diff --git a/crates/ui-egui/tests/it/fill_sign.rs b/crates/ui-egui/tests/it/fill_sign.rs index b5bb52cfa7..fe65314fa4 100644 --- a/crates/ui-egui/tests/it/fill_sign.rs +++ b/crates/ui-egui/tests/it/fill_sign.rs @@ -2527,10 +2527,17 @@ fn fill_sign_enter_adds_lines_outside_click_commits_and_escape_cancels() { let annot = &session.get(reopened).unwrap().info.annotations[0]; assert_eq!(annot.contents.as_deref(), Some(text)); assert!(annot.rect[3] - annot.rect[1] >= 5.0 * 10.0 * 1.2, "the saved box keeps all five lines"); + // Compared as edits, not saved bytes: a save stamps its time, so two saves a second apart differ. + let unchanged = |h: &Harness<'static, PdfCraftApp>| { + let doc = h.state().session.get(id).unwrap(); + (doc.edit_generation(), doc.dirty, doc.can_undo().map(str::to_owned)) + }; + let before = unchanged(&h); click(&mut h, 50.0, 180.0); fill_input(&mut h, [egui::Event::Text("Cancel me".into())]); fill_key(&mut h, egui::Key::Enter); fill_key(&mut h, egui::Key::Escape); assert!(h.state().views[0].fill_text.is_none()); - assert_eq!(h.state().session.save_bytes(id).unwrap(), saved, "Escape cancels without writing"); + assert_eq!(unchanged(&h), before, "Escape cancels without writing"); + assert_eq!(items(&h), [("FreeText".to_owned(), Some(text.to_owned()))]); }