test(ui): filter to PhotoCraft before clicking pin button in Table view

This commit is contained in:
Dylan M. Taylor committed 2026-11-30 23:21:18 -05:00
1 parent e6ef920d39
commit 9f494f243a
1 file changed
+8 -1
+8 -1
View File
@@ -2254,11 +2254,18 @@ fn pinning_an_app_keeps_it_on_top_until_unpinned() {
// Name sort would put CADCraft before PhotoCraft; a pin must still win.
h.state_mut().as_mut().unwrap().settings.sort = artcraft_launcher_ui_egui::settings::SortKey::Name;
h.state_mut().as_mut().unwrap().settings.sort_descending = false;
h.run_steps(2);
// Keep PhotoCraft's table row in view regardless of how many apps precede it alphabetically.
h.get_by_role(egui::accesskit::Role::TextInput).click();
h.get_by_role(egui::accesskit::Role::TextInput).type_text("PhotoCraft");
h.run_steps(4);
// Card/row pin button (menu Pin to top is covered by pinned_app_menu_offers_unpin).
h.get_by_label("Pin PhotoCraft to top").click();
h.run_steps(4);
assert_eq!(h.state().as_ref().unwrap().settings.pinned, vec!["photocraft".to_string()]);
h.get_by_role(egui::accesskit::Role::TextInput).click();
h.key_press_modifiers(egui::Modifiers::COMMAND, egui::Key::A);
h.key_press(egui::Key::Backspace);
h.run_steps(4);
let ids = h.state().as_ref().unwrap().visible_ids_for_test();
assert_eq!(ids.first().copied(), Some("photocraft"), "pinned app stays first under Name sort: {ids:?}");
h.state_mut().as_mut().unwrap().settings.pin_app("filmcraft");