@@ -20,7 +20,7 @@ describe('WindowViewSettings', () => {
2020 it ( 'renders all elements correctly' , ( ) => {
2121 createWrapper ( ) ;
2222 expect ( screen . getByRole ( 'presentation' , { selector : 'li' } ) ) . toBeInTheDocument ( ) ;
23- const menuItems = screen . queryAllByRole ( 'menuitem ' ) ;
23+ const menuItems = screen . queryAllByRole ( 'menuitemradio ' ) ;
2424 expect ( menuItems . length ) . toBe ( 4 ) ;
2525 expect ( menuItems [ 0 ] ) . toHaveTextContent ( / S i n g l e / i) ;
2626 expect ( menuItems [ 1 ] ) . toHaveTextContent ( / B o o k / i) ;
@@ -29,29 +29,29 @@ describe('WindowViewSettings', () => {
2929 } ) ;
3030 it ( 'single should set the correct label active (by setting the secondary color)' , ( ) => {
3131 createWrapper ( { windowViewType : 'single' } ) ;
32- expect ( screen . getByRole ( 'menuitem ' , { name : / S i n g l e / } ) . querySelector ( 'svg' ) ) . toHaveClass ( 'MuiSvgIcon-colorSecondary' ) ; // eslint-disable-line testing-library/no-node-access
33- expect ( screen . getByRole ( 'menuitem ' , { name : / B o o k / } ) . querySelector ( 'svg' ) ) . not . toHaveClass ( 'MuiSvgIcon-colorSecondary' ) ; // eslint-disable-line testing-library/no-node-access
32+ expect ( screen . getByRole ( 'menuitemradio ' , { name : / S i n g l e / } ) . querySelector ( 'svg' ) ) . toHaveClass ( 'MuiSvgIcon-colorSecondary' ) ; // eslint-disable-line testing-library/no-node-access
33+ expect ( screen . getByRole ( 'menuitemradio ' , { name : / B o o k / } ) . querySelector ( 'svg' ) ) . not . toHaveClass ( 'MuiSvgIcon-colorSecondary' ) ; // eslint-disable-line testing-library/no-node-access
3434 } ) ;
3535 it ( 'book should set the correct label active (by setting the secondary color)' , ( ) => {
3636 createWrapper ( { windowViewType : 'book' } ) ;
37- expect ( screen . getByRole ( 'menuitem ' , { name : / B o o k / } ) . querySelector ( 'svg' ) ) . toHaveClass ( 'MuiSvgIcon-colorSecondary' ) ; // eslint-disable-line testing-library/no-node-access
38- expect ( screen . getByRole ( 'menuitem ' , { name : / S i n g l e / } ) . querySelector ( 'svg' ) ) . not . toHaveClass ( 'MuiSvgIcon-colorSecondary' ) ; // eslint-disable-line testing-library/no-node-access
37+ expect ( screen . getByRole ( 'menuitemradio ' , { name : / B o o k / } ) . querySelector ( 'svg' ) ) . toHaveClass ( 'MuiSvgIcon-colorSecondary' ) ; // eslint-disable-line testing-library/no-node-access
38+ expect ( screen . getByRole ( 'menuitemradio ' , { name : / S i n g l e / } ) . querySelector ( 'svg' ) ) . not . toHaveClass ( 'MuiSvgIcon-colorSecondary' ) ; // eslint-disable-line testing-library/no-node-access
3939 } ) ;
4040 it ( 'scroll should set the correct label active (by setting the secondary color)' , ( ) => {
4141 createWrapper ( { windowViewType : 'scroll' } ) ;
42- expect ( screen . getByRole ( 'menuitem ' , { name : / S c r o l l / } ) . querySelector ( 'svg' ) ) . toHaveClass ( 'MuiSvgIcon-colorSecondary' ) ; // eslint-disable-line testing-library/no-node-access
43- expect ( screen . getByRole ( 'menuitem ' , { name : / S i n g l e / } ) . querySelector ( 'svg' ) ) . not . toHaveClass ( 'MuiSvgIcon-colorSecondary' ) ; // eslint-disable-line testing-library/no-node-access
42+ expect ( screen . getByRole ( 'menuitemradio ' , { name : / S c r o l l / } ) . querySelector ( 'svg' ) ) . toHaveClass ( 'MuiSvgIcon-colorSecondary' ) ; // eslint-disable-line testing-library/no-node-access
43+ expect ( screen . getByRole ( 'menuitemradio ' , { name : / S i n g l e / } ) . querySelector ( 'svg' ) ) . not . toHaveClass ( 'MuiSvgIcon-colorSecondary' ) ; // eslint-disable-line testing-library/no-node-access
4444 } ) ;
4545 it ( 'gallery should set the correct label active (by setting the secondary color)' , ( ) => {
4646 createWrapper ( { windowViewType : 'gallery' } ) ;
47- expect ( screen . getByRole ( 'menuitem ' , { name : / G a l l e r y / } ) . querySelector ( 'svg' ) ) . toHaveClass ( 'MuiSvgIcon-colorSecondary' ) ; // eslint-disable-line testing-library/no-node-access
48- expect ( screen . getByRole ( 'menuitem ' , { name : / S i n g l e / } ) . querySelector ( 'svg' ) ) . not . toHaveClass ( 'MuiSvgIcon-colorSecondary' ) ; // eslint-disable-line testing-library/no-node-access
47+ expect ( screen . getByRole ( 'menuitemradio ' , { name : / G a l l e r y / } ) . querySelector ( 'svg' ) ) . toHaveClass ( 'MuiSvgIcon-colorSecondary' ) ; // eslint-disable-line testing-library/no-node-access
48+ expect ( screen . getByRole ( 'menuitemradio ' , { name : / S i n g l e / } ) . querySelector ( 'svg' ) ) . not . toHaveClass ( 'MuiSvgIcon-colorSecondary' ) ; // eslint-disable-line testing-library/no-node-access
4949 } ) ;
5050 it ( 'updates state when the view config selection changes' , async ( ) => {
5151 const setWindowViewType = vi . fn ( ) ;
5252 createWrapper ( { setWindowViewType } ) ;
5353 const user = userEvent . setup ( ) ;
54- const menuItems = screen . queryAllByRole ( 'menuitem ' ) ;
54+ const menuItems = screen . queryAllByRole ( 'menuitemradio ' ) ;
5555 expect ( menuItems . length ) . toBe ( 4 ) ;
5656 await user . click ( menuItems [ 0 ] ) ;
5757 expect ( setWindowViewType ) . toHaveBeenCalledWith ( 'xyz' , 'single' ) ;
0 commit comments