Skip to content

Commit 39e6d9f

Browse files
committed
test(checkbox): add e2e test and screenshots for end placement
1 parent e32256f commit 39e6d9f

7 files changed

+20
-3
lines changed

core/src/components/checkbox/test/item/checkbox.e2e.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
5353

5454
configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
5555
test.describe(title('checkbox: long label in item'), () => {
56-
test('should render margins correctly when using long label in item', async ({ page }) => {
56+
test('should not have visual regressions when using long label in item', async ({ page }) => {
5757
await page.setContent(
5858
`
5959
<ion-list>
@@ -69,7 +69,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
6969
const list = page.locator('ion-list');
7070
await expect(list).toHaveScreenshot(screenshot(`checkbox-long-label-in-item`));
7171
});
72-
test('should render margins correctly when using long label in item with start alignment', async ({
72+
test('should not have visual regressions when using long label in item with start alignment', async ({
7373
page,
7474
}, testInfo) => {
7575
testInfo.annotations.push({
@@ -93,8 +93,25 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
9393
});
9494
});
9595

96+
test.describe(title('checkbox: end label in item'), () => {
97+
test('should not have visual regressions when using end label in item', async ({ page }) => {
98+
await page.setContent(
99+
`
100+
<ion-list>
101+
<ion-item>
102+
<ion-checkbox label-placement="end">Enable Notifications</ion-checkbox>
103+
</ion-item>
104+
</ion-list>
105+
`,
106+
config
107+
);
108+
const list = page.locator('ion-list');
109+
await expect(list).toHaveScreenshot(screenshot(`checkbox-end-label-in-item`));
110+
});
111+
});
112+
96113
test.describe(title('checkbox: stacked label in item'), () => {
97-
test('should render margins correctly when using stacked label in item', async ({ page }) => {
114+
test('should not have visual regressions when using stacked label in item', async ({ page }) => {
98115
await page.setContent(
99116
`
100117
<ion-list>
2.82 KB
Loading
3.55 KB
Loading
2.88 KB
Loading
2.56 KB
Loading
3.23 KB
Loading
2.4 KB
Loading

0 commit comments

Comments
 (0)