From 4e971d9597bee0ad18b0b6d328bc5b9e8e7d867e Mon Sep 17 00:00:00 2001 From: slhx agent Date: Sun, 10 May 2026 23:37:55 +0200 Subject: [PATCH] test(examples): add SSE notification proof req: examples/001 req: push/001 req: push/003 --- examples/v0/src/lib.rs | 13 +++++++++++++ examples/v0/templates/notifications.heml | 4 ++++ 2 files changed, 17 insertions(+) create mode 100644 examples/v0/templates/notifications.heml diff --git a/examples/v0/src/lib.rs b/examples/v0/src/lib.rs index 363b031..95f17e1 100644 --- a/examples/v0/src/lib.rs +++ b/examples/v0/src/lib.rs @@ -105,4 +105,17 @@ mod tests { assert!(effect.has_slot(ui::slots::login_status)); assert!(matches!(effect.ops(), [Effect::Put { .. }])); } + + // req: examples/001 req: push/001 req: push/003 req: build/001 req: build/005 + #[test] + fn sse_notifications_update_a_generated_slot() { + fn notification(message: &str) -> impl IntoEffect { + ui::slots::notifications.text(message) + } + + let effect = inspect(notification("Build finished")); + + assert!(effect.has_slot(ui::slots::notifications)); + assert!(matches!(effect.ops(), [Effect::Put { .. }])); + } } diff --git a/examples/v0/templates/notifications.heml b/examples/v0/templates/notifications.heml new file mode 100644 index 0000000..c9e0c7e --- /dev/null +++ b/examples/v0/templates/notifications.heml @@ -0,0 +1,4 @@ +
+

Notifications

+
No notifications
+