@@ -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 (
@@ -63,6 +62,43 @@ configs().forEach(({ title, screenshot, config }) => {
6362 await expect ( input ) . toHaveScreenshot ( screenshot ( `input-with-clear-button-stacked` ) ) ;
6463 } ) ;
6564 } ) ;
65+ test . describe ( 'input click behaviors' , ( ) => {
66+ test ( 'should not have visual regressions when user double clicks' , async ( { page } ) => {
67+ await page . setContent (
68+ `
69+ <ion-input
70+ label="Label"
71+ clear-input="true"
72+ value="Text"
73+ ></ion-input>
74+ ` ,
75+ config
76+ ) ;
77+ const input = page . locator ( 'ion-input' ) ;
78+ const nativeInput = input . locator ( 'input' ) ;
79+ await nativeInput . 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 when user double clicks' , async ( { page } ) => {
84+ await page . setContent (
85+ `
86+ <ion-input
87+ label="Label"
88+ label-placement="stacked"
89+ clear-input="true"
90+ value="Text"
91+ ></ion-input>
92+ ` ,
93+ config
94+ ) ;
95+ const input = page . locator ( 'ion-input' ) ;
96+ const nativeInput = input . locator ( 'input' ) ;
97+ await nativeInput . dblclick ( ) ;
98+ // Validates the display of an input with a clear button.
99+ await expect ( input ) . toHaveScreenshot ( screenshot ( `input-dbclick-stacked` ) ) ;
100+ } ) ;
101+ } ) ;
66102 } ) ;
67103} ) ;
68104
@@ -185,6 +221,24 @@ configs({ modes: ['ionic-md'] }).forEach(({ title, screenshot, config }) => {
185221 const container = page . locator ( '#container' ) ;
186222 await expect ( container ) . toHaveScreenshot ( screenshot ( `input-clear-button-focused` ) ) ;
187223 } ) ;
224+
225+ test ( 'should not have visual regressions when user double clicks' , async ( { page } ) => {
226+ await page . setContent (
227+ `
228+ <ion-input
229+ label="Label"
230+ label-placement="stacked"
231+ clear-input="true"
232+ value="Text"
233+ ></ion-input>
234+ ` ,
235+ config
236+ ) ;
237+ const input = page . locator ( 'ion-input' ) ;
238+ const nativeInput = input . locator ( 'input' ) ;
239+ await nativeInput . dblclick ( ) ;
240+ await expect ( input ) . toHaveScreenshot ( screenshot ( `input-dbclick` ) ) ;
241+ } ) ;
188242 } ) ;
189243} ) ;
190244
0 commit comments