-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(elements/ino-dialog): migrate stencil e2e tests to playwright (
#1330) migrate ino-dialog tests to playwright
- Loading branch information
Showing
2 changed files
with
23 additions
and
44 deletions.
There are no files selected for viewing
44 changes: 0 additions & 44 deletions
44
packages/elements/src/components/ino-dialog/ino-dialog.e2e.ts
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
packages/storybook/src/stories/ino-dialog/ino-dialog.spec.ts
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,23 @@ | ||
import { expect, Locator, test } from '@playwright/test'; | ||
import { goToStory, setAttribute } from '../test-utils'; | ||
|
||
test.describe('ino-dialog', () => { | ||
let inoDialog: Locator; | ||
let mdcDialog: Locator; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await goToStory(page, ['Structure', 'ino-dialog', 'default']); | ||
inoDialog = page.locator('ino-dialog'); | ||
mdcDialog = page.getByRole('dialog'); | ||
}); | ||
|
||
test('should close the dialog upon setting open to false', async () => { | ||
await setAttribute(inoDialog, 'open', 'false'); | ||
await expect(mdcDialog).toBeHidden(); | ||
}); | ||
|
||
test('should open the dialog upon setting open to true', async () => { | ||
await setAttribute(inoDialog, 'open', 'true'); | ||
await expect(mdcDialog).toBeVisible(); | ||
}); | ||
}); |