mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-31 15:49:36 +00:00
test(ui): the two-tab Redo test checks the copy's paragraph stays open
If the copy's editor had closed before or during Redo, the check for the other tab's typing passed on an empty text. It now requires the editor to be open before Redo and after it.
This commit is contained in:
1 parent
f3b61b73b0
commit
dd47c4f9e1
1 file changed
+3
-2
@@ -6675,11 +6675,12 @@ fn typing_in_one_tab_never_reaches_another_tabs_paragraph() {
|
||||
// The copy, its paragraph still open: Redo there has nothing of its own to put back.
|
||||
h.state_mut().active = Some(1);
|
||||
h.run_steps(3);
|
||||
assert!(h.state().views[1].line_editor.is_some(), "the copy's paragraph is still open");
|
||||
h.key_press_modifiers(Modifiers::COMMAND | Modifiers::SHIFT, Key::Z);
|
||||
h.run_steps(3);
|
||||
let s = h.state();
|
||||
let text = s.views[1].line_editor.as_ref().map(|ed| ed.text.clone());
|
||||
assert!(!text.as_deref().unwrap_or_default().contains("secret"), "the other tab's typing came in: {text:?}");
|
||||
let text = &s.views[1].line_editor.as_ref().expect("the copy's paragraph stays open through Redo").text;
|
||||
assert!(!text.contains("secret"), "the other tab's typing came in: {text:?}");
|
||||
assert_eq!(s.session.get(s.views[1].id).unwrap().text_blocks(0)[0].text, s.session.get(s.views[0].id).unwrap().text_blocks(0)[0].text);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user