From 4f7078206733c440f77fca97d4ff816ebc870a85 Mon Sep 17 00:00:00 2001 From: Yulong Ruan Date: Thu, 21 Mar 2024 15:10:16 +0800 Subject: [PATCH] fix tests Signed-off-by: Yulong Ruan --- src/core/public/chrome/chrome_service.mock.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/core/public/chrome/chrome_service.mock.ts b/src/core/public/chrome/chrome_service.mock.ts index 00d3e2b4480a..aaccf766f40f 100644 --- a/src/core/public/chrome/chrome_service.mock.ts +++ b/src/core/public/chrome/chrome_service.mock.ts @@ -30,7 +30,13 @@ import { BehaviorSubject } from 'rxjs'; import type { PublicMethodsOf } from '@osd/utility-types'; -import { ChromeBadge, ChromeBreadcrumb, ChromeService, InternalChromeStart } from './'; +import { + ChromeBadge, + ChromeBreadcrumb, + ChromeService, + InternalChromeStart, + LinksUpdater, +} from './'; import { getLogosMock } from '../../common/mocks'; const createSetupContractMock = () => { @@ -40,6 +46,7 @@ const createSetupContractMock = () => { }; const createStartContractMock = () => { + const linkUpdatersMock$ = new BehaviorSubject([]); const startContract: DeeplyMockedKeys = { getHeaderComponent: jest.fn(), navLinks: { @@ -51,7 +58,7 @@ const createStartContractMock = () => { update: jest.fn(), enableForcedAppSwitcherNavigation: jest.fn(), getForceAppSwitcherNavigation$: jest.fn(), - getLinkUpdaters$: jest.fn(), + getLinkUpdaters$: jest.fn().mockReturnValue(linkUpdatersMock$), }, recentlyAccessed: { add: jest.fn(),