@@ -38,7 +38,7 @@ import MaterialListWithDetailRenderer, {
3838import Enzyme , { mount , ReactWrapper } from 'enzyme' ;
3939import Adapter from '@wojtekmaj/enzyme-adapter-react-17' ;
4040import { JsonFormsStateProvider } from '@jsonforms/react' ;
41- import { ListItem , Typography } from '@mui/material' ;
41+ import { ListItemButton , Typography } from '@mui/material' ;
4242import { initCore , testTranslator } from './util' ;
4343import { checkTooltip , checkTooltipTranslation } from './tooltipChecker' ;
4444
@@ -179,8 +179,8 @@ describe('Material list with detail renderer', () => {
179179 </ JsonFormsStateProvider >
180180 ) ;
181181
182- const lis = wrapper . find ( 'li ' ) ;
183- expect ( lis ) . toHaveLength ( 2 ) ;
182+ const listItemButtons = wrapper . find ( 'div[role="button"] ' ) ;
183+ expect ( listItemButtons ) . toHaveLength ( 2 ) ;
184184 } ) ;
185185 it ( 'should render empty entries' , ( ) => {
186186 const core = initCore ( schema , uischema , [ ] ) ;
@@ -364,8 +364,8 @@ describe('Material list with detail renderer', () => {
364364
365365 wrapper . update ( ) ;
366366
367- const lis = wrapper . find ( 'li ' ) ;
368- expect ( lis ) . toHaveLength ( 3 ) ;
367+ const listItemButtons = wrapper . find ( 'div[role="button"] ' ) ;
368+ expect ( listItemButtons ) . toHaveLength ( 3 ) ;
369369 } ) ;
370370
371371 it ( 'remove data from the array' , ( ) => {
@@ -378,14 +378,14 @@ describe('Material list with detail renderer', () => {
378378 </ JsonFormsStateProvider >
379379 ) ;
380380
381- expect ( wrapper . find ( ListItem ) ) . toHaveLength ( 2 ) ;
381+ expect ( wrapper . find ( ListItemButton ) ) . toHaveLength ( 2 ) ;
382382
383383 const removeButton = wrapper . find ( 'button' ) . at ( 1 ) ;
384384 removeButton . simulate ( 'click' ) ;
385385 wrapper . update ( ) ;
386386
387- const lis = wrapper . find ( ListItem ) ;
388- expect ( lis ) . toHaveLength ( 1 ) ;
387+ const listItemButtons = wrapper . find ( ListItemButton ) ;
388+ expect ( listItemButtons ) . toHaveLength ( 1 ) ;
389389 } ) ;
390390
391391 it ( 'should render first simple property' , ( ) => {
@@ -398,12 +398,14 @@ describe('Material list with detail renderer', () => {
398398 </ JsonFormsStateProvider >
399399 ) ;
400400
401- expect ( wrapper . find ( ListItem ) ) . toHaveLength ( 2 ) ;
401+ expect ( wrapper . find ( ListItemButton ) ) . toHaveLength ( 2 ) ;
402402
403- expect ( wrapper . find ( ListItem ) . find ( Typography ) . at ( 0 ) . text ( ) ) . toBe (
403+ expect ( wrapper . find ( ListItemButton ) . find ( Typography ) . at ( 0 ) . text ( ) ) . toBe (
404404 'El Barto was here'
405405 ) ;
406- expect ( wrapper . find ( ListItem ) . find ( Typography ) . at ( 1 ) . text ( ) ) . toBe ( 'Yolo' ) ;
406+ expect ( wrapper . find ( ListItemButton ) . find ( Typography ) . at ( 1 ) . text ( ) ) . toBe (
407+ 'Yolo'
408+ ) ;
407409 } ) ;
408410
409411 it ( 'should render first simple enum property as translated child label' , ( ) => {
@@ -419,15 +421,15 @@ describe('Material list with detail renderer', () => {
419421 </ JsonFormsStateProvider >
420422 ) ;
421423
422- expect ( wrapper . find ( ListItem ) ) . toHaveLength ( 3 ) ;
424+ expect ( wrapper . find ( ListItemButton ) ) . toHaveLength ( 3 ) ;
423425
424- expect ( wrapper . find ( ListItem ) . find ( Typography ) . at ( 0 ) . text ( ) ) . toBe (
426+ expect ( wrapper . find ( ListItemButton ) . find ( Typography ) . at ( 0 ) . text ( ) ) . toBe (
425427 'MSG_TYPE_1'
426428 ) ;
427- expect ( wrapper . find ( ListItem ) . find ( Typography ) . at ( 1 ) . text ( ) ) . toBe (
429+ expect ( wrapper . find ( ListItemButton ) . find ( Typography ) . at ( 1 ) . text ( ) ) . toBe (
428430 'MSG_TYPE_2'
429431 ) ;
430- expect ( wrapper . find ( ListItem ) . find ( Typography ) . at ( 2 ) . text ( ) ) . toBe ( '' ) ;
432+ expect ( wrapper . find ( ListItemButton ) . find ( Typography ) . at ( 2 ) . text ( ) ) . toBe ( '' ) ;
431433 } ) ;
432434
433435 it ( 'should have no data message when no translator set' , ( ) => {
0 commit comments