From 49b2780c3a123f4ea8e1af9407732982aa5e2a73 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Tue, 1 Dec 2026 17:33:40 +0100 Subject: [PATCH] Cover Open alignment with a document tab (cherry picked from commit 538d72b04ebbaca64c82ed7614c60a0e4f8fb893) --- crates/ui-egui/tests/it/ui.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/ui-egui/tests/it/ui.rs b/crates/ui-egui/tests/it/ui.rs index c4b4a272f3..e0219469d3 100644 --- a/crates/ui-egui/tests/it/ui.rs +++ b/crates/ui-egui/tests/it/ui.rs @@ -52,6 +52,18 @@ fn open_lines_up_with_the_document_tab_strip() { assert!((open.center().y - strip.center().y).abs() <= 1.0, "Open {open:?} is off the strip {strip:?}"); } +#[test] +fn open_lines_up_with_the_document_tab_when_a_file_is_open() { + let h = harness(|app| { + app.open_bytes(&egui::Context::default(), "fixture.pdf", None, FIXTURE.to_vec()).unwrap(); + }); + let open = h.get_by_role_and_label(egui::accesskit::Role::Button, "Open…").rect(); + let strip = h.get_by_label("Documents").rect(); + let tab = h.get_by_role_and_label(egui::accesskit::Role::Tab, "fixture.pdf").rect(); + assert!((open.center().y - strip.center().y).abs() <= 1.0, "Open {open:?} is off the strip {strip:?}"); + assert!((open.center().y - tab.center().y).abs() <= 1.0, "Open {open:?} is off the tab {tab:?}"); +} + /// Starting the app makes its Home and navigation rail icons available to the renderer. #[test] fn app_start_registers_its_icons() {