Header-menu and edit-menu stories: return when the target is missing instead of expect

This commit is contained in:
aiongg
2026-11-14 05:54:09 +00:00
parent 31e032d5df
commit 81a0a9f36b
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -152,7 +152,8 @@ fn table_many(ui: &mut Ui, data: &mut StoryData) -> StoryOutput {
/// A secondary click on the Name header, which opens the header menu.
fn open_header_menu(fixture: &mut Fixture) {
let at = fixture.by_label("Name").expect("the header cell").center();
let Some(header) = fixture.by_label("Name") else { return };
let at = header.center();
fixture.frame(vec![moved(at), secondary(at, true)]);
fixture.frame(vec![secondary(at, false)]).settle();
}
@@ -26,7 +26,8 @@ fn alt_text_field(ui: &mut Ui, data: &mut StoryData) -> StoryOutput {
/// A secondary click on the description box, which opens the edit menu.
fn open_edit_menu(fixture: &mut Fixture) {
let at = fixture.by_label(PROMPT).expect("the description box").center();
let Some(field) = fixture.by_label(PROMPT) else { return };
let at = field.center();
fixture.frame(vec![moved(at), secondary(at, true)]);
fixture.frame(vec![secondary(at, false)]).settle();
}