Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amanmahajan7 committed Aug 1, 2023
1 parent 5865457 commit bbb0473
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions test/TreeDataGrid.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ const columns: readonly Column<Row>[] = [
value: {props.row.id}
</button>
);
},
renderGroupCell({ childRows }) {
return Math.min(...childRows.map((c) => c.id));
}
}
];
Expand Down Expand Up @@ -359,13 +356,13 @@ test('cell navigation in a treegrid', async () => {
expect(getRows()[1]).toHaveClass(rowSelectedClassname);

await userEvent.keyboard('{end}');
expect(getRows()[4]).toHaveClass(rowSelectedClassname);
expect(getRows()[5]).toHaveClass(rowSelectedClassname);

await userEvent.keyboard('{home}');
expect(getRows()[1]).toHaveClass(rowSelectedClassname);
expect(screen.getAllByRole('row')[0]).toHaveClass(rowSelectedClassname);

// collpase parent group
await userEvent.keyboard('{arrowleft}');
await userEvent.keyboard('{arrowdown}{arrowdown}{arrowleft}');
expect(screen.queryByRole('gridcell', { name: '2021' })).not.toBeInTheDocument();
expect(getRows()).toHaveLength(4);
});
Expand Down

0 comments on commit bbb0473

Please sign in to comment.