Skip to content

Commit

Permalink
chore: add test
Browse files Browse the repository at this point in the history
Signed-off-by: Tim deBoer <git@tdeboer.ca>
  • Loading branch information
deboer-tim committed Nov 28, 2023
1 parent 1748e35 commit 3d1ba1d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/renderer/src/lib/table/Table.spec.ts
Expand Up @@ -175,3 +175,22 @@ test('Expect correct aria roles', async () => {
expect(cells.length).toBe(5);
}
});

test('Expect rowgroups', async () => {
render(TestTable, {});

// there should be two role groups
const rowgroups = await screen.findAllByRole('rowgroup');
expect(rowgroups).toBeDefined();
expect(rowgroups.length).toBe(2);

// one for the header row
const headers = await within(rowgroups[0]).findAllByRole('columnheader');
expect(headers).toBeDefined();
expect(headers.length).toBe(5);

// and one for the data rows
const dataRows = await within(rowgroups[1]).findAllByRole('row');
expect(dataRows).toBeDefined();
expect(dataRows.length).toBe(3);
});

0 comments on commit 3d1ba1d

Please sign in to comment.