Skip to content

Commit d77352a

Browse files
committed
FE: Add some frontend tests for previous button in topic messages page (#550)
1 parent bdb6670 commit d77352a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

frontend/src/components/Topics/Topic/Messages/__test__/MessagesTable.spec.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,23 @@ describe('MessagesTable', () => {
7474
expect(screen.queryByText(/next/i)).toBeDisabled();
7575
});
7676

77+
it('should check if previous button is disabled isLive Param', () => {
78+
renderComponent({ isFetching: true });
79+
expect(screen.queryByText(/previous/i)).toBeDisabled();
80+
});
81+
7782
it('should check if next button is disabled if there is no nextCursor', () => {
7883
(useIsLiveMode as jest.Mock).mockImplementation(() => false);
7984
renderComponent({ isFetching: false });
8085
expect(screen.queryByText(/next/i)).toBeDisabled();
8186
});
8287

88+
it('should check if previous button is disabled if there is no prevCursor', () => {
89+
(useIsLiveMode as jest.Mock).mockImplementation(() => false);
90+
renderComponent({ isFetching: false });
91+
expect(screen.queryByText(/previous/i)).toBeDisabled();
92+
});
93+
8394
it('should check the display of the loader element during loader', () => {
8495
renderComponent({ isFetching: true });
8596
expect(screen.getByRole('progressbar')).toBeInTheDocument();

0 commit comments

Comments
 (0)