Skip to content

Commit

Permalink
Add tests for window resize
Browse files Browse the repository at this point in the history
  • Loading branch information
elchininet committed Dec 18, 2023
1 parent c70c4c6 commit 1291767
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/main-options.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ test('Option: override after', async ({ page }) => {
await expect(page.locator(TABS_CONTENT_SELECTOR)).toHaveScreenshot('06-override-after.png');
});

test('Should be the same after a window resize', async ({ page }) => {
await page.goto(
getLovelaceUrl()
);
await expect(page.locator(HEADER_SELECTOR)).toBeVisible();
await page.evaluate(() => window.dispatchEvent(new Event('resize')));
await expect(page.locator(TABS_CONTENT_SELECTOR)).toHaveScreenshot('01-enabled.png');
});

test.describe('Small viewport', () => {

test.use({ viewport: { width: 400, height: 600 } });
Expand Down

0 comments on commit 1291767

Please sign in to comment.