test(ui): expect plain unrecognized alerts for Smart Object opens

This commit is contained in:
yoriswind committed 2026-11-26 22:40:02 -08:00
1 parent fd3afcbfc0
commit b187c73c7c
1 file changed
+12 -2
+12 -2
View File
@@ -1858,7 +1858,12 @@ fn open_as_smart_object_dialog_opens_one_document_per_selected_file() {
assert_eq!(app.session.documents().iter().map(|d| d.doc.name.as_str()).collect::<Vec<_>>(), ["one-1", "two-1"]);
assert!(app.session.documents().iter().all(|d| d.path.is_none() && d.doc.layers.len() == 1));
assert!(open_error_messages(&app).iter().any(|message| message.starts_with("Couldn't open bad.png")), "the unreadable file is reported");
assert_eq!(
open_error_messages(&app),
["Could not open \"bad.png\" because PhotoCraft does not recognize this type of file."],
"the unreadable file has one exact modal alert; status: {}",
app.ui.status
);
let _ = std::fs::remove_dir_all(&dir);
}
@@ -1880,7 +1885,12 @@ fn open_as_smart_object_opens_in_the_background_in_name_order() {
tick_until(&mut app, &ctx, |app| app.jobs.opens.is_empty());
assert_eq!(app.session.documents().iter().map(|d| d.doc.name.as_str()).collect::<Vec<_>>(), ["one-1", "two-1"]);
assert!(app.session.documents().iter().all(|d| d.path.is_none() && d.doc.layers.len() == 1));
assert!(open_error_messages(&app).iter().any(|message| message.starts_with("Couldn't open bad.png")), "the unreadable file is reported");
assert_eq!(
open_error_messages(&app),
["Could not open \"bad.png\" because PhotoCraft does not recognize this type of file."],
"the unreadable file has one exact modal alert; status: {}",
app.ui.status
);
let _ = std::fs::remove_dir_all(&dir);
}