test(select): migrate to toHaveScreenshot (#28088)
Issue number: N/A --------- <!-- 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. --> Several tests for this component are still using Playwright's old `toMatchSnapshot` assertion. It's now recommended to use the newer `toHaveScreenshot` assertion. This new assertion reduces the size of each screenshot and brings anti-flake improvements such as disabling animations by default. We previously migrated most of our codebase to use `toHaveScreenshot`, but it looks like we missed the tests that were written during the development of Ionic 7 in a separate branch off `main`. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Migrate component tests to use `toHaveScreenshot`. Note: There should be no layout changes to any of the screenshots. The only difference between the old and new screenshots should be image and file size. ## 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. --> --------- Co-authored-by: ionitron <hi@ionicframework.com>
@ -18,7 +18,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
||||
);
|
||||
|
||||
const card = page.locator('ion-card');
|
||||
expect(await card.screenshot()).toMatchSnapshot(screenshot(`select-card`));
|
||||
await expect(card).toHaveScreenshot(screenshot(`select-card`));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 1.2 KiB |
@ -15,7 +15,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot({ animations: 'disabled' })).toMatchSnapshot(screenshot(`select-no-fill-color`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-no-fill-color`));
|
||||
});
|
||||
});
|
||||
test.describe('input: fill solid', () => {
|
||||
@ -30,7 +30,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot({ animations: 'disabled' })).toMatchSnapshot(screenshot(`select-solid-color`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-solid-color`));
|
||||
});
|
||||
});
|
||||
test.describe('input: fill outline', () => {
|
||||
@ -45,7 +45,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot({ animations: 'disabled' })).toMatchSnapshot(screenshot(`select-outline-color`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-outline-color`));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 1.7 KiB |
@ -19,7 +19,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-fill-solid`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-fill-solid`));
|
||||
});
|
||||
test('should render correctly with floating label', async ({ page }) => {
|
||||
await page.setContent(
|
||||
@ -37,7 +37,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-fill-solid-label-floating`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-fill-solid-label-floating`));
|
||||
});
|
||||
test('should not have visual regressions with shaped solid', async ({ page }) => {
|
||||
await page.setContent(
|
||||
@ -55,7 +55,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-fill-shaped-solid`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-fill-shaped-solid`));
|
||||
});
|
||||
test('padding and border radius should be customizable', async ({ page }) => {
|
||||
await page.setContent(
|
||||
@ -81,7 +81,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-fill-shaped-solid-custom`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-fill-shaped-solid-custom`));
|
||||
});
|
||||
});
|
||||
test.describe('select: fill outline', () => {
|
||||
@ -100,7 +100,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-fill-outline`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-fill-outline`));
|
||||
});
|
||||
test('should render correctly with floating label', async ({ page }) => {
|
||||
await page.setContent(
|
||||
@ -118,7 +118,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-fill-outline-label-floating`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-fill-outline-label-floating`));
|
||||
});
|
||||
|
||||
test('should not have visual regressions with shaped outline', async ({ page }) => {
|
||||
@ -137,7 +137,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-fill-shaped-outline`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-fill-shaped-outline`));
|
||||
});
|
||||
test('padding and border radius should be customizable', async ({ page }) => {
|
||||
await page.setContent(
|
||||
@ -163,7 +163,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-fill-shaped-outline-custom`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-fill-shaped-outline-custom`));
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -192,7 +192,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-fill-outline-slotted-label`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-fill-outline-slotted-label`));
|
||||
});
|
||||
test('should render the notch correctly with a slotted label after the select was originally hidden', async ({
|
||||
page,
|
||||
@ -221,7 +221,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
||||
|
||||
await select.evaluate((el: HTMLIonSelectElement) => el.style.removeProperty('display'));
|
||||
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-fill-outline-hidden-slotted-label`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-fill-outline-hidden-slotted-label`));
|
||||
});
|
||||
});
|
||||
test.describe(title('select: notch cutout'), () => {
|
||||
|
||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 1.6 KiB |
@ -139,9 +139,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot({ animations: 'disabled' })).toMatchSnapshot(
|
||||
screenshot(`select-no-fill-highlight`)
|
||||
);
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-no-fill-highlight`));
|
||||
});
|
||||
});
|
||||
test.describe('select: solid', () => {
|
||||
@ -154,9 +152,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot({ animations: 'disabled' })).toMatchSnapshot(
|
||||
screenshot(`select-solid-highlight`)
|
||||
);
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-solid-highlight`));
|
||||
});
|
||||
});
|
||||
test.describe('select: outline', () => {
|
||||
@ -169,9 +165,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot({ animations: 'disabled' })).toMatchSnapshot(
|
||||
screenshot(`select-outline-highlight`)
|
||||
);
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-outline-highlight`));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 1.2 KiB |
@ -20,7 +20,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
||||
config
|
||||
);
|
||||
const list = page.locator('ion-list');
|
||||
expect(await list.screenshot()).toMatchSnapshot(screenshot(`select-list-no-fill`));
|
||||
await expect(list).toHaveScreenshot(screenshot(`select-list-no-fill`));
|
||||
});
|
||||
test('should render correctly in inset list with no fill', async ({ page }) => {
|
||||
await page.setContent(
|
||||
@ -39,7 +39,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
||||
config
|
||||
);
|
||||
const list = page.locator('ion-list');
|
||||
expect(await list.screenshot()).toMatchSnapshot(screenshot(`select-inset-list-no-fill`));
|
||||
await expect(list).toHaveScreenshot(screenshot(`select-inset-list-no-fill`));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 1.7 KiB |
@ -22,7 +22,7 @@ configs().forEach(({ title, screenshot, config }) => {
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-label-start-justify-start`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-label-start-justify-start`));
|
||||
});
|
||||
test('should render an end justification with label in the start position', async ({ page }) => {
|
||||
await page.setContent(
|
||||
@ -34,7 +34,7 @@ configs().forEach(({ title, screenshot, config }) => {
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-label-start-justify-end`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-label-start-justify-end`));
|
||||
});
|
||||
test('should render a space between justification with label in the start position', async ({ page }) => {
|
||||
await page.setContent(
|
||||
@ -46,7 +46,7 @@ configs().forEach(({ title, screenshot, config }) => {
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-label-start-justify-space-between`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-label-start-justify-space-between`));
|
||||
});
|
||||
});
|
||||
|
||||
@ -61,7 +61,7 @@ configs().forEach(({ title, screenshot, config }) => {
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-label-end-justify-start`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-label-end-justify-start`));
|
||||
});
|
||||
test('should render an end justification with label in the end position', async ({ page }) => {
|
||||
await page.setContent(
|
||||
@ -73,7 +73,7 @@ configs().forEach(({ title, screenshot, config }) => {
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-label-end-justify-end`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-label-end-justify-end`));
|
||||
});
|
||||
test('should render a space between justification with label in the end position', async ({ page }) => {
|
||||
await page.setContent(
|
||||
@ -85,7 +85,7 @@ configs().forEach(({ title, screenshot, config }) => {
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-label-end-justify-space-between`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-label-end-justify-space-between`));
|
||||
});
|
||||
});
|
||||
|
||||
@ -100,7 +100,7 @@ configs().forEach(({ title, screenshot, config }) => {
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-label-fixed-justify-start`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-label-fixed-justify-start`));
|
||||
});
|
||||
test('should render an end justification with label in the fixed position', async ({ page }) => {
|
||||
await page.setContent(
|
||||
@ -112,7 +112,7 @@ configs().forEach(({ title, screenshot, config }) => {
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-label-fixed-justify-end`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-label-fixed-justify-end`));
|
||||
});
|
||||
test('should render a space between justification with label in the fixed position', async ({ page }) => {
|
||||
await page.setContent(
|
||||
@ -124,7 +124,7 @@ configs().forEach(({ title, screenshot, config }) => {
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-label-fixed-justify-space-between`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-label-fixed-justify-space-between`));
|
||||
});
|
||||
});
|
||||
|
||||
@ -140,7 +140,7 @@ configs().forEach(({ title, screenshot, config }) => {
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-label-floating-value`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-label-floating-value`));
|
||||
});
|
||||
test('label should appear on top of the select when there is no value', async ({ page }) => {
|
||||
await page.setContent(
|
||||
@ -153,7 +153,7 @@ configs().forEach(({ title, screenshot, config }) => {
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-label-floating-no-value`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-label-floating-no-value`));
|
||||
});
|
||||
test('label should appear on top of the select when there is a placeholder and no value', async ({ page }) => {
|
||||
await page.setContent(
|
||||
@ -166,7 +166,7 @@ configs().forEach(({ title, screenshot, config }) => {
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-label-floating-no-value-placeholder`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-label-floating-no-value-placeholder`));
|
||||
});
|
||||
test('label should appear on top of the select when the select is expanded', async ({ page }) => {
|
||||
await page.setContent(
|
||||
@ -180,9 +180,7 @@ configs().forEach(({ title, screenshot, config }) => {
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
|
||||
expect(await select.screenshot({ animations: 'disabled' })).toMatchSnapshot(
|
||||
screenshot(`select-label-floating-expanded`)
|
||||
);
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-label-floating-expanded`));
|
||||
});
|
||||
test('long text should truncate', async ({ page }) => {
|
||||
await page.setContent(
|
||||
@ -196,9 +194,7 @@ configs().forEach(({ title, screenshot, config }) => {
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
|
||||
expect(await select.screenshot({ animations: 'disabled' })).toMatchSnapshot(
|
||||
screenshot(`select-label-floating-long-text`)
|
||||
);
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-label-floating-long-text`));
|
||||
});
|
||||
});
|
||||
|
||||
@ -214,7 +210,7 @@ configs().forEach(({ title, screenshot, config }) => {
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-label-stacked-value`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-label-stacked-value`));
|
||||
});
|
||||
test('label should appear above the select when there is no value', async ({ page }) => {
|
||||
await page.setContent(
|
||||
@ -227,7 +223,7 @@ configs().forEach(({ title, screenshot, config }) => {
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-label-stacked-no-value`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-label-stacked-no-value`));
|
||||
});
|
||||
test('label should appear on top of the select when the select is expanded', async ({ page }) => {
|
||||
await page.setContent(
|
||||
@ -241,9 +237,7 @@ configs().forEach(({ title, screenshot, config }) => {
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
|
||||
expect(await select.screenshot({ animations: 'disabled' })).toMatchSnapshot(
|
||||
screenshot(`select-label-stacked-expanded`)
|
||||
);
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-label-stacked-expanded`));
|
||||
});
|
||||
test('long text should truncate', async ({ page }) => {
|
||||
await page.setContent(
|
||||
@ -257,9 +251,7 @@ configs().forEach(({ title, screenshot, config }) => {
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
|
||||
expect(await select.screenshot({ animations: 'disabled' })).toMatchSnapshot(
|
||||
screenshot(`select-label-stacked-long-text`)
|
||||
);
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-label-stacked-long-text`));
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -276,7 +268,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-label-truncate`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-label-truncate`));
|
||||
});
|
||||
test('label slot should be truncated with ellipses', async ({ page }) => {
|
||||
await page.setContent(
|
||||
@ -289,7 +281,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
||||
);
|
||||
|
||||
const select = page.locator('ion-select');
|
||||
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-label-slot-truncate`));
|
||||
await expect(select).toHaveScreenshot(screenshot(`select-label-slot-truncate`));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 2.0 KiB |