diff --git a/plugins/home/src/homePageComponents/HeaderWorldClock/HeaderWorldClock.test.tsx b/plugins/home/src/homePageComponents/HeaderWorldClock/HeaderWorldClock.test.tsx index 3611f47787..db92fbb89f 100644 --- a/plugins/home/src/homePageComponents/HeaderWorldClock/HeaderWorldClock.test.tsx +++ b/plugins/home/src/homePageComponents/HeaderWorldClock/HeaderWorldClock.test.tsx @@ -89,6 +89,8 @@ describe('HeaderWorldClock with invalid Time Zone', () => { describe('HeaderWorldClock with custom Time Format', () => { it('uses 24hr clock from custom Time Format', async () => { + jest.useFakeTimers().setSystemTime(new Date('2022-06-28T09:10:13.502Z')); + const clockConfigs: ClockConfig[] = [ { label: 'UTC', @@ -111,7 +113,6 @@ describe('HeaderWorldClock with custom Time Format', () => { , ); - const currentTime = `${new Date().getHours()}:${new Date().getMinutes()}`; - expect(rendered.getByText(currentTime)).toBeInTheDocument(); + expect(rendered.getByText('09:10')).toBeInTheDocument(); }); });