mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-23 05:34:41 +00:00
test(ui): select accessible dialog and scroll region without DOM traversal
This commit is contained in:
parent
4242c9485d
commit
1bd67cde1d
1 changed files with 3 additions and 4 deletions
|
|
@ -25,13 +25,12 @@ describe("AddGuardrailForm close behavior", () => {
|
|||
it("keeps the wizard bounded and scrollable on narrow viewports", () => {
|
||||
renderForm();
|
||||
|
||||
const dialog = screen.getByText("Create guardrail").closest('[data-slot="dialog-content"]');
|
||||
const dialog = screen.getByRole("dialog");
|
||||
expect(dialog).toHaveClass("max-w-[1000px]");
|
||||
expect(dialog).toHaveClass("w-[calc(100vw-2rem)]");
|
||||
|
||||
const scrollRegion = dialog?.querySelector(".overflow-x-auto.overflow-y-auto");
|
||||
expect(scrollRegion).not.toBeNull();
|
||||
expect(scrollRegion).toHaveClass("max-w-full");
|
||||
const scrollRegion = screen.getByTestId("guardrail-wizard-scroll-region");
|
||||
expect(scrollRegion).toHaveClass("max-w-full", "overflow-x-auto", "overflow-y-auto");
|
||||
});
|
||||
|
||||
it("does not close when the user clicks outside the modal on the mask", () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue