test(item-divider): migrate to generators (#27323)
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. --> Item divider tests use legacy syntax ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Item divider 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,39 +0,0 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { test } from '@utils/test/playwright';
|
||||
|
||||
test.describe('item-divider: basic', () => {
|
||||
test('should display an item divider with text', async ({ page }) => {
|
||||
await page.setContent(`
|
||||
<ion-item-divider>
|
||||
<ion-label>Item Divider</ion-label>
|
||||
</ion-item-divider>
|
||||
`);
|
||||
|
||||
const divider = page.locator('ion-item-divider');
|
||||
await expect(divider).toHaveScreenshot(`item-divider-text-${page.getSnapshotSettings()}.png`);
|
||||
});
|
||||
|
||||
test('should display an item divider with a button in the end slot', async ({ page }) => {
|
||||
await page.setContent(`
|
||||
<ion-item-divider>
|
||||
<ion-label>Item Divider</ion-label>
|
||||
<ion-button slot="end">Button</ion-button>
|
||||
</ion-item-divider>
|
||||
`);
|
||||
|
||||
const divider = page.locator('ion-item-divider');
|
||||
await expect(divider).toHaveScreenshot(`item-divider-button-end-${page.getSnapshotSettings()}.png`);
|
||||
});
|
||||
|
||||
test('should display an item divider with an icon in the start slot', async ({ page }) => {
|
||||
await page.setContent(`
|
||||
<ion-item-divider>
|
||||
<ion-icon slot="start" name="star"></ion-icon>
|
||||
<ion-label>Item Divider</ion-label>
|
||||
</ion-item-divider>
|
||||
`);
|
||||
|
||||
const divider = page.locator('ion-item-divider');
|
||||
await expect(divider).toHaveScreenshot(`item-divider-icon-start-${page.getSnapshotSettings()}.png`);
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,50 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { configs, test } from '@utils/test/playwright';
|
||||
|
||||
configs().forEach(({ title, screenshot, config }) => {
|
||||
test.describe(title('item-divider: basic'), () => {
|
||||
test('should display an item divider with text', async ({ page }) => {
|
||||
await page.setContent(
|
||||
`
|
||||
<ion-item-divider>
|
||||
<ion-label>Item Divider</ion-label>
|
||||
</ion-item-divider>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const divider = page.locator('ion-item-divider');
|
||||
await expect(divider).toHaveScreenshot(screenshot(`item-divider-text`));
|
||||
});
|
||||
|
||||
test('should display an item divider with a button in the end slot', async ({ page }) => {
|
||||
await page.setContent(
|
||||
`
|
||||
<ion-item-divider>
|
||||
<ion-label>Item Divider</ion-label>
|
||||
<ion-button slot="end">Button</ion-button>
|
||||
</ion-item-divider>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const divider = page.locator('ion-item-divider');
|
||||
await expect(divider).toHaveScreenshot(screenshot(`item-divider-button-end`));
|
||||
});
|
||||
|
||||
test('should display an item divider with an icon in the start slot', async ({ page }) => {
|
||||
await page.setContent(
|
||||
`
|
||||
<ion-item-divider>
|
||||
<ion-icon slot="start" name="star"></ion-icon>
|
||||
<ion-label>Item Divider</ion-label>
|
||||
</ion-item-divider>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const divider = page.locator('ion-item-divider');
|
||||
await expect(divider).toHaveScreenshot(screenshot(`item-divider-icon-start`));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
@ -1,14 +0,0 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { test } from '@utils/test/playwright';
|
||||
|
||||
test.describe('item-divider: spec', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto('/src/components/item-divider/test/spec');
|
||||
});
|
||||
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.setIonViewport();
|
||||
|
||||
await expect(page).toHaveScreenshot(`list-item-divider-${page.getSnapshotSettings()}.png`);
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,16 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { configs, test } from '@utils/test/playwright';
|
||||
|
||||
configs().forEach(({ title, screenshot, config }) => {
|
||||
test.describe(title('item-divider: spec'), () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto('/src/components/item-divider/test/spec', config);
|
||||
});
|
||||
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.setIonViewport();
|
||||
|
||||
await expect(page).toHaveScreenshot(screenshot(`list-item-divider`));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |