@@ -84,13 +84,15 @@ test.describe('SelectPanel', () => {
8484
8585 // windows high contrast mode: light
8686 await page . emulateMedia ( { forcedColors : 'active' , colorScheme : 'light' } )
87+ await page . evaluate ( ( ) => matchMedia ( '(prefers-color-scheme: light)' ) . matches )
8788
8889 // Open select panel
89- const isPanelOpen = await page . isVisible ( '[role=" listbox"]' )
90+ const isPanelOpen = await page . getByRole ( ' listbox' ) . isVisible ( )
9091 if ( ! isPanelOpen ) {
9192 await page . keyboard . press ( 'Tab' )
9293 await page . keyboard . press ( 'Enter' )
9394 }
95+ await expect ( page . getByRole ( 'listbox' ) ) . toBeVisible ( )
9496
9597 expect ( await page . screenshot ( { animations : 'disabled' } ) ) . toMatchSnapshot (
9698 `SelectPanel-Default-forced-colors-light-modern-action-list--true.png` ,
@@ -105,13 +107,15 @@ test.describe('SelectPanel', () => {
105107
106108 // windows high contrast mode: dark
107109 await page . emulateMedia ( { forcedColors : 'active' , colorScheme : 'dark' } )
110+ await page . evaluate ( ( ) => matchMedia ( '(prefers-color-scheme: dark)' ) . matches )
108111
109112 // Open select panel
110- const isPanelOpen = await page . isVisible ( '[role=" listbox"]' )
113+ const isPanelOpen = await page . getByRole ( ' listbox' ) . isVisible ( )
111114 if ( ! isPanelOpen ) {
112115 await page . keyboard . press ( 'Tab' )
113116 await page . keyboard . press ( 'Enter' )
114117 }
118+ await expect ( page . getByRole ( 'listbox' ) ) . toBeVisible ( )
115119
116120 expect ( await page . screenshot ( { animations : 'disabled' } ) ) . toMatchSnapshot (
117121 `SelectPanel-Default-forced-colors-dark-modern-action-list--true.png` ,
0 commit comments