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

Commit

Permalink
Change the test conditions according to new condition to show the toa…
Browse files Browse the repository at this point in the history
…st message
  • Loading branch information
sridhar02 committed Jul 8, 2020
1 parent d32d9cc commit 156afa6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion components/toast_wrapper/toast_wrapper.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,12 @@ describe('components/ToastWrapper', () => {
});

describe('toasts state', () => {
test('Should have unread toast if unreadCount > 0', () => {
test('Should have unread toast if unreadCount > 0 and initScrollOffsetFromBottom is greater than 1000', () => {
const props = {
...baseProps,
unreadCountInChannel: 10,
newRecentMessagesCount: 5,
initScrollOffsetFromBottom: 1100,
};

const wrapper = shallowWithIntl(<ToastWrapper {...props}/>);
Expand All @@ -105,6 +106,7 @@ describe('components/ToastWrapper', () => {
unreadCountInChannel: 10,
newRecentMessagesCount: 5,
atBottom: null,
initScrollOffsetFromBottom: 1100,
};

const wrapper = shallowWithIntl(<ToastWrapper {...props}/>);
Expand All @@ -128,6 +130,7 @@ describe('components/ToastWrapper', () => {
],
channelMarkedAsUnread: false,
atBottom: true,
initScrollOffsetFromBottom: 1220,
};
const wrapper = shallowWithIntl(<ToastWrapper {...props}/>);
expect(wrapper.state('showUnreadToast')).toBe(false);
Expand Down Expand Up @@ -241,6 +244,7 @@ describe('components/ToastWrapper', () => {
'post4',
'post5',
],
initScrollOffsetFromBottom: 1220,
};

const wrapper = shallowWithIntl(<ToastWrapper {...props}/>);
Expand Down Expand Up @@ -298,6 +302,7 @@ describe('components/ToastWrapper', () => {
'post4',
'post5',
],
initScrollOffsetFromBottom: 1005,
};

const wrapper = shallowWithIntl(<ToastWrapper {...props}/>);
Expand Down Expand Up @@ -345,6 +350,7 @@ describe('components/ToastWrapper', () => {
'post4',
'post5',
],
initScrollOffsetFromBottom: 1500,
};

const wrapper = shallowWithIntl(<ToastWrapper {...props}/>);
Expand Down Expand Up @@ -405,6 +411,7 @@ describe('components/ToastWrapper', () => {
...baseProps,
unreadCountInChannel: 10,
newRecentMessagesCount: 5,
initScrollOffsetFromBottom: 1008,
};
const updateToastStatus = baseProps.actions.updateToastStatus;

Expand Down

0 comments on commit 156afa6

Please sign in to comment.