Skip to content

Commit

Permalink
fix tests temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
LFDanLu committed Dec 13, 2024
1 parent 5eaad74 commit b9ac520
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/@react-aria/test-utils/src/gridlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class GridListTester {
let {
row,
needsLongPress,
checkboxSelection,
checkboxSelection = true,
interactionType = this._interactionType
} = opts;

Expand Down
5 changes: 5 additions & 0 deletions packages/@react-aria/test-utils/src/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ export class TreeTester {

let rowCheckbox = within(row).queryByRole('checkbox');

// TODO: investigagte why pressElement on a disabled checkbox is still toggling row selection in single selection
if (rowCheckbox?.getAttribute('disabled') === '') {
return;
}

// this would be better than the check to do nothing in events.ts
// also, it'd be good to be able to trigger selection on the row instead of having to go to the checkbox directly
if (interactionType === 'keyboard' && !checkboxSelection) {
Expand Down
1 change: 1 addition & 0 deletions packages/@react-aria/test-utils/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export interface ToggleGridRowOpts extends BaseGridRowInteractionOpts {
needsLongPress?: boolean,
/**
* Whether the checkbox should be used to select the row. If false, will attempt to select the row via press.
* @default 'true'
*/
checkboxSelection?: boolean
}
Expand Down

0 comments on commit b9ac520

Please sign in to comment.