Skip to content

Commit

Permalink
test(select): add shape snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
thetaPC committed Nov 13, 2024
1 parent f8a45bc commit 32a5fab
Show file tree
Hide file tree
Showing 35 changed files with 76 additions and 37 deletions.
37 changes: 0 additions & 37 deletions core/src/components/select/test/fill/select.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,24 +89,6 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
const select = page.locator('ion-select');
await expect(select).toHaveScreenshot(screenshot(`select-fill-solid-label-floating`));
});
test('should not have visual regressions with shaped solid', async ({ page }) => {
await page.setContent(
`
<ion-select
shape="round"
fill="solid"
label="Fruit"
value="apple"
>
<ion-select-option value="apple">Apple</ion-select-option>
</ion-select>
`,
config
);

const select = page.locator('ion-select');
await expect(select).toHaveScreenshot(screenshot(`select-fill-shaped-solid`));
});
test('padding and border radius should be customizable', async ({ page }) => {
await page.setContent(
`
Expand Down Expand Up @@ -153,25 +135,6 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
const select = page.locator('ion-select');
await expect(select).toHaveScreenshot(screenshot(`select-fill-outline-label-floating`));
});

test('should not have visual regressions with shaped outline', async ({ page }) => {
await page.setContent(
`
<ion-select
shape="round"
fill="outline"
label="Fruit"
value="apple"
>
<ion-select-option value="apple">Apple</ion-select-option>
</ion-select>
`,
config
);

const select = page.locator('ion-select');
await expect(select).toHaveScreenshot(screenshot(`select-fill-shaped-outline`));
});
});
});
});
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
76 changes: 76 additions & 0 deletions core/src/components/select/test/shape/select.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { expect } from '@playwright/test';
import { configs, test } from '@utils/test/playwright';

/**
* This behavior does not vary across directions.
*/
configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ config, screenshot, title }) => {
test.describe(title('select: shape'), () => {
['soft', 'round', 'rectangular'].forEach((shape) => {
test(`${shape} - should not have visual regressions with outline fill`, async ({ page }) => {
await page.setContent(
`
<ion-select
shape="${shape}"
fill="outline"
label="Label"
label-placement="stacked"
value="filledText"
>
<ion-select-option value="filledText">Filled text</ion-select-option>
</ion-select>
`,
config
);

const select = page.locator('ion-select');

await expect(select).toHaveScreenshot(screenshot(`select-shape-${shape}-fill-outline`));
});
});
});
});

configs({ modes: ['md'] }).forEach(({ config, screenshot, title }) => {
test.describe(title('select: shape'), () => {
test('round - should not have visual regressions with outline fill', async ({ page }) => {
await page.setContent(
`
<ion-select
shape="round"
fill="outline"
label="Label"
label-placement="stacked"
value="filledText"
>
<ion-select-option value="filledText">Filled text</ion-select-option>
</ion-select>
`,
config
);

const select = page.locator('ion-select');
await expect(select).toHaveScreenshot(screenshot(`select-shape-round-fill-outline`));
});

test('round - should not have visual regressions with solid fill', async ({ page }) => {
await page.setContent(
`
<ion-select
shape="round"
fill="solid"
label="Label"
label-placement="stacked"
value="filledText"
>
<ion-select-option value="filledText">Filled text</ion-select-option>
</ion-select>
`,
config
);

const select = page.locator('ion-select');
await expect(select).toHaveScreenshot(screenshot(`select-shape-round-fill-solid`));
});
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 32a5fab

Please sign in to comment.