From 8341a721e07f74e92b6663ded763bc3fbcad7f68 Mon Sep 17 00:00:00 2001 From: aiongg Date: Thu, 22 Oct 2026 04:19:39 +0000 Subject: [PATCH] =?UTF-8?q?Integration:=20mode-tab=20hand=20tests=20use=20?= =?UTF-8?q?the=20tabs=20the=20mode=20bar=20has=20(#2240=20=C3=97=20#3010,?= =?UTF-8?q?=20#3022)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #2240 (on main before this round) took the Read tab out of the mode bar. #3010 and #3022 were written against a mode bar that still had it, so their five tests looked for a Read button that is gone. The tests now check All tools in its place where the scrolled content reaches under it (added text, the Fill & Sign type box). Page 1's text and the form's name field start right of All tools, so those tests check Edit, Convert and E-Sign, the tabs they lie under. --- crates/ui-egui/tests/content.rs | 6 +++--- crates/ui-egui/tests/editing.rs | 15 ++++++--------- crates/ui-egui/tests/fill_sign.rs | 6 +++--- crates/ui-egui/tests/forms.rs | 15 ++++++--------- 4 files changed, 18 insertions(+), 24 deletions(-) diff --git a/crates/ui-egui/tests/content.rs b/crates/ui-egui/tests/content.rs index 2c2ad4c6b..d75de6118 100644 --- a/crates/ui-egui/tests/content.rs +++ b/crates/ui-egui/tests/content.rs @@ -713,7 +713,7 @@ fn mode_tab(h: &Harness<'static, PdfCraftApp>, label: &str) -> egui::Rect { } /// Scroll the page until `what` (on screen) lies across the mode bar, then the cursor over each -/// tab it lies under: with the All tools panel closed, Read, Edit, Convert and E-Sign. +/// tab it lies under: with the All tools panel closed, every tab: All tools, Edit, Convert and E-Sign. fn mode_tab_cursors( h: &mut Harness<'static, PdfCraftApp>, what: impl Fn(&Harness<'static, PdfCraftApp>) -> egui::Rect, @@ -727,7 +727,7 @@ fn mode_tab_cursors( h.state_mut().views[0].goto = Some((0, (top - (tabs - y)) / page(h).height())); h.run_steps(4); let under = what(h); - ["Read", "Edit", "Convert", "E-Sign"].map(|label| { + ["All tools", "Edit", "Convert", "E-Sign"].map(|label| { let at = mode_tab(h, label).center(); assert!(under.contains(at), "{under:?} lies under {label} at {at:?}"); h.hover_at(at); @@ -737,7 +737,7 @@ fn mode_tab_cursors( } const HAND_ON_EVERY_TAB: [(&str, egui::CursorIcon); 4] = [ - ("Read", egui::CursorIcon::PointingHand), + ("All tools", egui::CursorIcon::PointingHand), ("Edit", egui::CursorIcon::PointingHand), ("Convert", egui::CursorIcon::PointingHand), ("E-Sign", egui::CursorIcon::PointingHand), diff --git a/crates/ui-egui/tests/editing.rs b/crates/ui-egui/tests/editing.rs index ebb910a3d..b0136a2bd 100644 --- a/crates/ui-egui/tests/editing.rs +++ b/crates/ui-egui/tests/editing.rs @@ -5879,12 +5879,13 @@ fn mode_tab(h: &Harness<'static, PdfCraftApp>, label: &str) -> egui::Rect { } /// The cursor over each mode bar tab that page 1's text lies under, once that text is scrolled -/// up under the bar. With the All tools panel closed it lies under Read, Edit, Convert and E-Sign. -fn mode_tab_cursors(h: &mut Harness<'static, PdfCraftApp>, text: egui::Rect) -> [(&'static str, egui::CursorIcon); 4] { +/// up under the bar. With the All tools panel closed it lies under Edit, Convert and E-Sign; it +/// starts right of All tools. +fn mode_tab_cursors(h: &mut Harness<'static, PdfCraftApp>, text: egui::Rect) -> [(&'static str, egui::CursorIcon); 3] { h.state_mut().views[0].goto = Some((0, 0.5)); h.run_steps(4); let offset = h.state().views[0].page_screen_rect(0).expect("on screen").top(); - ["Read", "Edit", "Convert", "E-Sign"].map(|label| { + ["Edit", "Convert", "E-Sign"].map(|label| { let at = mode_tab(h, label).center(); assert!(text.translate(egui::vec2(0.0, offset)).contains(at), "the text lies under {label}"); h.hover_at(at); @@ -5893,12 +5894,8 @@ fn mode_tab_cursors(h: &mut Harness<'static, PdfCraftApp>, text: egui::Rect) -> }) } -const HAND_ON_EVERY_TAB: [(&str, egui::CursorIcon); 4] = [ - ("Read", egui::CursorIcon::PointingHand), - ("Edit", egui::CursorIcon::PointingHand), - ("Convert", egui::CursorIcon::PointingHand), - ("E-Sign", egui::CursorIcon::PointingHand), -]; +const HAND_ON_EVERY_TAB: [(&str, egui::CursorIcon); 3] = + [("Edit", egui::CursorIcon::PointingHand), ("Convert", egui::CursorIcon::PointingHand), ("E-Sign", egui::CursorIcon::PointingHand)]; /// Page 1's text block on screen, relative to the page's top edge, in the window as it is now. fn page_text(h: &Harness<'static, PdfCraftApp>) -> egui::Rect { diff --git a/crates/ui-egui/tests/fill_sign.rs b/crates/ui-egui/tests/fill_sign.rs index 7a54fc2ca..77bab6e91 100644 --- a/crates/ui-egui/tests/fill_sign.rs +++ b/crates/ui-egui/tests/fill_sign.rs @@ -1667,7 +1667,7 @@ fn mode_tab(h: &Harness<'static, PdfCraftApp>, label: &str) -> egui::Rect { } /// Scroll the page until `what` (on screen) lies across the mode bar, then the cursor over each -/// tab it lies under: with the All tools panel closed, Read, Edit, Convert and E-Sign. +/// tab it lies under: with the All tools panel closed, every tab: All tools, Edit, Convert and E-Sign. fn mode_tab_cursors( h: &mut Harness<'static, PdfCraftApp>, what: impl Fn(&Harness<'static, PdfCraftApp>) -> egui::Rect, @@ -1681,7 +1681,7 @@ fn mode_tab_cursors( h.state_mut().views[0].goto = Some((0, (top - (tabs - y)) / page(h).height())); h.run_steps(4); let under = what(h); - ["Read", "Edit", "Convert", "E-Sign"].map(|label| { + ["All tools", "Edit", "Convert", "E-Sign"].map(|label| { let at = mode_tab(h, label).center(); assert!(under.contains(at), "{under:?} lies under {label} at {at:?}"); h.hover_at(at); @@ -1691,7 +1691,7 @@ fn mode_tab_cursors( } const HAND_ON_EVERY_TAB: [(&str, egui::CursorIcon); 4] = [ - ("Read", egui::CursorIcon::PointingHand), + ("All tools", egui::CursorIcon::PointingHand), ("Edit", egui::CursorIcon::PointingHand), ("Convert", egui::CursorIcon::PointingHand), ("E-Sign", egui::CursorIcon::PointingHand), diff --git a/crates/ui-egui/tests/forms.rs b/crates/ui-egui/tests/forms.rs index 1528d4c5e..efc27dc83 100644 --- a/crates/ui-egui/tests/forms.rs +++ b/crates/ui-egui/tests/forms.rs @@ -1282,11 +1282,12 @@ fn mode_tab(h: &Harness<'static, PdfCraftApp>, label: &str) -> egui::Rect { } /// Scroll the page until `what` (on screen) lies across the mode bar, then the cursor over each -/// tab it lies under: with the All tools panel closed, Read, Edit, Convert and E-Sign. +/// tab it lies under: with the All tools panel closed, Edit, Convert and E-Sign (the name field +/// starts right of All tools). fn mode_tab_cursors( h: &mut Harness<'static, PdfCraftApp>, what: impl Fn(&Harness<'static, PdfCraftApp>) -> egui::Rect, -) -> [(&'static str, egui::CursorIcon); 4] { +) -> [(&'static str, egui::CursorIcon); 3] { let page = |h: &Harness<'static, PdfCraftApp>| h.state().views[0].page_screen_rect(0).expect("on screen"); let y = what(h).center().y - page(h).top(); let tabs = mode_tab(h, "Convert").center().y; @@ -1296,7 +1297,7 @@ fn mode_tab_cursors( h.state_mut().views[0].goto = Some((0, (top - (tabs - y)) / page(h).height())); h.run_steps(4); let under = what(h); - ["Read", "Edit", "Convert", "E-Sign"].map(|label| { + ["Edit", "Convert", "E-Sign"].map(|label| { let at = mode_tab(h, label).center(); assert!(under.contains(at), "{under:?} lies under {label} at {at:?}"); h.hover_at(at); @@ -1305,12 +1306,8 @@ fn mode_tab_cursors( }) } -const HAND_ON_EVERY_TAB: [(&str, egui::CursorIcon); 4] = [ - ("Read", egui::CursorIcon::PointingHand), - ("Edit", egui::CursorIcon::PointingHand), - ("Convert", egui::CursorIcon::PointingHand), - ("E-Sign", egui::CursorIcon::PointingHand), -]; +const HAND_ON_EVERY_TAB: [(&str, egui::CursorIcon); 3] = + [("Edit", egui::CursorIcon::PointingHand), ("Convert", egui::CursorIcon::PointingHand), ("E-Sign", egui::CursorIcon::PointingHand)]; /// A text field scrolled up under the mode bar leaves its tabs the hand (#2755). The field gave /// them its I-beam, and its open editor floated over them and took their clicks.