From fd1d0a2a7cb9bcc5e745077653e5b34f25b8b930 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Thu, 1 Jul 2021 10:26:48 +0200 Subject: [PATCH] Profile: Fix failing FE reducer test (#36331) (#36333) (cherry picked from commit 4434eeaf598e16e50466cffabe3f452f5c2cf1cc) Co-authored-by: Jack Westbrook --- 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()