mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-05 08:07:05 +00:00
fix(e2e): measure the clipped popup and assert the table's empty state
Two assertions were checking the wrong thing. The anchoring tests read
getByRole("listbox"), which resolves to SelectPrimitive.List; that sits at
full content height inside the popup that clips and scrolls it, so the box
overlapped the trigger even when nothing visible did. Measure the popup.
The SSO-ID search expected zero rows, but DataTable renders a "No results"
message row when a filter matches nothing, so the count is one. Assert the
empty state the user actually sees.
This commit is contained in:
parent
cc258b5473
commit
abd8beec01
2 changed files with 7 additions and 7 deletions
|
|
@ -23,6 +23,8 @@ async function boxes(trigger: Locator, options: Locator) {
|
|||
return triggerBox && optionsBox ? { triggerBox, optionsBox } : null;
|
||||
}
|
||||
|
||||
const clippedPopup = (page: PlaywrightPage) => page.locator('[data-slot="select-content"]');
|
||||
|
||||
function pollOptionsOpenBelowTrigger(trigger: Locator, options: Locator) {
|
||||
return expect.poll(async () => {
|
||||
const box = await boxes(trigger, options);
|
||||
|
|
@ -50,10 +52,9 @@ test.describe("Auto Router template select anchoring", () => {
|
|||
await trigger.scrollIntoViewIfNeeded();
|
||||
|
||||
await trigger.click();
|
||||
const options = page.getByRole("listbox");
|
||||
await expect(options).toBeVisible();
|
||||
await expect(page.getByRole("listbox")).toBeVisible();
|
||||
|
||||
await pollOptionsOpenBelowTrigger(trigger, options).toBe(true);
|
||||
await pollOptionsOpenBelowTrigger(trigger, clippedPopup(page)).toBe(true);
|
||||
});
|
||||
|
||||
test("keeps the trigger uncovered when the options open with no room below it", async ({ page }) => {
|
||||
|
|
@ -62,9 +63,8 @@ test.describe("Auto Router template select anchoring", () => {
|
|||
await trigger.scrollIntoViewIfNeeded();
|
||||
|
||||
await trigger.click();
|
||||
const options = page.getByRole("listbox");
|
||||
await expect(options).toBeVisible();
|
||||
await expect(page.getByRole("listbox")).toBeVisible();
|
||||
|
||||
await pollOptionsCoverTrigger(trigger, options).toBe(false);
|
||||
await pollOptionsCoverTrigger(trigger, clippedPopup(page)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -46,6 +46,6 @@ test.describe("Internal Users Search", () => {
|
|||
await page.getByTestId("users-filter-sso-id").fill("e2e-sso-id-that-matches-nobody");
|
||||
await page.getByTestId("filter-drawer-apply").click();
|
||||
|
||||
await expect(userRows(page)).toHaveCount(0, { timeout: 30_000 });
|
||||
await expect(page.getByRole("row").filter({ hasText: "No results" })).toBeVisible({ timeout: 30_000 });
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue