From 7d6a48d8cbe357f68006428b4b890463c8b641ab Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Fri, 23 Jul 2021 05:40:23 +0800 Subject: [PATCH] quick fix on failing unit test with custom expiry status (#5566) --- app/components/custom_status/custom_status_expiry.test.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/components/custom_status/custom_status_expiry.test.tsx b/app/components/custom_status/custom_status_expiry.test.tsx index e1df7996b..830cb952c 100644 --- a/app/components/custom_status/custom_status_expiry.test.tsx +++ b/app/components/custom_status/custom_status_expiry.test.tsx @@ -5,12 +5,16 @@ import React from 'react'; import moment from 'moment-timezone'; import Preferences from '@mm-redux/constants/preferences'; -import * as PreferenceSelectors from '@mm-redux/selectors/entities/preferences'; import {renderWithReduxIntl} from 'test/testing_library'; import CustomStatusExpiry from './custom_status_expiry'; jest.mock('@mm-redux/selectors/entities/preferences'); +jest.mock('@mm-redux/selectors/entities/preferences', () => ({ + getBool: jest.fn().mockReturnValue(false), + isCollapsedThreadsEnabled: jest.fn(), +})); + describe('components/custom_status/custom_status_expiry', () => { const date = moment().endOf('day'); @@ -19,7 +23,6 @@ describe('components/custom_status/custom_status_expiry', () => { time: date.toDate(), }; - (PreferenceSelectors.getBool as jest.Mock).mockReturnValue(false); it('should match snapshot', () => { const wrapper = renderWithReduxIntl(