Skip to content

Commit

Permalink
fix: media_viewer test
Browse files Browse the repository at this point in the history
  • Loading branch information
roar-larsen committed Nov 29, 2023
1 parent 0d112fe commit 2e73259
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions e2e/tests/plugin-form-Media_viewer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ test('Media viewer', async ({ page }) => {
})
await test.step('gif', async () => {
await page.getByRole('button', { name: 'fast' }).click()
await expect(page.locator('img')).toHaveJSProperty('complete', true)
await expect(page.locator('img')).not.toHaveJSProperty('naturalWidth', 0)
await expect(page.getByRole('img', { name: 'fast' })).toBeVisible()
await page.getByRole('button', { name: 'view meta info' }).click()

const page1Promise = page.waitForEvent('popup')
await expect(dialog.getByText('image/gif')).toBeVisible()
await dialog.getByRole('link', { name: 'New tab' }).click()
const newTab = await page1Promise
await expect(newTab.getByRole('img')).toBeVisible()
await newTab.close()

const downloadPromise = page.waitForEvent('download')
await page.getByRole('link', { name: 'Download' }).click()
const download = await downloadPromise
Expand All @@ -45,6 +45,8 @@ test('Media viewer', async ({ page }) => {

await test.step('image', async () => {
await page.getByRole('button', { name: 'beauty' }).click()
await expect(page.locator('img')).toHaveJSProperty('complete', true)
await expect(page.locator('img')).not.toHaveJSProperty('naturalWidth', 0)
await expect(page.getByRole('img', { name: 'beauty' })).toBeVisible()
await page.getByRole('button', { name: 'view meta info' }).click()

Expand Down

0 comments on commit 2e73259

Please sign in to comment.