chore(): sync with main
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 26 KiB |
@ -1,48 +1,67 @@
|
||||
import type { Locator } from '@playwright/test';
|
||||
import { expect } from '@playwright/test';
|
||||
import type { EventSpy } from '@utils/test/playwright';
|
||||
import { test } from '@utils/test/playwright';
|
||||
import { configs, test } from '@utils/test/playwright';
|
||||
|
||||
test.describe('item: inputs', () => {
|
||||
let ionPopoverDidPresent: EventSpy;
|
||||
let ionPopoverDidDismiss: EventSpy;
|
||||
let formData: EventSpy;
|
||||
configs().forEach(({ title, screenshot, config }) => {
|
||||
test.describe(title('item: inputs'), () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.goto(`/src/components/item/test/inputs`, config);
|
||||
|
||||
let popover: Locator;
|
||||
await page.setIonViewport();
|
||||
await expect(page).toHaveScreenshot(screenshot(`item-inputs`));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto(`/src/components/item/test/inputs`);
|
||||
configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
||||
test.describe(title('disabled state rendering'), () => {
|
||||
let ionPopoverDidPresent: EventSpy;
|
||||
let ionPopoverDidDismiss: EventSpy;
|
||||
|
||||
ionPopoverDidPresent = await page.spyOnEvent('ionPopoverDidPresent');
|
||||
ionPopoverDidDismiss = await page.spyOnEvent('ionPopoverDidDismiss');
|
||||
formData = await page.spyOnEvent('formData');
|
||||
let popover: Locator;
|
||||
|
||||
popover = page.locator('ion-popover#optionsPopover');
|
||||
});
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto(`/src/components/item/test/inputs`, config);
|
||||
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.setIonViewport();
|
||||
await expect(page).toHaveScreenshot(`item-inputs-${page.getSnapshotSettings()}.png`);
|
||||
});
|
||||
ionPopoverDidPresent = await page.spyOnEvent('ionPopoverDidPresent');
|
||||
ionPopoverDidDismiss = await page.spyOnEvent('ionPopoverDidDismiss');
|
||||
|
||||
test('disabled controls should not have visual regressions', async ({ page }) => {
|
||||
await page.click('#popover-trigger');
|
||||
await ionPopoverDidPresent.next();
|
||||
popover = page.locator('ion-popover#optionsPopover');
|
||||
});
|
||||
test('disabled controls should not have visual regressions', async ({ page }) => {
|
||||
await page.click('#popover-trigger');
|
||||
await ionPopoverDidPresent.next();
|
||||
|
||||
await page.click('#btnDisabled');
|
||||
await page.click('#btnDisabled');
|
||||
|
||||
await page.waitForChanges();
|
||||
await page.waitForChanges();
|
||||
|
||||
await popover.evaluateHandle((el: HTMLIonPopoverElement) => el.dismiss());
|
||||
await ionPopoverDidDismiss.next();
|
||||
await popover.evaluateHandle((el: HTMLIonPopoverElement) => el.dismiss());
|
||||
await ionPopoverDidDismiss.next();
|
||||
|
||||
await page.setIonViewport();
|
||||
await expect(page).toHaveScreenshot(`item-inputs-disabled-${page.getSnapshotSettings()}.png`);
|
||||
await page.setIonViewport();
|
||||
await expect(page).toHaveScreenshot(screenshot(`item-inputs-disabled`));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => {
|
||||
test.describe(title('form data'), () => {
|
||||
let ionPopoverDidPresent: EventSpy;
|
||||
let ionPopoverDidDismiss: EventSpy;
|
||||
let formData: EventSpy;
|
||||
|
||||
let popover: Locator;
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto(`/src/components/item/test/inputs`, config);
|
||||
|
||||
ionPopoverDidPresent = await page.spyOnEvent('ionPopoverDidPresent');
|
||||
ionPopoverDidDismiss = await page.spyOnEvent('ionPopoverDidDismiss');
|
||||
formData = await page.spyOnEvent('formData');
|
||||
|
||||
test.describe('form data', () => {
|
||||
test.beforeEach(async ({ skip }) => {
|
||||
skip.rtl();
|
||||
popover = page.locator('ion-popover#optionsPopover');
|
||||
});
|
||||
|
||||
test('initial form data should be empty', async ({ page }) => {
|
||||
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |