test(list): take screenshot of single component (#26458)
@@ -2,14 +2,25 @@ import { expect } from '@playwright/test';
|
||||
import { test } from '@utils/test/playwright';
|
||||
|
||||
test.describe('list: inset', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto('/src/components/list/test/inset');
|
||||
});
|
||||
test.describe('list: visual regression tests', () => {
|
||||
test.describe('list: rendering', () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.setIonViewport();
|
||||
await page.setContent(`
|
||||
<ion-content color="primary">
|
||||
<div class="wrapper" style="display: flex">
|
||||
<ion-list inset="true" style="width: 100%">
|
||||
<ion-item>Pokémon Yellow</ion-item>
|
||||
<ion-item>Super Metroid</ion-item>
|
||||
<ion-item>Mega Man X</ion-item>
|
||||
<ion-item>The Legend of Zelda</ion-item>
|
||||
<ion-item lines="full">Halo</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</ion-content>
|
||||
`);
|
||||
|
||||
expect(await page.screenshot()).toMatchSnapshot(`list-inset-diff-${page.getSnapshotSettings()}.png`);
|
||||
const listWrapper = page.locator('.wrapper');
|
||||
|
||||
expect(await listWrapper.screenshot()).toMatchSnapshot(`list-inset-diff-${page.getSnapshotSettings()}.png`);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 30 KiB |