feat: add empty state and expand overlay qa
This commit is contained in:
@@ -59,4 +59,30 @@ describe("Tooltip", () => {
|
||||
expect(onOpenChange).toHaveBeenCalledWith(true);
|
||||
});
|
||||
});
|
||||
|
||||
it("shows tooltip content on focus and hides it on blur", async () => {
|
||||
render(
|
||||
<TooltipProvider delayDuration={0}>
|
||||
<Tooltip>
|
||||
<TooltipTrigger>Focus help</TooltipTrigger>
|
||||
<TooltipContent>Focus context</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
);
|
||||
|
||||
const trigger = screen.getByRole("button", { name: "Focus help" });
|
||||
|
||||
trigger.focus();
|
||||
|
||||
const tooltip = await screen.findByRole("tooltip");
|
||||
|
||||
expect(tooltip).toHaveTextContent("Focus context");
|
||||
expect(trigger).toHaveFocus();
|
||||
|
||||
trigger.blur();
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.queryByRole("tooltip")).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user