Skip to content

Commit

Permalink
chore(supersearch): add test for closing expanded search
Browse files Browse the repository at this point in the history
  • Loading branch information
johanbissemattsson committed Nov 29, 2024
1 parent a768ad3 commit 1a910be
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/supersearch/e2e/supersearch.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,26 @@ three`)
).toHaveText('One two three');
});

test('expanded search is closable', async ({ page }) => {
await page.locator('[data-test-id="test1"]').getByRole('textbox').locator('div').click();
await expect(page.locator('[data-test-id="test1"]').getByRole('dialog').first()).toBeVisible();
await page.keyboard.press('Escape');
await expect(
page.locator('[data-test-id="test1"]').getByRole('dialog').first(),
'by pressing the Escape key'
).not.toBeVisible();
await page.locator('[data-test-id="test1"]').getByRole('textbox').locator('div').click();
await page
.locator('[data-test-id="test1"]')
.getByRole('dialog')
.first()
.click({ position: { x: 0, y: 0 } });
await expect(
page.locator('[data-test-id="test1"]').getByRole('dialog').first(),
'by clicking outside'
).not.toBeVisible();
});

test('syncs collapsed and expanded editor views', async ({ page }) => {
await page.locator('[data-test-id="test1"]').getByRole('textbox').locator('div').click();
await page
Expand Down

0 comments on commit 1a910be

Please sign in to comment.