Skip to content

Commit 353070f

Browse files
test(input): add tests for double click
- add tests screenshots
1 parent 0a49a6b commit 353070f

23 files changed

+62
-1
lines changed

core/src/components/input/test/basic/input.e2e.ts

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ configs().forEach(({ title, screenshot, config }) => {
2929
await expect(input).toHaveScreenshot(screenshot(`input-with-placeholder`));
3030
});
3131
});
32-
3332
test.describe('input with clear button', () => {
3433
test('should not have visual regressions with default label', async ({ page }) => {
3534
await page.setContent(
@@ -62,6 +61,45 @@ configs().forEach(({ title, screenshot, config }) => {
6261
// Validates the display of an input with a clear button.
6362
await expect(input).toHaveScreenshot(screenshot(`input-with-clear-button-stacked`));
6463
});
64+
65+
});
66+
test.describe('input click behaviors', () => {
67+
test('should not have visual regressions', async ({ page }) => {
68+
await page.setContent(
69+
`
70+
<ion-input
71+
label="Label"
72+
clear-input="true"
73+
value="Text"
74+
></ion-input>
75+
`,
76+
config
77+
);
78+
const input = page.locator('ion-input');
79+
input.dblclick();
80+
// Validates the display of an input with a clear button.
81+
await expect(input).toHaveScreenshot(screenshot(`input-dbclick`));
82+
});
83+
test('should not have visual regressions with stacked label', async ({ page, browserName }) => {
84+
if (browserName === 'firefox') {
85+
test.skip();
86+
}
87+
await page.setContent(
88+
`
89+
<ion-input
90+
label="Label"
91+
label-placement="stacked"
92+
clear-input="true"
93+
value="Text"
94+
></ion-input>
95+
`,
96+
config
97+
);
98+
const input = page.locator('ion-input');
99+
input.dblclick();
100+
// Validates the display of an input with a clear button.
101+
await expect(input).toHaveScreenshot(screenshot(`input-dbclick-stacked`));
102+
});
65103
});
66104
});
67105
});
@@ -185,6 +223,29 @@ configs({ modes: ['ionic-md'] }).forEach(({ title, screenshot, config }) => {
185223
const container = page.locator('#container');
186224
await expect(container).toHaveScreenshot(screenshot(`input-clear-button-focused`));
187225
});
226+
227+
228+
test('should not have visual regressions when user dbclicks', async ({ page, browserName }) => {
229+
if (browserName === 'firefox' || browserName === 'webkit') {
230+
test.skip();
231+
}
232+
await page.setContent(
233+
`
234+
<ion-input
235+
label="Label"
236+
label-placement="stacked"
237+
clear-input="true"
238+
value="Text"
239+
></ion-input>
240+
`,
241+
config
242+
);
243+
const input = page.locator('ion-input');
244+
await input.dblclick();
245+
await page.waitForChanges();
246+
await expect(input).toHaveScreenshot(screenshot(`input-dbclick`));
247+
});
248+
188249
});
189250
});
190251

2.4 KB
Loading
2.39 KB
Loading
2.05 KB
Loading
2.51 KB
Loading
2.1 KB
Loading
2.04 KB
Loading
2.53 KB
Loading
2.08 KB
Loading
1.84 KB
Loading

0 commit comments

Comments
 (0)