Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
added a test that fails if the scroll from bottom is less than 1000px
Browse files Browse the repository at this point in the history
  • Loading branch information
sridhar02 committed Jul 20, 2020
1 parent 5a9fa0c commit 8361745
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions components/toast_wrapper/toast_wrapper.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,17 @@ describe('components/ToastWrapper', () => {
const wrapper = shallowWithIntl(<ToastWrapper {...props}/>);
expect(wrapper.state('showUnreadToast')).toBe(true);
});
test('Should have not have unread toast if initScrollOffsetFromBottom is less than 1000', () => {
const props = {
...baseProps,
unreadCountInChannel: 10,
newRecentMessagesCount: 5,
initScrollOffsetFromBottom: 850,
};

const wrapper = shallowWithIntl(<ToastWrapper {...props}/>);
expect(wrapper.state('showUnreadToast')).toBe(false);
});

test('Should set state of have unread toast when atBottom changes from undefined', () => {
const props = {
Expand Down

0 comments on commit 8361745

Please sign in to comment.