Commit 03fe342 1 parent af40df6 commit 03fe342 Copy full SHA for 03fe342
File tree 1 file changed +6
-6
lines changed
packages/react-components/react-infobutton/src/components/InfoButton
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -4,20 +4,20 @@ import { infoButtonClassNames } from './useInfoButtonStyles';
4
4
import type { RenderResult } from '@testing-library/react' ;
5
5
6
6
// testing-library's queryByRole function doesn't look inside portals
7
- function queryByRoleDialog ( result : RenderResult ) {
8
- const dialogs = result . baseElement . querySelectorAll ( '[role="dialog "]' ) ;
9
- if ( ! dialogs ?. length ) {
7
+ function queryByRoleNote ( result : RenderResult ) {
8
+ const notes = result . baseElement . querySelectorAll ( '[role="note "]' ) ;
9
+ if ( ! notes ?. length ) {
10
10
return null ;
11
11
} else {
12
- expect ( dialogs . length ) . toBe ( 1 ) ;
13
- return dialogs . item ( 0 ) as HTMLElement ;
12
+ expect ( notes . length ) . toBe ( 1 ) ;
13
+ return notes . item ( 0 ) as HTMLElement ;
14
14
}
15
15
}
16
16
17
17
const getPopoverSurfaceElement = ( result : RenderResult ) => {
18
18
// button needs to be clicked otherwise content won't be rendered.
19
19
result . getByRole ( 'button' ) . click ( ) ;
20
- const dialog = queryByRoleDialog ( result ) ;
20
+ const dialog = queryByRoleNote ( result ) ;
21
21
expect ( dialog ) . not . toBeNull ( ) ;
22
22
return dialog ! ;
23
23
} ;
You can’t perform that action at this time.
0 commit comments