This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix mobile menu modals not opening for the second time (#1386)
* Fix mobile menu modals not opening for the second time * Fix e2e tests * Set the default hideOnClickOutside for modal to false * Make e2e header button test work for mobile and desktop
- Loading branch information
Showing
5 changed files
with
86 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { test, expect } from '@playwright/test' | ||
|
||
import { | ||
closeMobileMenu, | ||
openFilters, | ||
openMobileMenu, | ||
} from '~~/test/playwright/utils/navigation' | ||
|
||
const mockUaString = | ||
'Mozilla/5.0 (Android 7.0; Mobile; rv:54.0) Gecko/54.0 Firefox/54.0' | ||
const mobileFixture = { | ||
viewport: { width: 640, height: 700 }, | ||
userAgent: mockUaString, | ||
} | ||
test.use(mobileFixture) | ||
|
||
test('Can open filters menu on mobile at least twice', async ({ page }) => { | ||
await page.goto('/search/?q=cat') | ||
|
||
await openFilters(page) | ||
await expect(page.locator(`input[type="checkbox"]`)).toHaveCount(11, { | ||
timeout: 100, | ||
}) | ||
await closeMobileMenu(page) | ||
await expect(page.locator(`input[type="checkbox"]`)).toHaveCount(0, { | ||
timeout: 100, | ||
}) | ||
|
||
await openFilters(page) | ||
await expect(page.locator(`input[type="checkbox"]`)).toHaveCount(11, { | ||
timeout: 100, | ||
}) | ||
}) | ||
|
||
test('Can open mobile menu at least twice', async ({ page }) => { | ||
await page.goto('/search/?q=cat') | ||
await openMobileMenu(page) | ||
await expect(page.locator('button', { hasText: 'Close' })).toBeVisible() | ||
await closeMobileMenu(page) | ||
await expect(page.locator('button', { hasText: 'Close' })).not.toBeVisible() | ||
await openMobileMenu(page) | ||
await expect(page.locator('button', { hasText: 'Close' })).toBeVisible() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters