test(menu): migrate to generators (#27330)

Issue number: N/A

---------

<!-- Please refer to our contributing documentation for any questions on
submitting a pull request, or let us know here if you need any help:
https://ionicframework.com/docs/building/contributing -->

<!-- Some docs updates need to be made in the `ionic-docs` repo, in a
separate PR. See
https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#modifying-documentation
for details. -->

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

Menu sliding tests use legacy syntax

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Menu sliding tests use modern syntax

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->
This commit is contained in:
Liam DeBeasi
2023-04-28 12:07:48 -04:00
committed by GitHub
parent c3a3961478
commit f62ba3e8a6
63 changed files with 359 additions and 349 deletions

View File

@ -1,17 +0,0 @@
import AxeBuilder from '@axe-core/playwright';
import { expect } from '@playwright/test';
import { test } from '@utils/test/playwright';
test.describe('menu-button: a11y', () => {
test.beforeEach(({ skip }) => {
skip.rtl();
});
test('should not have accessibility violations', async ({ page }) => {
await page.goto('/src/components/menu-button/test/a11y');
const results = await new AxeBuilder({ page }).analyze();
expect(results.violations).toEqual([]);
});
});

View File

@ -0,0 +1,15 @@
import AxeBuilder from '@axe-core/playwright';
import { expect } from '@playwright/test';
import { configs, test } from '@utils/test/playwright';
configs({ directions: ['ltr'] }).forEach(({ title, config }) => {
test.describe(title('menu-button: a11y'), () => {
test('should not have accessibility violations', async ({ page }) => {
await page.goto('/src/components/menu-button/test/a11y', config);
const results = await new AxeBuilder({ page }).analyze();
expect(results.violations).toEqual([]);
});
});
});

View File

@ -1,16 +0,0 @@
import { expect } from '@playwright/test';
import { test } from '@utils/test/playwright';
test.describe('menu-button: basic', () => {
test.beforeEach(({ skip }) => {
skip.rtl();
});
test('should not have visual regressions', async ({ page }) => {
await page.goto(`/src/components/menu-button/test/basic`);
await page.setIonViewport();
await expect(page).toHaveScreenshot(`menu-button-diff-${page.getSnapshotSettings()}.png`);
});
});

View File

@ -0,0 +1,14 @@
import { expect } from '@playwright/test';
import { configs, test } from '@utils/test/playwright';
configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('menu-button: basic'), () => {
test('should not have visual regressions', async ({ page }) => {
await page.goto(`/src/components/menu-button/test/basic`, config);
await page.setIonViewport();
await expect(page).toHaveScreenshot(screenshot(`menu-button-diff`));
});
});
});