From 5c69f2c0e9f9b804fdeaca7105f3008666e0d63d Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Fri, 5 Apr 2024 16:36:46 -0700 Subject: [PATCH] Cases-visualizations test fixes --- .../visualizations/actions/mocks.ts | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/x-pack/plugins/cases/public/components/visualizations/actions/mocks.ts b/x-pack/plugins/cases/public/components/visualizations/actions/mocks.ts index 7957b24b1ba48..aee3b128d554b 100644 --- a/x-pack/plugins/cases/public/components/visualizations/actions/mocks.ts +++ b/x-pack/plugins/cases/public/components/visualizations/actions/mocks.ts @@ -4,23 +4,16 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import type { CoreTheme, PublicAppInfo } from '@kbn/core/public'; -import { BehaviorSubject, of } from 'rxjs'; -import type { TypedLensByValueInput } from '@kbn/lens-plugin/public'; -import { createBrowserHistory } from 'history'; -import type { CasesUIActionProps } from './types'; -const mockTheme: CoreTheme = { - darkMode: false, -}; +import { createBrowserHistory } from 'history'; +import { BehaviorSubject } from 'rxjs'; -const createThemeMock = (): CoreTheme => { - return { ...mockTheme }; -}; +import type { PublicAppInfo } from '@kbn/core/public'; +import { coreMock } from '@kbn/core/public/mocks'; +import type { TypedLensByValueInput } from '@kbn/lens-plugin/public'; +import type { CasesUIActionProps } from './types'; -export const createTheme$Mock = () => { - return of(createThemeMock()); -}; +const coreStart = coreMock.createStart(); export class MockEmbeddable { public type; @@ -76,8 +69,8 @@ export const getMockApplications$ = () => export const getMockCaseUiActionProps = () => { const core = { + ...coreStart, application: { currentAppId$: getMockCurrentAppId$(), capabilities: {} }, - theme: { theme$: createTheme$Mock() }, uiSettings: { get: jest.fn().mockReturnValue(true), },