feat: add empty state and expand overlay qa

This commit is contained in:
2026-03-19 19:00:36 +08:00
parent f318f94c9a
commit 132bb6961d
20 changed files with 1094 additions and 6 deletions
@@ -105,4 +105,29 @@ describe("Dialog", () => {
expect(within(dialog).getByText("Summary").closest('[data-slot="header"]')).toBeInTheDocument();
expect(within(dialog).getByRole("button", { name: "Close" }).closest('[data-slot="footer"]')).toBeInTheDocument();
});
it("returns focus to the trigger after Escape closes the dialog", async () => {
const user = userEvent.setup();
render(
<Dialog>
<DialogTrigger>Open accessible dialog</DialogTrigger>
<DialogContent>
<DialogTitle>Accessibility</DialogTitle>
</DialogContent>
</Dialog>
);
const trigger = screen.getByRole("button", { name: "Open accessible dialog" });
await user.click(trigger);
expect(await screen.findByRole("dialog")).toBeInTheDocument();
await user.keyboard("{Escape}");
await waitFor(() => {
expect(screen.queryByRole("dialog")).not.toBeInTheDocument();
expect(trigger).toHaveFocus();
});
});
});