Skip to content

Commit 9c73aee

Browse files
authored
Merge branch 'main' into fix/text-locator-heatmap
2 parents 0cde40b + 50eb85b commit 9c73aee

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

e2e/iconMenu.spec.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { test, expect, Page } from '@playwright/test'
2+
import { openSnowbox } from './utils/openSnowbox'
3+
4+
const expectOpenContentWindows = async (page: Page, amount: number) =>
5+
expect(await page.locator('.icon-menu-list-item-content')).toHaveCount(amount)
6+
7+
test('opens and closes children exclusively to each other', async ({
8+
page,
9+
}) => {
10+
await openSnowbox(page)
11+
12+
// one window open initially
13+
await expectOpenContentWindows(page, 1)
14+
15+
// window closed
16+
await page.locator('.icon-menu-list-item button').first().click()
17+
await expectOpenContentWindows(page, 0)
18+
19+
// window reopened
20+
await page.locator('.icon-menu-list-item button').first().click()
21+
await expectOpenContentWindows(page, 1)
22+
23+
// opening another window closes the first one
24+
await page.locator('.icon-menu-list-item:nth-child(2) button').first().click()
25+
await expectOpenContentWindows(page, 1)
26+
})

0 commit comments

Comments
 (0)