@@ -277,21 +277,28 @@ describe('<Menu /> integration', () => {
277
277
// no case for menu
278
278
// TODO: should this even change focus? I would guess that autoFocus={false}
279
279
// means "developer: I take care of focus don't steal it from me"
280
- specify ( '[variant=selectedMenu] focuses no part of the menu when `autoFocus={false}`' , async ( ) => {
281
- const { getAllByRole, getByTestId } = await render (
282
- < OpenMenu autoFocus = { false } variant = "selectedMenu" PaperProps = { { 'data-testid' : 'Paper' } } >
283
- < MenuItem />
284
- < MenuItem selected />
285
- < MenuItem />
286
- </ OpenMenu > ,
287
- ) ;
288
- const menuitems = getAllByRole ( 'menuitem' ) ;
280
+ specify (
281
+ '[variant=selectedMenu] focuses no part of the menu when `autoFocus={false}`' ,
282
+ async ( ) => {
283
+ const { getAllByRole, getByTestId } = await render (
284
+ < OpenMenu
285
+ autoFocus = { false }
286
+ variant = "selectedMenu"
287
+ PaperProps = { { 'data-testid' : 'Paper' } }
288
+ >
289
+ < MenuItem />
290
+ < MenuItem selected />
291
+ < MenuItem />
292
+ </ OpenMenu > ,
293
+ ) ;
294
+ const menuitems = getAllByRole ( 'menuitem' ) ;
289
295
290
- expect ( getByTestId ( 'Paper' ) ) . toHaveFocus ( ) ;
291
- expect ( menuitems [ 0 ] ) . to . have . property ( 'tabIndex' , - 1 ) ;
292
- expect ( menuitems [ 1 ] ) . to . have . property ( 'tabIndex' , 0 ) ;
293
- expect ( menuitems [ 2 ] ) . to . have . property ( 'tabIndex' , - 1 ) ;
294
- } ) ;
296
+ expect ( getByTestId ( 'Paper' ) ) . toHaveFocus ( ) ;
297
+ expect ( menuitems [ 0 ] ) . to . have . property ( 'tabIndex' , - 1 ) ;
298
+ expect ( menuitems [ 1 ] ) . to . have . property ( 'tabIndex' , 0 ) ;
299
+ expect ( menuitems [ 2 ] ) . to . have . property ( 'tabIndex' , - 1 ) ;
300
+ } ,
301
+ ) ;
295
302
296
303
specify ( '[variant=selectedMenu] focuses nothing when it is closed and mounted' , async ( ) => {
297
304
const { getByRole } = await render ( < ButtonMenu selectedIndex = { 1 } variant = "selectedMenu" /> ) ;
0 commit comments