From 4ef55e3375b5f4ccbf3e539e5bdf7e7f94c88360 Mon Sep 17 00:00:00 2001 From: sridhar02 Date: Sun, 12 Jul 2020 20:05:59 +0530 Subject: [PATCH] added a test that fails if the scroll from bottom is less than 1000px --- components/toast_wrapper/toast_wrapper.test.jsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/components/toast_wrapper/toast_wrapper.test.jsx b/components/toast_wrapper/toast_wrapper.test.jsx index 8a675de119e2..8ad6cc4f7ae4 100644 --- a/components/toast_wrapper/toast_wrapper.test.jsx +++ b/components/toast_wrapper/toast_wrapper.test.jsx @@ -99,6 +99,17 @@ describe('components/ToastWrapper', () => { const wrapper = shallowWithIntl(); 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(); + expect(wrapper.state('showUnreadToast')).toBe(false); + }); test('Should set state of have unread toast when atBottom changes from undefined', () => { const props = {