From 4bbd5e1bf57570f5d88f1d1fd4583fef15d5be2a Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Mon, 26 Jun 2023 12:25:17 -0700 Subject: [PATCH] update mock usage per feedback --- .../global_search_bar/public/telemetry/telmetry.test.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/global_search_bar/public/telemetry/telmetry.test.tsx b/x-pack/plugins/global_search_bar/public/telemetry/telmetry.test.tsx index 75f64591ca958..2a6edaaf3d5ba 100644 --- a/x-pack/plugins/global_search_bar/public/telemetry/telmetry.test.tsx +++ b/x-pack/plugins/global_search_bar/public/telemetry/telmetry.test.tsx @@ -45,7 +45,6 @@ const createResult = (result: Result): GlobalSearchResult => { const createBatch = (...results: Result[]): GlobalSearchBatchedResults => ({ results: results.map(createResult), }); -jest.useFakeTimers({ legacyFakeTimers: true }); describe('SearchBar', () => { const usageCollection = usageCollectionPluginMock.createSetupContract(); @@ -59,6 +58,14 @@ describe('SearchBar', () => { let eventReporter: EventReporter; let chromeStyle$ = of('classic'); + beforeAll(() => { + jest.useFakeTimers(); + }); + + afterAll(() => { + jest.useRealTimers(); + }); + beforeEach(() => { applications = applicationServiceMock.createStartContract(); searchService = globalSearchPluginMock.createStartContract();