Skip to content

Commit

Permalink
feat(table): update unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jialin-he committed Mar 12, 2024
1 parent 01f4343 commit 9bef87b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/pharos/src/components/table/pharos-table.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ describe('pharos-table', () => {
});

it('shows correct page start number according to page size', async () => {
let pageNumber = componentWithPagination.renderRoot.querySelector(`.page-number-display`);
expect(pageNumber?.innerHTML).contains('1-');
expect(pageNumber?.innerHTML).contains('1 of');
let pageNumber: HTMLElement | null =
componentWithPagination.renderRoot.querySelector(`.page-number-display`);
expect(pageNumber?.innerText).contains('Displaying 1-1 of 2');

const selectDropdown = componentWithPagination.renderRoot.querySelector(
`pharos-select`
Expand All @@ -91,8 +91,7 @@ describe('pharos-table', () => {
await componentWithPagination.updateComplete;

pageNumber = componentWithPagination.renderRoot.querySelector(`.page-number-display`);
expect(pageNumber?.innerHTML).contains('1-');
expect(pageNumber?.innerHTML).contains('2 of');
expect(pageNumber?.innerText).contains('Displaying 1-2 of 2');
});

it('updates correctly after page size selection', async () => {
Expand Down

0 comments on commit 9bef87b

Please sign in to comment.