Skip to content

Commit a1b6e8c

Browse files
committed
test(toggle): add e2e test and screenshots for end placement
1 parent 78c7e6c commit a1b6e8c

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

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

Lines changed: 21 additions & 2 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'], modes: ['md'] }).forEach(({ title, screenshot, config }) => {
5555
test.describe(title('toggle: 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>
@@ -71,8 +71,27 @@ configs({ directions: ['ltr'], modes: ['md'] }).forEach(({ title, screenshot, co
7171
});
7272
});
7373

74+
test.describe(title('toggle: end label in item'), () => {
75+
test('should not have visual regressions when using end label in item', async ({ page }) => {
76+
await page.setContent(
77+
`
78+
<ion-list>
79+
<ion-radio-group>
80+
<ion-item>
81+
<ion-toggle label-placement="end">Enable Notifications</ion-toggle>
82+
</ion-item>
83+
</ion-radio-group>
84+
</ion-list>
85+
`,
86+
config
87+
);
88+
const list = page.locator('ion-list');
89+
await expect(list).toHaveScreenshot(screenshot(`toggle-end-label-in-item`));
90+
});
91+
});
92+
7493
test.describe(title('toggle: stacked label in item'), () => {
75-
test('should render margins correctly when using stacked label in item', async ({ page }) => {
94+
test('should not have visual regressions when using stacked label in item', async ({ page }) => {
7695
await page.setContent(
7796
`
7897
<ion-list>
3.15 KB
Loading
3.83 KB
Loading
2.98 KB
Loading

0 commit comments

Comments
 (0)