quick fix on failing unit test with custom expiry status (#5566)

This commit is contained in:
Saturnino Abril 2021-07-23 05:40:23 +08:00 committed by GitHub
parent 14d377e713
commit 7d6a48d8cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(
<CustomStatusExpiry