Panics · P09 Overlays: a lightbox or tour past its last item closes

This commit is contained in:
ZacharyZhang-NY committed 2026-10-06 17:14:09 -04:00
1 parent 7af7c409c9
commit 8f00d2eabb
4 files changed
+35 -15

No files matched your search

+18
View File
@@ -352,3 +352,21 @@ fn left_from_back_keeps_the_tour_keys(cx: &mut TestAppContext) {
press("right", cx);
assert_eq!(state(&view, cx).1, 1);
}
#[gpui::test]
fn a_lightbox_or_tour_past_its_last_closes(cx: &mut TestAppContext) {
let (view, cx) = guides(cx);
for open in [Open::Lightbox, Open::Tour] {
view.update(cx, |guides, cx| {
guides.open = Some(open);
guides.at = 5;
cx.notify();
});
settle(cx);
assert_eq!(
view.read_with(cx, |guides, _| guides.open),
None,
"{open:?}"
);
}
}