From c7e2ec9990481554a8f643e3a9a05cc190882ccb Mon Sep 17 00:00:00 2001 From: Jack Westbrook Date: Thu, 1 Jul 2021 09:58:49 +0200 Subject: [PATCH] Profile: Fix failing FE reducer test (#36331) (cherry picked from commit 4434eeaf598e16e50466cffabe3f452f5c2cf1cc) --- public/app/features/profile/state/reducers.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/public/app/features/profile/state/reducers.test.ts b/public/app/features/profile/state/reducers.test.ts index 2bccd7434a6..dc050bfe509 100644 --- a/public/app/features/profile/state/reducers.test.ts +++ b/public/app/features/profile/state/reducers.test.ts @@ -14,6 +14,16 @@ import { } from './reducers'; describe('userReducer', () => { + let dateNow: any; + + beforeAll(() => { + dateNow = jest.spyOn(Date, 'now').mockImplementation(() => 1609470000000); // 2021-01-01 04:00:00 + }); + + afterAll(() => { + dateNow.mockRestore(); + }); + describe('when updateTimeZone is dispatched', () => { it('then state should be correct', () => { reducerTester()