@@ -1036,8 +1036,8 @@ describe('CardView', function () {
1036
1036
let cards = tree . getAllByRole ( 'gridcell' ) ;
1037
1037
expect ( cards [ 0 ] . parentNode ) . toHaveAttribute ( 'aria-selected' , 'true' ) ;
1038
1038
expect ( cards [ 1 ] . parentNode ) . toHaveAttribute ( 'aria-selected' , 'true' ) ;
1039
- expect ( within ( cards [ 0 ] ) . getByRole ( 'checkbox' ) ) . toHaveAttribute ( 'aria-checked' , 'true' ) ;
1040
- expect ( within ( cards [ 1 ] ) . getByRole ( 'checkbox' ) ) . toHaveAttribute ( 'aria-checked' , 'true' ) ;
1039
+ expect ( within ( cards [ 0 ] ) . getByRole ( 'checkbox' ) . checked ) . toBeTruthy ( ) ;
1040
+ expect ( within ( cards [ 1 ] ) . getByRole ( 'checkbox' ) . checked ) . toBeTruthy ( ) ;
1041
1041
} ) ;
1042
1042
1043
1043
it ( 'CardView should support disabledKeys' , function ( ) {
@@ -1051,7 +1051,7 @@ describe('CardView', function () {
1051
1051
expect ( document . activeElement ) . not . toBe ( cards [ 0 ] ) ;
1052
1052
expect ( cards [ 0 ] . parentNode ) . not . toHaveAttribute ( 'aria-selected' , 'true' ) ;
1053
1053
expect ( within ( cards [ 0 ] ) . getByRole ( 'checkbox' ) ) . toHaveAttribute ( 'disabled' ) ;
1054
- expect ( within ( cards [ 0 ] ) . getByRole ( 'checkbox' ) ) . not . toHaveAttribute ( 'aria-checked' , 'true' ) ;
1054
+ expect ( within ( cards [ 0 ] ) . getByRole ( 'checkbox' ) . checked ) . toBeFalsy ( ) ;
1055
1055
expect ( onSelectionChange ) . not . toHaveBeenCalled ( ) ;
1056
1056
} ) ;
1057
1057
@@ -1072,17 +1072,17 @@ describe('CardView', function () {
1072
1072
1073
1073
expect ( cards [ 0 ] . parentNode ) . toHaveAttribute ( 'aria-selected' , 'true' ) ;
1074
1074
expect ( cards [ 2 ] . parentNode ) . toHaveAttribute ( 'aria-selected' , 'true' ) ;
1075
- expect ( within ( cards [ 0 ] ) . getByRole ( 'checkbox' ) ) . toHaveAttribute ( 'aria-checked' , 'true' ) ;
1076
- expect ( within ( cards [ 2 ] ) . getByRole ( 'checkbox' ) ) . toHaveAttribute ( 'aria-checked' , 'true' ) ;
1075
+ expect ( within ( cards [ 0 ] ) . getByRole ( 'checkbox' ) . checked ) . toBeTruthy ( ) ;
1076
+ expect ( within ( cards [ 2 ] ) . getByRole ( 'checkbox' ) . checked ) . toBeTruthy ( ) ;
1077
1077
1078
1078
triggerPress ( cards [ 0 ] ) ;
1079
1079
expect ( new Set ( onSelectionChange . mock . calls [ 2 ] [ 0 ] ) ) . toEqual ( new Set ( [ 'Title 3' ] ) ) ;
1080
1080
expect ( onSelectionChange ) . toHaveBeenCalledTimes ( 3 ) ;
1081
1081
1082
1082
expect ( cards [ 0 ] . parentNode ) . toHaveAttribute ( 'aria-selected' , 'false' ) ;
1083
1083
expect ( cards [ 2 ] . parentNode ) . toHaveAttribute ( 'aria-selected' , 'true' ) ;
1084
- expect ( within ( cards [ 0 ] ) . getByRole ( 'checkbox' ) ) . toHaveAttribute ( 'aria-checked' , 'false' ) ;
1085
- expect ( within ( cards [ 2 ] ) . getByRole ( 'checkbox' ) ) . toHaveAttribute ( 'aria-checked' , 'true' ) ;
1084
+ expect ( within ( cards [ 0 ] ) . getByRole ( 'checkbox' ) . checked ) . toBeFalsy ( ) ;
1085
+ expect ( within ( cards [ 2 ] ) . getByRole ( 'checkbox' ) . checked ) . toBeTruthy ( ) ;
1086
1086
} ) ;
1087
1087
1088
1088
it ( 'CardView should support single selection' , function ( ) {
@@ -1096,23 +1096,23 @@ describe('CardView', function () {
1096
1096
expect ( new Set ( onSelectionChange . mock . calls [ 0 ] [ 0 ] ) ) . toEqual ( new Set ( [ 'Title 1' ] ) ) ;
1097
1097
expect ( onSelectionChange ) . toHaveBeenCalledTimes ( 1 ) ;
1098
1098
expect ( cards [ 0 ] . parentNode ) . toHaveAttribute ( 'aria-selected' , 'true' ) ;
1099
- expect ( within ( cards [ 0 ] ) . getByRole ( 'checkbox' ) ) . toHaveAttribute ( 'aria-checked' , 'true' ) ;
1099
+ expect ( within ( cards [ 0 ] ) . getByRole ( 'checkbox' ) . checked ) . toBeTruthy ( ) ;
1100
1100
1101
1101
triggerPress ( cards [ 2 ] ) ;
1102
1102
expect ( new Set ( onSelectionChange . mock . calls [ 1 ] [ 0 ] ) ) . toEqual ( new Set ( [ 'Title 3' ] ) ) ;
1103
1103
expect ( onSelectionChange ) . toHaveBeenCalledTimes ( 2 ) ;
1104
1104
expect ( cards [ 0 ] . parentNode ) . toHaveAttribute ( 'aria-selected' , 'false' ) ;
1105
1105
expect ( cards [ 2 ] . parentNode ) . toHaveAttribute ( 'aria-selected' , 'true' ) ;
1106
- expect ( within ( cards [ 0 ] ) . getByRole ( 'checkbox' ) ) . toHaveAttribute ( 'aria-checked' , 'false' ) ;
1107
- expect ( within ( cards [ 2 ] ) . getByRole ( 'checkbox' ) ) . toHaveAttribute ( 'aria-checked' , 'true' ) ;
1106
+ expect ( within ( cards [ 0 ] ) . getByRole ( 'checkbox' ) . checked ) . toBeFalsy ( ) ;
1107
+ expect ( within ( cards [ 2 ] ) . getByRole ( 'checkbox' ) . checked ) . toBeTruthy ( ) ;
1108
1108
1109
1109
triggerPress ( cards [ 2 ] ) ;
1110
1110
expect ( new Set ( onSelectionChange . mock . calls [ 2 ] [ 0 ] ) ) . toEqual ( new Set ( [ ] ) ) ;
1111
1111
expect ( onSelectionChange ) . toHaveBeenCalledTimes ( 3 ) ;
1112
1112
expect ( cards [ 0 ] . parentNode ) . toHaveAttribute ( 'aria-selected' , 'false' ) ;
1113
1113
expect ( cards [ 2 ] . parentNode ) . toHaveAttribute ( 'aria-selected' , 'false' ) ;
1114
- expect ( within ( cards [ 0 ] ) . getByRole ( 'checkbox' ) ) . toHaveAttribute ( 'aria-checked' , 'false' ) ;
1115
- expect ( within ( cards [ 2 ] ) . getByRole ( 'checkbox' ) ) . toHaveAttribute ( 'aria-checked' , 'false' ) ;
1114
+ expect ( within ( cards [ 0 ] ) . getByRole ( 'checkbox' ) . checked ) . toBeFalsy ( ) ;
1115
+ expect ( within ( cards [ 2 ] ) . getByRole ( 'checkbox' ) . checked ) . toBeFalsy ( ) ;
1116
1116
} ) ;
1117
1117
1118
1118
it ( 'CardView should support no selection' , function ( ) {
0 commit comments