Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions tests/e2e/ui/tests/modelsPage/autoRouterTemplateSelect.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ async function boxes(trigger: Locator, options: Locator) {

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);
return box && box.optionsBox.y >= box.triggerBox.y + box.triggerBox.height;
});
}

function pollOptionsCoverTrigger(trigger: Locator, options: Locator) {
return expect.poll(async () => {
const box = await boxes(trigger, options);
Expand All @@ -46,19 +39,6 @@ function pollOptionsCoverTrigger(trigger: Locator, options: Locator) {
test.describe("Auto Router template select anchoring", () => {
test.use({ storageState: ADMIN_STORAGE_PATH });

test("opens the options below the trigger when there is room below it", async ({ page }) => {
const viewport = { width: 1280, height: 900 };
await page.setViewportSize(viewport);
const trigger = await openTemplateSelect(page);
await trigger.evaluate((element) => element.scrollIntoView({ block: "start" }));
await expect.poll(async () => (await trigger.boundingBox())?.y).toBeLessThan(viewport.height / 2);

await trigger.click();
await expect(page.getByRole("listbox")).toBeVisible();

await pollOptionsOpenBelowTrigger(trigger, clippedPopup(page)).toBe(true);
});

test("keeps the trigger uncovered when the options open with no room below it", async ({ page }) => {
await page.setViewportSize({ width: 1280, height: 560 });
const trigger = await openTemplateSelect(page);
Expand Down
Loading