test(list): migrate to generators (#27327)
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. --> List sliding tests use legacy syntax ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - List 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. -->
@@ -1,12 +0,0 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { test } from '@utils/test/playwright';
|
||||
|
||||
test.describe('list-header: basic', () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.goto(`/src/components/list-header/test/basic`);
|
||||
|
||||
await page.setIonViewport();
|
||||
|
||||
await expect(page).toHaveScreenshot(`list-header-${page.getSnapshotSettings()}.png`);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { configs, test } from '@utils/test/playwright';
|
||||
|
||||
configs().forEach(({ title, screenshot, config }) => {
|
||||
test.describe(title('list-header: basic'), () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.goto(`/src/components/list-header/test/basic`, config);
|
||||
|
||||
await page.setIonViewport();
|
||||
|
||||
await expect(page).toHaveScreenshot(screenshot(`list-header`));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@@ -1,13 +0,0 @@
|
||||
import AxeBuilder from '@axe-core/playwright';
|
||||
import { expect } from '@playwright/test';
|
||||
import { test } from '@utils/test/playwright';
|
||||
|
||||
test.describe('list: a11y', () => {
|
||||
test('should not have accessibility violations', async ({ page }) => {
|
||||
await page.goto(`/src/components/list/test/a11y`);
|
||||
|
||||
const results = await new AxeBuilder({ page }).analyze();
|
||||
|
||||
expect(results.violations).toEqual([]);
|
||||
});
|
||||
});
|
||||
15
core/src/components/list/test/a11y/list.e2e.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import AxeBuilder from '@axe-core/playwright';
|
||||
import { expect } from '@playwright/test';
|
||||
import { configs, test } from '@utils/test/playwright';
|
||||
|
||||
configs().forEach(({ title, config }) => {
|
||||
test.describe(title('list: a11y'), () => {
|
||||
test('should not have accessibility violations', async ({ page }) => {
|
||||
await page.goto(`/src/components/list/test/a11y`, config);
|
||||
|
||||
const results = await new AxeBuilder({ page }).analyze();
|
||||
|
||||
expect(results.violations).toEqual([]);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,12 +0,0 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { test } from '@utils/test/playwright';
|
||||
|
||||
test.describe('list: basic', () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.goto(`/src/components/list/test/basic`);
|
||||
|
||||
const list = page.locator('ion-list');
|
||||
|
||||
await expect(list).toHaveScreenshot(`list-basic-diff-${page.getSnapshotSettings()}.png`);
|
||||
});
|
||||
});
|
||||
14
core/src/components/list/test/basic/list.e2e.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { configs, test } from '@utils/test/playwright';
|
||||
|
||||
configs().forEach(({ title, screenshot, config }) => {
|
||||
test.describe(title('list: basic'), () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.goto(`/src/components/list/test/basic`, config);
|
||||
|
||||
const list = page.locator('ion-list');
|
||||
|
||||
await expect(list).toHaveScreenshot(screenshot(`list-basic-diff`));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
@@ -1,74 +0,0 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { test } from '@utils/test/playwright';
|
||||
|
||||
test.describe('list: inset', () => {
|
||||
test.beforeEach(({ skip }) => {
|
||||
skip.rtl();
|
||||
});
|
||||
test('should render full lines while allowing for overrides', async ({ page }) => {
|
||||
await page.setContent(`
|
||||
<ion-content color="primary">
|
||||
<div class="wrapper" style="display: flex">
|
||||
<ion-list inset="true" style="width: 100%" lines="full">
|
||||
<ion-item>
|
||||
<ion-input aria-label="Input" value="Input Text"></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>Pokémon Yellow</ion-item>
|
||||
<ion-item lines="inset">Super Metroid (with Inset Line)</ion-item>
|
||||
<ion-item lines="none">Mega Man X (with No Line)</ion-item>
|
||||
<ion-item>The Legend of Zelda</ion-item>
|
||||
<ion-item lines="full">Halo</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</ion-content>
|
||||
`);
|
||||
|
||||
const listWrapper = page.locator('.wrapper');
|
||||
|
||||
await expect(listWrapper).toHaveScreenshot(`list-inset-full-lines-${page.getSnapshotSettings()}.png`);
|
||||
});
|
||||
test('should render inset lines while allowing for overrides', async ({ page }) => {
|
||||
await page.setContent(`
|
||||
<ion-content color="primary">
|
||||
<div class="wrapper" style="display: flex">
|
||||
<ion-list inset="true" style="width: 100%" lines="inset">
|
||||
<ion-item>
|
||||
<ion-input aria-label="Input" value="Input Text"></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>Pokémon Yellow</ion-item>
|
||||
<ion-item lines="full">Super Metroid (with Full Line)</ion-item>
|
||||
<ion-item lines="none">Mega Man X (with No Line)</ion-item>
|
||||
<ion-item>The Legend of Zelda</ion-item>
|
||||
<ion-item lines="full">Halo</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</ion-content>
|
||||
`);
|
||||
|
||||
const listWrapper = page.locator('.wrapper');
|
||||
|
||||
await expect(listWrapper).toHaveScreenshot(`list-inset-inset-lines-${page.getSnapshotSettings()}.png`);
|
||||
});
|
||||
test('should render no lines while allowing for overrides', async ({ page }) => {
|
||||
await page.setContent(`
|
||||
<ion-content color="primary">
|
||||
<div class="wrapper" style="display: flex">
|
||||
<ion-list inset="true" style="width: 100%" lines="none">
|
||||
<ion-item>
|
||||
<ion-input aria-label="Input" value="Input Text"></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>Pokémon Yellow</ion-item>
|
||||
<ion-item lines="full">Super Metroid (with Full Line)</ion-item>
|
||||
<ion-item lines="inset">Mega Man X (with Inset Line)</ion-item>
|
||||
<ion-item>The Legend of Zelda</ion-item>
|
||||
<ion-item lines="full">Halo</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</ion-content>
|
||||
`);
|
||||
|
||||
const listWrapper = page.locator('.wrapper');
|
||||
|
||||
await expect(listWrapper).toHaveScreenshot(`list-inset-no-lines-${page.getSnapshotSettings()}.png`);
|
||||
});
|
||||
});
|
||||
82
core/src/components/list/test/inset/list.e2e.ts
Normal file
@@ -0,0 +1,82 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { configs, test } from '@utils/test/playwright';
|
||||
|
||||
configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
||||
test.describe(title('list: inset'), () => {
|
||||
test('should render full lines while allowing for overrides', async ({ page }) => {
|
||||
await page.setContent(
|
||||
`
|
||||
<ion-content color="primary">
|
||||
<div class="wrapper" style="display: flex">
|
||||
<ion-list inset="true" style="width: 100%" lines="full">
|
||||
<ion-item>
|
||||
<ion-input aria-label="Input" value="Input Text"></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>Pokémon Yellow</ion-item>
|
||||
<ion-item lines="inset">Super Metroid (with Inset Line)</ion-item>
|
||||
<ion-item lines="none">Mega Man X (with No Line)</ion-item>
|
||||
<ion-item>The Legend of Zelda</ion-item>
|
||||
<ion-item lines="full">Halo</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</ion-content>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const listWrapper = page.locator('.wrapper');
|
||||
|
||||
await expect(listWrapper).toHaveScreenshot(screenshot(`list-inset-full-lines`));
|
||||
});
|
||||
test('should render inset lines while allowing for overrides', async ({ page }) => {
|
||||
await page.setContent(
|
||||
`
|
||||
<ion-content color="primary">
|
||||
<div class="wrapper" style="display: flex">
|
||||
<ion-list inset="true" style="width: 100%" lines="inset">
|
||||
<ion-item>
|
||||
<ion-input aria-label="Input" value="Input Text"></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>Pokémon Yellow</ion-item>
|
||||
<ion-item lines="full">Super Metroid (with Full Line)</ion-item>
|
||||
<ion-item lines="none">Mega Man X (with No Line)</ion-item>
|
||||
<ion-item>The Legend of Zelda</ion-item>
|
||||
<ion-item lines="full">Halo</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</ion-content>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const listWrapper = page.locator('.wrapper');
|
||||
|
||||
await expect(listWrapper).toHaveScreenshot(screenshot(`list-inset-inset-lines`));
|
||||
});
|
||||
test('should render no lines while allowing for overrides', async ({ page }) => {
|
||||
await page.setContent(
|
||||
`
|
||||
<ion-content color="primary">
|
||||
<div class="wrapper" style="display: flex">
|
||||
<ion-list inset="true" style="width: 100%" lines="none">
|
||||
<ion-item>
|
||||
<ion-input aria-label="Input" value="Input Text"></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>Pokémon Yellow</ion-item>
|
||||
<ion-item lines="full">Super Metroid (with Full Line)</ion-item>
|
||||
<ion-item lines="inset">Mega Man X (with Inset Line)</ion-item>
|
||||
<ion-item>The Legend of Zelda</ion-item>
|
||||
<ion-item lines="full">Halo</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</ion-content>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const listWrapper = page.locator('.wrapper');
|
||||
|
||||
await expect(listWrapper).toHaveScreenshot(screenshot(`list-inset-no-lines`));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
@@ -1,26 +0,0 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { test } from '@utils/test/playwright';
|
||||
|
||||
test.describe('list: lines', () => {
|
||||
test('lines="full" should render correctly', async ({ page }) => {
|
||||
await page.goto(`/src/components/list/test/lines`);
|
||||
|
||||
const list = page.locator('ion-list[lines="full"]');
|
||||
|
||||
await expect(list).toHaveScreenshot(`list-lines-full-${page.getSnapshotSettings()}.png`);
|
||||
});
|
||||
test('lines="inset" should render correctly', async ({ page }) => {
|
||||
await page.goto(`/src/components/list/test/lines`);
|
||||
|
||||
const list = page.locator('ion-list[lines="inset"]');
|
||||
|
||||
await expect(list).toHaveScreenshot(`list-lines-inset-${page.getSnapshotSettings()}.png`);
|
||||
});
|
||||
test('lines="none" should render correctly', async ({ page }) => {
|
||||
await page.goto(`/src/components/list/test/lines`);
|
||||
|
||||
const list = page.locator('ion-list[lines="none"]');
|
||||
|
||||
await expect(list).toHaveScreenshot(`list-lines-none-${page.getSnapshotSettings()}.png`);
|
||||
});
|
||||
});
|
||||
28
core/src/components/list/test/lines/list.e2e.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { configs, test } from '@utils/test/playwright';
|
||||
|
||||
configs().forEach(({ title, screenshot, config }) => {
|
||||
test.describe(title('list: lines'), () => {
|
||||
test('lines="full" should render correctly', async ({ page }) => {
|
||||
await page.goto(`/src/components/list/test/lines`, config);
|
||||
|
||||
const list = page.locator('ion-list[lines="full"]');
|
||||
|
||||
await expect(list).toHaveScreenshot(screenshot(`list-lines-full`));
|
||||
});
|
||||
test('lines="inset" should render correctly', async ({ page }) => {
|
||||
await page.goto(`/src/components/list/test/lines`, config);
|
||||
|
||||
const list = page.locator('ion-list[lines="inset"]', config);
|
||||
|
||||
await expect(list).toHaveScreenshot(screenshot(`list-lines-inset`));
|
||||
});
|
||||
test('lines="none" should render correctly', async ({ page }) => {
|
||||
await page.goto(`/src/components/list/test/lines`, config);
|
||||
|
||||
const list = page.locator('ion-list[lines="none"]', config);
|
||||
|
||||
await expect(list).toHaveScreenshot(screenshot(`list-lines-none`));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 9.8 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |