@@ -227,7 +227,6 @@ describe('Tree', () => {
227
227
expect ( row ) . toHaveAttribute ( 'data-level' ) ;
228
228
expect ( row ) . toHaveAttribute ( 'aria-posinset' ) ;
229
229
expect ( row ) . toHaveAttribute ( 'aria-setsize' ) ;
230
- expect ( row ) . toHaveAttribute ( 'data-has-child-rows' ) ;
231
230
expect ( row ) . toHaveAttribute ( 'data-rac' ) ;
232
231
expect ( row ) . not . toHaveAttribute ( 'data-selected' ) ;
233
232
expect ( row ) . not . toHaveAttribute ( 'data-disabled' ) ;
@@ -251,7 +250,7 @@ describe('Tree', () => {
251
250
expect ( rowNoChild ) . toHaveAttribute ( 'data-level' , '1' ) ;
252
251
expect ( rowNoChild ) . toHaveAttribute ( 'aria-posinset' , '1' ) ;
253
252
expect ( rowNoChild ) . toHaveAttribute ( 'aria-setsize' , '2' ) ;
254
- expect ( rowNoChild ) . toHaveAttribute ( 'data-has-child-rows' , 'false ') ;
253
+ expect ( rowNoChild ) . not . toHaveAttribute ( 'data-has-child-rows' ) ;
255
254
expect ( rowNoChild ) . toHaveAttribute ( 'data-rac' ) ;
256
255
257
256
let rowWithChildren = rows [ 1 ] ;
@@ -285,7 +284,7 @@ describe('Tree', () => {
285
284
expect ( level3ChildRow ) . toHaveAttribute ( 'data-level' , '3' ) ;
286
285
expect ( level3ChildRow ) . toHaveAttribute ( 'aria-posinset' , '1' ) ;
287
286
expect ( level3ChildRow ) . toHaveAttribute ( 'aria-setsize' , '1' ) ;
288
- expect ( level3ChildRow ) . toHaveAttribute ( 'data-has-child-rows' , 'false ') ;
287
+ expect ( level3ChildRow ) . not . toHaveAttribute ( 'data-has-child-rows' ) ;
289
288
expect ( level3ChildRow ) . toHaveAttribute ( 'data-rac' ) ;
290
289
291
290
let level2ChildRow2 = rows [ 4 ] ;
@@ -296,7 +295,7 @@ describe('Tree', () => {
296
295
expect ( level2ChildRow2 ) . toHaveAttribute ( 'data-level' , '2' ) ;
297
296
expect ( level2ChildRow2 ) . toHaveAttribute ( 'aria-posinset' , '2' ) ;
298
297
expect ( level2ChildRow2 ) . toHaveAttribute ( 'aria-setsize' , '3' ) ;
299
- expect ( level2ChildRow2 ) . toHaveAttribute ( 'data-has-child-rows' , 'false ') ;
298
+ expect ( level2ChildRow2 ) . not . toHaveAttribute ( 'data-has-child-rows' ) ;
300
299
expect ( level2ChildRow2 ) . toHaveAttribute ( 'data-rac' ) ;
301
300
302
301
let level2ChildRow3 = rows [ 5 ] ;
@@ -307,7 +306,7 @@ describe('Tree', () => {
307
306
expect ( level2ChildRow3 ) . toHaveAttribute ( 'data-level' , '2' ) ;
308
307
expect ( level2ChildRow3 ) . toHaveAttribute ( 'aria-posinset' , '3' ) ;
309
308
expect ( level2ChildRow3 ) . toHaveAttribute ( 'aria-setsize' , '3' ) ;
310
- expect ( level2ChildRow3 ) . toHaveAttribute ( 'data-has-child-rows' , 'false ') ;
309
+ expect ( level2ChildRow3 ) . not . toHaveAttribute ( 'data-has-child-rows' ) ;
311
310
expect ( level2ChildRow3 ) . toHaveAttribute ( 'data-rac' ) ;
312
311
} ) ;
313
312
@@ -430,7 +429,7 @@ describe('Tree', () => {
430
429
expect ( rows [ 0 ] ) . toHaveAttribute ( 'aria-label' , 'Test' ) ;
431
430
// Until the row gets children, don't mark it with the aria/data attributes.
432
431
expect ( rows [ 0 ] ) . not . toHaveAttribute ( 'aria-expanded' ) ;
433
- expect ( rows [ 0 ] ) . toHaveAttribute ( 'data-has-child-rows' , 'false ') ;
432
+ expect ( rows [ 0 ] ) . not . toHaveAttribute ( 'data-has-child-rows' ) ;
434
433
expect ( chevron ) . toBeTruthy ( ) ;
435
434
} ) ;
436
435
@@ -846,7 +845,7 @@ describe('Tree', () => {
846
845
await trigger ( rows [ 0 ] , 'Enter' ) ;
847
846
expect ( document . activeElement ) . toBe ( rows [ 0 ] ) ;
848
847
expect ( rows [ 0 ] ) . toHaveAttribute ( 'aria-expanded' , 'false' ) ;
849
- expect ( rows [ 0 ] ) . toHaveAttribute ( 'data-expanded' , 'false ') ;
848
+ expect ( rows [ 0 ] ) . not . toHaveAttribute ( 'data-expanded' ) ;
850
849
expect ( rows [ 0 ] ) . toHaveAttribute ( 'aria-level' , '1' ) ;
851
850
expect ( rows [ 0 ] ) . toHaveAttribute ( 'aria-posinset' , '1' ) ;
852
851
expect ( rows [ 0 ] ) . toHaveAttribute ( 'aria-setsize' , '2' ) ;
@@ -884,7 +883,7 @@ describe('Tree', () => {
884
883
await trigger ( rows [ 2 ] , 'ArrowLeft' ) ;
885
884
expect ( document . activeElement ) . toBe ( rows [ 2 ] ) ;
886
885
expect ( rows [ 2 ] ) . toHaveAttribute ( 'aria-expanded' , 'false' ) ;
887
- expect ( rows [ 2 ] ) . toHaveAttribute ( 'data-expanded' , 'false ') ;
886
+ expect ( rows [ 2 ] ) . not . toHaveAttribute ( 'data-expanded' ) ;
888
887
expect ( rows [ 2 ] ) . toHaveAttribute ( 'aria-level' , '2' ) ;
889
888
expect ( rows [ 2 ] ) . toHaveAttribute ( 'aria-posinset' , '2' ) ;
890
889
expect ( rows [ 2 ] ) . toHaveAttribute ( 'aria-setsize' , '5' ) ;
@@ -944,14 +943,14 @@ describe('Tree', () => {
944
943
await user . tab ( ) ;
945
944
rows = tree . getAllByRole ( 'row' ) ;
946
945
expect ( rows [ 0 ] ) . toHaveAttribute ( 'aria-expanded' , 'false' ) ;
947
- expect ( rows [ 0 ] ) . toHaveAttribute ( 'data-expanded' , 'false ') ;
946
+ expect ( rows [ 0 ] ) . not . toHaveAttribute ( 'data-expanded' ) ;
948
947
expect ( rows [ 0 ] ) . toHaveAttribute ( 'aria-disabled' , 'true' ) ;
949
948
expect ( rows [ 0 ] ) . toHaveAttribute ( 'data-disabled' , 'true' ) ;
950
949
expect ( onExpandedChange ) . toHaveBeenCalledTimes ( 0 ) ;
951
950
952
951
await trigger ( rows [ 0 ] , 'Space' ) ;
953
952
expect ( rows [ 0 ] ) . toHaveAttribute ( 'aria-expanded' , 'false' ) ;
954
- expect ( rows [ 0 ] ) . toHaveAttribute ( 'data-expanded' , 'false ') ;
953
+ expect ( rows [ 0 ] ) . not . toHaveAttribute ( 'data-expanded' ) ;
955
954
expect ( onExpandedChange ) . toHaveBeenCalledTimes ( 0 ) ;
956
955
} ) ;
957
956
@@ -971,7 +970,7 @@ describe('Tree', () => {
971
970
await trigger ( chevron , 'ArrowLeft' ) ;
972
971
expect ( document . activeElement ) . toBe ( rows [ 0 ] ) ;
973
972
expect ( rows [ 0 ] ) . toHaveAttribute ( 'aria-expanded' , 'false' ) ;
974
- expect ( rows [ 0 ] ) . toHaveAttribute ( 'data-expanded' , 'false ') ;
973
+ expect ( rows [ 0 ] ) . not . toHaveAttribute ( 'data-expanded' ) ;
975
974
expect ( onExpandedChange ) . toHaveBeenCalledTimes ( 1 ) ;
976
975
expect ( new Set ( onExpandedChange . mock . calls [ 0 ] [ 0 ] ) ) . toEqual ( new Set ( [ 'Project-2' , 'Project-5' , 'Reports' , 'Reports-1' , 'Reports-1A' , 'Reports-1AB' ] ) ) ;
977
976
expect ( onSelectionChange ) . toHaveBeenCalledTimes ( 0 ) ;
@@ -1016,7 +1015,7 @@ describe('Tree', () => {
1016
1015
let chevron = within ( rows [ 0 ] ) . getAllByRole ( 'button' ) [ 0 ] ;
1017
1016
await trigger ( chevron , 'ArrowLeft' ) ;
1018
1017
expect ( rows [ 0 ] ) . toHaveAttribute ( 'aria-expanded' , 'false' ) ;
1019
- expect ( rows [ 0 ] ) . toHaveAttribute ( 'data-expanded' , 'false ') ;
1018
+ expect ( rows [ 0 ] ) . not . toHaveAttribute ( 'data-expanded' ) ;
1020
1019
expect ( onExpandedChange ) . toHaveBeenCalledTimes ( 1 ) ;
1021
1020
expect ( new Set ( onExpandedChange . mock . calls [ 0 ] [ 0 ] ) ) . toEqual ( new Set ( [ 'Project-2' , 'Project-5' , 'Reports' , 'Reports-1' , 'Reports-1A' , 'Reports-1AB' ] ) ) ;
1022
1021
expect ( onSelectionChange ) . toHaveBeenCalledTimes ( 2 ) ;
@@ -1044,7 +1043,7 @@ describe('Tree', () => {
1044
1043
let chevron = within ( rows [ 0 ] ) . getAllByRole ( 'button' ) [ 0 ] ;
1045
1044
await trigger ( chevron , 'ArrowLeft' ) ;
1046
1045
expect ( rows [ 0 ] ) . toHaveAttribute ( 'aria-expanded' , 'false' ) ;
1047
- expect ( rows [ 0 ] ) . toHaveAttribute ( 'data-expanded' , 'false ') ;
1046
+ expect ( rows [ 0 ] ) . not . toHaveAttribute ( 'data-expanded' ) ;
1048
1047
expect ( onExpandedChange ) . toHaveBeenCalledTimes ( 1 ) ;
1049
1048
expect ( new Set ( onExpandedChange . mock . calls [ 0 ] [ 0 ] ) ) . toEqual ( new Set ( [ 'Project-2' , 'Project-5' , 'Reports' , 'Reports-1' , 'Reports-1A' , 'Reports-1AB' ] ) ) ;
1050
1049
expect ( onAction ) . toHaveBeenCalledTimes ( 1 ) ;
@@ -1075,7 +1074,7 @@ describe('Tree', () => {
1075
1074
let chevron = within ( rows [ 0 ] ) . getAllByRole ( 'button' ) [ 0 ] ;
1076
1075
await trigger ( chevron , 'ArrowLeft' ) ;
1077
1076
expect ( rows [ 0 ] ) . toHaveAttribute ( 'aria-expanded' , 'false' ) ;
1078
- expect ( rows [ 0 ] ) . toHaveAttribute ( 'data-expanded' , 'false ') ;
1077
+ expect ( rows [ 0 ] ) . not . toHaveAttribute ( 'data-expanded' ) ;
1079
1078
expect ( onExpandedChange ) . toHaveBeenCalledTimes ( 1 ) ;
1080
1079
expect ( new Set ( onExpandedChange . mock . calls [ 0 ] [ 0 ] ) ) . toEqual ( new Set ( [ 'Project-2' , 'Project-5' , 'Reports' , 'Reports-1' , 'Reports-1A' , 'Reports-1AB' ] ) ) ;
1081
1080
} ) ;
@@ -1097,15 +1096,15 @@ describe('Tree', () => {
1097
1096
await user . tab ( ) ;
1098
1097
expect ( document . activeElement ) . toBe ( rows [ 0 ] ) ;
1099
1098
expect ( rows [ 0 ] ) . toHaveAttribute ( 'aria-expanded' , 'false' ) ;
1100
- expect ( rows [ 0 ] ) . toHaveAttribute ( 'data-expanded' , 'false ') ;
1099
+ expect ( rows [ 0 ] ) . not . toHaveAttribute ( 'data-expanded' ) ;
1101
1100
1102
1101
await user . click ( rows [ 0 ] ) ;
1103
1102
rows = getAllByRole ( 'row' ) ;
1104
1103
expect ( rows ) . toHaveLength ( 7 ) ;
1105
1104
1106
1105
await user . click ( rows [ 0 ] ) ;
1107
1106
expect ( rows [ 0 ] ) . toHaveAttribute ( 'aria-expanded' , 'false' ) ;
1108
- expect ( rows [ 0 ] ) . toHaveAttribute ( 'data-expanded' , 'false ') ;
1107
+ expect ( rows [ 0 ] ) . not . toHaveAttribute ( 'data-expanded' ) ;
1109
1108
rows = getAllByRole ( 'row' ) ;
1110
1109
expect ( rows ) . toHaveLength ( 2 ) ;
1111
1110
} ) ;
0 commit comments