toats notifications in the web

This commit is contained in:
Priec
2026-08-07 21:30:32 +02:00
parent 945dd811f4
commit 7cda7ea833
12 changed files with 102 additions and 25 deletions

View File

@@ -134,8 +134,14 @@ mod tests {
// Once in the inline alert, once in the dialog.
assert_eq!(failure.matches("A name is required.").count(), 2);
// A success only asks the toast stack in `ui/base.html` to show it: it
// dismisses itself, so it neither blocks the page nor stays behind in
// the layout, and it renders nothing of its own here.
let success = render(&Alert::success("Saved", "Two rows written."));
assert!(success.contains(r#"role="alert""#));
assert!(!success.contains("Template error"), "{success}");
assert!(success.contains("$dispatch('notify'"));
assert!(success.contains(r#"data-message="Two rows written.""#));
assert!(!success.contains(r#"role="dialog""#));
assert!(!success.contains(r#"role="alert""#));
}
}