Skip to content

Commit

Permalink
refactor(elements/ino-dialog): migrate stencil e2e tests to playwright (
Browse files Browse the repository at this point in the history
#1330)

migrate ino-dialog tests to playwright
  • Loading branch information
BenPag authored Mar 21, 2024
1 parent b943cfb commit 06d9788
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 44 deletions.
44 changes: 0 additions & 44 deletions packages/elements/src/components/ino-dialog/ino-dialog.e2e.ts

This file was deleted.

23 changes: 23 additions & 0 deletions packages/storybook/src/stories/ino-dialog/ino-dialog.spec.ts
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();
});
});

0 comments on commit 06d9788

Please sign in to comment.