test(examples): add SSE notification proof
req: examples/001 req: push/001 req: push/003
This commit is contained in:
@@ -105,4 +105,17 @@ mod tests {
|
|||||||
assert!(effect.has_slot(ui::slots::login_status));
|
assert!(effect.has_slot(ui::slots::login_status));
|
||||||
assert!(matches!(effect.ops(), [Effect::Put { .. }]));
|
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 { .. }]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<section data-slhx-root="notifications">
|
||||||
|
<h2>Notifications</h2>
|
||||||
|
<div data-slhx-slot="notifications">No notifications</div>
|
||||||
|
</section>
|
||||||
Reference in New Issue
Block a user