Skip to content

Commit

Permalink
Merge pull request #199 from Dataport/test/add-icon-menu-test
Browse files Browse the repository at this point in the history
add icon menu test
  • Loading branch information
warm-coolguy authored Nov 18, 2024
2 parents 8b112a6 + f6f1244 commit 50eb85b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions e2e/iconMenu.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { test, expect, Page } from '@playwright/test'
import { openSnowbox } from './utils/openSnowbox'

const expectOpenContentWindows = async (page: Page, amount: number) =>
expect(await page.locator('.icon-menu-list-item-content')).toHaveCount(amount)

test('opens and closes children exclusively to each other', async ({
page,
}) => {
await openSnowbox(page)

// one window open initially
await expectOpenContentWindows(page, 1)

// window closed
await page.locator('.icon-menu-list-item button').first().click()
await expectOpenContentWindows(page, 0)

// window reopened
await page.locator('.icon-menu-list-item button').first().click()
await expectOpenContentWindows(page, 1)

// opening another window closes the first one
await page.locator('.icon-menu-list-item:nth-child(2) button').first().click()
await expectOpenContentWindows(page, 1)
})

0 comments on commit 50eb85b

Please sign in to comment.