Skip to content

Commit

Permalink
FE: Add some frontend tests for previous button in topic messages page (
Browse files Browse the repository at this point in the history
  • Loading branch information
hadisfr committed Sep 21, 2024
1 parent bdb6670 commit d77352a
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,23 @@ describe('MessagesTable', () => {
expect(screen.queryByText(/next/i)).toBeDisabled();
});

it('should check if previous button is disabled isLive Param', () => {
renderComponent({ isFetching: true });
expect(screen.queryByText(/previous/i)).toBeDisabled();
});

it('should check if next button is disabled if there is no nextCursor', () => {
(useIsLiveMode as jest.Mock).mockImplementation(() => false);
renderComponent({ isFetching: false });
expect(screen.queryByText(/next/i)).toBeDisabled();
});

it('should check if previous button is disabled if there is no prevCursor', () => {
(useIsLiveMode as jest.Mock).mockImplementation(() => false);
renderComponent({ isFetching: false });
expect(screen.queryByText(/previous/i)).toBeDisabled();
});

it('should check the display of the loader element during loader', () => {
renderComponent({ isFetching: true });
expect(screen.getByRole('progressbar')).toBeInTheDocument();
Expand Down

0 comments on commit d77352a

Please sign in to comment.