test(textarea): migrate to toHaveScreenshot (#28087)
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>
@ -53,7 +53,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
);
|
);
|
||||||
|
|
||||||
const errorText = page.locator('ion-textarea .error-text');
|
const errorText = page.locator('ion-textarea .error-text');
|
||||||
expect(await errorText.screenshot()).toMatchSnapshot(screenshot(`textarea-error-custom-color`));
|
await expect(errorText).toHaveScreenshot(screenshot(`textarea-error-custom-color`));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
test.describe('textarea: hint text rendering', () => {
|
test.describe('textarea: hint text rendering', () => {
|
||||||
@ -62,7 +62,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
await page.setContent(`<ion-textarea helper-text="my helper" label="my textarea"></ion-textarea>`, config);
|
await page.setContent(`<ion-textarea helper-text="my helper" label="my textarea"></ion-textarea>`, config);
|
||||||
|
|
||||||
const bottomEl = page.locator('ion-textarea .textarea-bottom');
|
const bottomEl = page.locator('ion-textarea .textarea-bottom');
|
||||||
expect(await bottomEl.screenshot()).toMatchSnapshot(screenshot(`textarea-bottom-content-helper`));
|
await expect(bottomEl).toHaveScreenshot(screenshot(`textarea-bottom-content-helper`));
|
||||||
});
|
});
|
||||||
test('should not have visual regressions when rendering error text', async ({ page }) => {
|
test('should not have visual regressions when rendering error text', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -71,7 +71,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
);
|
);
|
||||||
|
|
||||||
const bottomEl = page.locator('ion-textarea .textarea-bottom');
|
const bottomEl = page.locator('ion-textarea .textarea-bottom');
|
||||||
expect(await bottomEl.screenshot()).toMatchSnapshot(screenshot(`textarea-bottom-content-error`));
|
await expect(bottomEl).toHaveScreenshot(screenshot(`textarea-bottom-content-error`));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -137,7 +137,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
);
|
);
|
||||||
|
|
||||||
const bottomEl = page.locator('ion-textarea .textarea-bottom');
|
const bottomEl = page.locator('ion-textarea .textarea-bottom');
|
||||||
expect(await bottomEl.screenshot()).toMatchSnapshot(screenshot(`textarea-bottom-content-counter`));
|
await expect(bottomEl).toHaveScreenshot(screenshot(`textarea-bottom-content-counter`));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should not have visual regressions when rendering counter with helper text', async ({ page }) => {
|
test('should not have visual regressions when rendering counter with helper text', async ({ page }) => {
|
||||||
@ -147,9 +147,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
);
|
);
|
||||||
|
|
||||||
const bottomEl = page.locator('ion-textarea .textarea-bottom');
|
const bottomEl = page.locator('ion-textarea .textarea-bottom');
|
||||||
expect(await bottomEl.screenshot()).toMatchSnapshot(
|
await expect(bottomEl).toHaveScreenshot(screenshot(`textarea-bottom-content-counter-helper-text`));
|
||||||
screenshot(`textarea-bottom-content-counter-helper-text`)
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should not have visual regressions when rendering counter with error text', async ({ page }) => {
|
test('should not have visual regressions when rendering counter with error text', async ({ page }) => {
|
||||||
@ -159,7 +157,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
);
|
);
|
||||||
|
|
||||||
const bottomEl = page.locator('ion-textarea .textarea-bottom');
|
const bottomEl = page.locator('ion-textarea .textarea-bottom');
|
||||||
expect(await bottomEl.screenshot()).toMatchSnapshot(screenshot(`textarea-bottom-content-counter-error-text`));
|
await expect(bottomEl).toHaveScreenshot(screenshot(`textarea-bottom-content-counter-error-text`));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 698 B |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 628 B |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 921 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 875 B |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 873 B |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 751 B |
@ -18,7 +18,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
);
|
);
|
||||||
|
|
||||||
const card = page.locator('ion-card');
|
const card = page.locator('ion-card');
|
||||||
expect(await card.screenshot()).toMatchSnapshot(screenshot(`textarea-card`));
|
await expect(card).toHaveScreenshot(screenshot(`textarea-card`));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 1.2 KiB |
@ -23,7 +23,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-no-fill-color-start`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-no-fill-color-start`));
|
||||||
});
|
});
|
||||||
test('should set label and highlight color on focus with end label placement', async ({ page }) => {
|
test('should set label and highlight color on focus with end label placement', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -34,7 +34,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-no-fill-color-end`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-no-fill-color-end`));
|
||||||
});
|
});
|
||||||
test('should set label and highlight color on focus with fixed label placement', async ({ page }) => {
|
test('should set label and highlight color on focus with fixed label placement', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -45,7 +45,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-no-fill-color-fixed`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-no-fill-color-fixed`));
|
||||||
});
|
});
|
||||||
test('should set label and highlight color on focus with floating label placement', async ({ page }) => {
|
test('should set label and highlight color on focus with floating label placement', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -56,7 +56,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-no-fill-color-floating`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-no-fill-color-floating`));
|
||||||
});
|
});
|
||||||
test('should set label and highlight color on focus with stacked label placement', async ({ page }) => {
|
test('should set label and highlight color on focus with stacked label placement', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -67,7 +67,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-no-fill-color-stacked`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-no-fill-color-stacked`));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
test.describe('textarea: fill solid', () => {
|
test.describe('textarea: fill solid', () => {
|
||||||
@ -80,7 +80,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-solid-color-start`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-solid-color-start`));
|
||||||
});
|
});
|
||||||
test('should set label and highlight color on focus with end label placement', async ({ page }) => {
|
test('should set label and highlight color on focus with end label placement', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -91,7 +91,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-solid-color-end`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-solid-color-end`));
|
||||||
});
|
});
|
||||||
test('should set label and highlight color on focus with fixed label placement', async ({ page }) => {
|
test('should set label and highlight color on focus with fixed label placement', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -102,7 +102,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-solid-color-fixed`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-solid-color-fixed`));
|
||||||
});
|
});
|
||||||
test('should set label and highlight color on focus with floating label placement', async ({ page }) => {
|
test('should set label and highlight color on focus with floating label placement', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -113,7 +113,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-solid-color-floating`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-solid-color-floating`));
|
||||||
});
|
});
|
||||||
test('should set label and highlight color on focus with stacked label placement', async ({ page }) => {
|
test('should set label and highlight color on focus with stacked label placement', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -124,7 +124,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-solid-color-stacked`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-solid-color-stacked`));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
test.describe('textarea: fill outline', () => {
|
test.describe('textarea: fill outline', () => {
|
||||||
@ -137,7 +137,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-outline-color-start`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-outline-color-start`));
|
||||||
});
|
});
|
||||||
test('should set label and highlight color on focus with end label placement', async ({ page }) => {
|
test('should set label and highlight color on focus with end label placement', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -148,7 +148,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-outline-color-end`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-outline-color-end`));
|
||||||
});
|
});
|
||||||
test('should set label and highlight color on focus with fixed label placement', async ({ page }) => {
|
test('should set label and highlight color on focus with fixed label placement', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -159,7 +159,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-outline-color-fixed`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-outline-color-fixed`));
|
||||||
});
|
});
|
||||||
test('should set label and highlight color on focus with floating label placement', async ({ page }) => {
|
test('should set label and highlight color on focus with floating label placement', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -170,7 +170,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-outline-color-floating`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-outline-color-floating`));
|
||||||
});
|
});
|
||||||
test('should set label and highlight color on focus with stacked label placement', async ({ page }) => {
|
test('should set label and highlight color on focus with stacked label placement', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -181,7 +181,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-outline-color-stacked`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-outline-color-stacked`));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 2.0 KiB |
@ -23,7 +23,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-fill-solid`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-solid`));
|
||||||
});
|
});
|
||||||
test('should render correctly with floating label', async ({ page }) => {
|
test('should render correctly with floating label', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -42,7 +42,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-fill-solid-label-floating`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-solid-label-floating`));
|
||||||
});
|
});
|
||||||
test('should not have visual regressions with shaped solid', async ({ page }) => {
|
test('should not have visual regressions with shaped solid', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -61,7 +61,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-fill-shaped-solid`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-shaped-solid`));
|
||||||
});
|
});
|
||||||
test('padding and border radius should be customizable', async ({ page }) => {
|
test('padding and border radius should be customizable', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -89,7 +89,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-fill-shaped-solid-custom`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-shaped-solid-custom`));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
test.describe('textarea: fill outline', () => {
|
test.describe('textarea: fill outline', () => {
|
||||||
@ -109,7 +109,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-fill-outline`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-outline`));
|
||||||
});
|
});
|
||||||
test('should render correctly with floating label', async ({ page }) => {
|
test('should render correctly with floating label', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -128,7 +128,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-fill-outline-label-floating`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-outline-label-floating`));
|
||||||
});
|
});
|
||||||
test('should not have visual regressions with shaped outline', async ({ page }) => {
|
test('should not have visual regressions with shaped outline', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -147,7 +147,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-fill-shaped-outline`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-shaped-outline`));
|
||||||
});
|
});
|
||||||
test('padding and border radius should be customizable', async ({ page }) => {
|
test('padding and border radius should be customizable', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -175,7 +175,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-fill-shaped-outline-custom`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-shaped-outline-custom`));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -219,7 +219,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-fill-outline-slotted-label`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-outline-slotted-label`));
|
||||||
});
|
});
|
||||||
test('should render the notch correctly with a slotted label after the textarea was originally hidden', async ({
|
test('should render the notch correctly with a slotted label after the textarea was originally hidden', async ({
|
||||||
page,
|
page,
|
||||||
@ -247,7 +247,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
|
|||||||
|
|
||||||
await textarea.evaluate((el: HTMLIonSelectElement) => el.style.removeProperty('display'));
|
await textarea.evaluate((el: HTMLIonSelectElement) => el.style.removeProperty('display'));
|
||||||
|
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-fill-outline-hidden-slotted-label`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-fill-outline-hidden-slotted-label`));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 3.7 KiB |
@ -24,7 +24,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-no-fill-valid`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-no-fill-valid`));
|
||||||
});
|
});
|
||||||
test('should render invalid state correctly', async ({ page }) => {
|
test('should render invalid state correctly', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -43,7 +43,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-no-fill-invalid`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-no-fill-invalid`));
|
||||||
});
|
});
|
||||||
test('should render focused state correctly', async ({ page }) => {
|
test('should render focused state correctly', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -62,7 +62,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-no-fill-focus`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-no-fill-focus`));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
test.describe('textarea: solid', () => {
|
test.describe('textarea: solid', () => {
|
||||||
@ -84,7 +84,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-solid-valid`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-solid-valid`));
|
||||||
});
|
});
|
||||||
test('should render invalid state correctly', async ({ page }) => {
|
test('should render invalid state correctly', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -104,7 +104,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-solid-invalid`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-solid-invalid`));
|
||||||
});
|
});
|
||||||
test('should render focused state correctly', async ({ page }) => {
|
test('should render focused state correctly', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -124,7 +124,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-solid-focus`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-solid-focus`));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
test.describe('textarea: outline', () => {
|
test.describe('textarea: outline', () => {
|
||||||
@ -146,7 +146,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-outline-valid`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-outline-valid`));
|
||||||
});
|
});
|
||||||
test('should render invalid state correctly', async ({ page }) => {
|
test('should render invalid state correctly', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -166,7 +166,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-outline-invalid`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-outline-invalid`));
|
||||||
});
|
});
|
||||||
test('should render focused state correctly', async ({ page }) => {
|
test('should render focused state correctly', async ({ page }) => {
|
||||||
await page.setContent(
|
await page.setContent(
|
||||||
@ -186,7 +186,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const textarea = page.locator('ion-textarea');
|
const textarea = page.locator('ion-textarea');
|
||||||
expect(await textarea.screenshot()).toMatchSnapshot(screenshot(`textarea-outline-focus`));
|
await expect(textarea).toHaveScreenshot(screenshot(`textarea-outline-focus`));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 4.0 KiB |