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

@@ -224,6 +224,13 @@ mod tests {
body.contains("@layer theme, base, app, components, utilities;"),
"{path} lost the cascade order app.css depends on"
);
// Penguin UI's toast stack, included straight from
// penguinui-components. A success anywhere on the page dispatches
// `notify` at it, so a page without it swallows the message.
assert!(
body.contains(r#"x-on:notify.window="addNotification("#),
"{path} is missing the toast stack"
);
}
}

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""#));
}
}