@@ -38,7 +38,7 @@ import MaterialListWithDetailRenderer, {
38
38
import Enzyme , { mount , ReactWrapper } from 'enzyme' ;
39
39
import Adapter from '@wojtekmaj/enzyme-adapter-react-17' ;
40
40
import { JsonFormsStateProvider } from '@jsonforms/react' ;
41
- import { ListItem , Typography } from '@mui/material' ;
41
+ import { ListItemButton , Typography } from '@mui/material' ;
42
42
import { initCore , testTranslator } from './util' ;
43
43
import { checkTooltip , checkTooltipTranslation } from './tooltipChecker' ;
44
44
@@ -179,8 +179,8 @@ describe('Material list with detail renderer', () => {
179
179
</ JsonFormsStateProvider >
180
180
) ;
181
181
182
- const lis = wrapper . find ( 'li ' ) ;
183
- expect ( lis ) . toHaveLength ( 2 ) ;
182
+ const listItemButtons = wrapper . find ( 'div[role="button"] ' ) ;
183
+ expect ( listItemButtons ) . toHaveLength ( 2 ) ;
184
184
} ) ;
185
185
it ( 'should render empty entries' , ( ) => {
186
186
const core = initCore ( schema , uischema , [ ] ) ;
@@ -364,8 +364,8 @@ describe('Material list with detail renderer', () => {
364
364
365
365
wrapper . update ( ) ;
366
366
367
- const lis = wrapper . find ( 'li ' ) ;
368
- expect ( lis ) . toHaveLength ( 3 ) ;
367
+ const listItemButtons = wrapper . find ( 'div[role="button"] ' ) ;
368
+ expect ( listItemButtons ) . toHaveLength ( 3 ) ;
369
369
} ) ;
370
370
371
371
it ( 'remove data from the array' , ( ) => {
@@ -378,14 +378,14 @@ describe('Material list with detail renderer', () => {
378
378
</ JsonFormsStateProvider >
379
379
) ;
380
380
381
- expect ( wrapper . find ( ListItem ) ) . toHaveLength ( 2 ) ;
381
+ expect ( wrapper . find ( ListItemButton ) ) . toHaveLength ( 2 ) ;
382
382
383
383
const removeButton = wrapper . find ( 'button' ) . at ( 1 ) ;
384
384
removeButton . simulate ( 'click' ) ;
385
385
wrapper . update ( ) ;
386
386
387
- const lis = wrapper . find ( ListItem ) ;
388
- expect ( lis ) . toHaveLength ( 1 ) ;
387
+ const listItemButtons = wrapper . find ( ListItemButton ) ;
388
+ expect ( listItemButtons ) . toHaveLength ( 1 ) ;
389
389
} ) ;
390
390
391
391
it ( 'should render first simple property' , ( ) => {
@@ -398,12 +398,14 @@ describe('Material list with detail renderer', () => {
398
398
</ JsonFormsStateProvider >
399
399
) ;
400
400
401
- expect ( wrapper . find ( ListItem ) ) . toHaveLength ( 2 ) ;
401
+ expect ( wrapper . find ( ListItemButton ) ) . toHaveLength ( 2 ) ;
402
402
403
- expect ( wrapper . find ( ListItem ) . find ( Typography ) . at ( 0 ) . text ( ) ) . toBe (
403
+ expect ( wrapper . find ( ListItemButton ) . find ( Typography ) . at ( 0 ) . text ( ) ) . toBe (
404
404
'El Barto was here'
405
405
) ;
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
+ ) ;
407
409
} ) ;
408
410
409
411
it ( 'should render first simple enum property as translated child label' , ( ) => {
@@ -419,15 +421,15 @@ describe('Material list with detail renderer', () => {
419
421
</ JsonFormsStateProvider >
420
422
) ;
421
423
422
- expect ( wrapper . find ( ListItem ) ) . toHaveLength ( 3 ) ;
424
+ expect ( wrapper . find ( ListItemButton ) ) . toHaveLength ( 3 ) ;
423
425
424
- expect ( wrapper . find ( ListItem ) . find ( Typography ) . at ( 0 ) . text ( ) ) . toBe (
426
+ expect ( wrapper . find ( ListItemButton ) . find ( Typography ) . at ( 0 ) . text ( ) ) . toBe (
425
427
'MSG_TYPE_1'
426
428
) ;
427
- expect ( wrapper . find ( ListItem ) . find ( Typography ) . at ( 1 ) . text ( ) ) . toBe (
429
+ expect ( wrapper . find ( ListItemButton ) . find ( Typography ) . at ( 1 ) . text ( ) ) . toBe (
428
430
'MSG_TYPE_2'
429
431
) ;
430
- expect ( wrapper . find ( ListItem ) . find ( Typography ) . at ( 2 ) . text ( ) ) . toBe ( '' ) ;
432
+ expect ( wrapper . find ( ListItemButton ) . find ( Typography ) . at ( 2 ) . text ( ) ) . toBe ( '' ) ;
431
433
} ) ;
432
434
433
435
it ( 'should have no data message when no translator set' , ( ) => {
0 commit comments