@@ -135,6 +135,48 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, screenshot, c
135135 } ) ;
136136
137137 test . describe ( title ( 'checkbox: ionFocus' ) , ( ) => {
138+ test ( 'should not have visual regressions' , async ( { page, pageUtils } ) => {
139+ await page . setContent (
140+ `
141+ <style>
142+ #container {
143+ display: inline-block;
144+ padding: 10px;
145+ }
146+ </style>
147+
148+ <div id="container">
149+ <ion-checkbox>Unchecked</ion-checkbox>
150+ </div>
151+ ` ,
152+ config
153+ ) ;
154+
155+ await pageUtils . pressKeys ( 'Tab' ) ;
156+
157+ const container = page . locator ( '#container' ) ;
158+
159+ await expect ( container ) . toHaveScreenshot ( screenshot ( `checkbox-focus` ) ) ;
160+ } ) ;
161+
162+ test ( 'should not have visual regressions when interacting with checkbox in item' , async ( { page, pageUtils } ) => {
163+ await page . setContent (
164+ `
165+ <ion-item class="ion-focused">
166+ <ion-checkbox>Unchecked</ion-checkbox>
167+ </ion-item>
168+ ` ,
169+ config
170+ ) ;
171+
172+ // Test focus with keyboard navigation.
173+ await pageUtils . pressKeys ( 'Tab' ) ;
174+
175+ const item = page . locator ( 'ion-item' ) ;
176+
177+ await expect ( item ) . toHaveScreenshot ( screenshot ( `checkbox-in-item-focus` ) ) ;
178+ } ) ;
179+
138180 test ( 'should fire ionFocus when checkbox is focused' , async ( { page, pageUtils } ) => {
139181 await page . setContent (
140182 `
@@ -212,30 +254,6 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, screenshot, c
212254 await checkbox . evaluate ( ( el : HTMLIonCheckboxElement ) => ( el . checked = true ) ) ;
213255 expect ( ionFocus ) . not . toHaveReceivedEvent ( ) ;
214256 } ) ;
215-
216- test ( 'should not have visual regressions' , async ( { page, pageUtils } ) => {
217- await page . setContent (
218- `
219- <style>
220- #container {
221- display: inline-block;
222- padding: 10px;
223- }
224- </style>
225-
226- <div id="container">
227- <ion-checkbox>Unchecked</ion-checkbox>
228- </div>
229- ` ,
230- config
231- ) ;
232-
233- await pageUtils . pressKeys ( 'Tab' ) ;
234-
235- const container = page . locator ( '#container' ) ;
236-
237- await expect ( container ) . toHaveScreenshot ( screenshot ( `checkbox-focus` ) ) ;
238- } ) ;
239257 } ) ;
240258
241259 test . describe ( title ( 'checkbox: ionBlur' ) , ( ) => {
0 commit comments