Skip to content

Commit

Permalink
chore: update ServicesTraces tests
Browse files Browse the repository at this point in the history
  • Loading branch information
srikanthccv committed Aug 4, 2024
1 parent 739d35c commit efcd1b8
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ describe('ServicesTraces', () => {
const secondServiceName = await screen.findByText(/TestCustomerService/i);
expect(secondServiceName).toBeInTheDocument();
const allRow = screen.getAllByRole('row');
expect(allRow).toHaveLength(3);
expect(allRow[1].innerHTML).toContain('TestService');
expect(allRow[2].innerHTML).toContain('TestCustomerService');
expect(allRow).toHaveLength(2);
expect(allRow[0].innerHTML).toContain('TestService');
expect(allRow[1].innerHTML).toContain('TestCustomerService');

const tableHeader = await screen.findAllByRole('columnheader');
expect(tableHeader).toHaveLength(4);

fireEvent.click(tableHeader[1]);

const allSortedRowAsc = screen.getAllByRole('row');
expect(allSortedRowAsc).toHaveLength(3);
expect(allSortedRowAsc[1].innerHTML).toContain('TestService');
expect(allSortedRowAsc).toHaveLength(2);
expect(allSortedRowAsc[0].innerHTML).toContain('TestService');

fireEvent.click(tableHeader[1]);
const allSortedRowDsc = screen.getAllByRole('row');
expect(allSortedRowDsc).toHaveLength(3);
expect(allSortedRowDsc[1].innerHTML).toContain('TestCustomerService');
expect(allSortedRowDsc).toHaveLength(2);
expect(allSortedRowDsc[0].innerHTML).toContain('TestCustomerService');
});
});

0 comments on commit efcd1b8

Please sign in to comment.