From 9046b00c360faa9c6856fef81bfdf5589ae970f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loix?= Date: Wed, 31 Jan 2024 20:24:45 +0000 Subject: [PATCH] Fix jest test & TS issues --- src/plugins/content_management/server/plugin.test.ts | 2 +- .../server/rpc/procedures/msearch.test.ts | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/plugins/content_management/server/plugin.test.ts b/src/plugins/content_management/server/plugin.test.ts index 2e4eaf8122b61..aef15dada6449 100644 --- a/src/plugins/content_management/server/plugin.test.ts +++ b/src/plugins/content_management/server/plugin.test.ts @@ -138,8 +138,8 @@ describe('ContentManagementPlugin', () => { // Each procedure has been called with the context and input const context = { requestHandlerContext: mockedRequestHandlerContext, + request: expect.any(Object), contentRegistry: 'mockedContentRegistry', - getTransformsFactory: expect.any(Function), mSearchService: expect.any(MSearchService), }; expect(mockGet).toHaveBeenCalledWith(context, input); diff --git a/src/plugins/content_management/server/rpc/procedures/msearch.test.ts b/src/plugins/content_management/server/rpc/procedures/msearch.test.ts index 2b23aa552ab2c..7b28fae6d3b49 100644 --- a/src/plugins/content_management/server/rpc/procedures/msearch.test.ts +++ b/src/plugins/content_management/server/rpc/procedures/msearch.test.ts @@ -6,17 +6,17 @@ * Side Public License, v 1. */ -import type { Version } from '@kbn/object-versioning'; import { savedObjectsClientMock } from '@kbn/core-saved-objects-api-server-mocks'; import { MSearchIn, MSearchQuery } from '../../../common'; -import { validate, getServiceObjectTransformFactory } from '../../utils'; +import { validate, disableTransformsCache } from '../../utils'; import { ContentRegistry } from '../../core/registry'; import { createMockedStorage } from '../../core/mocks'; import { EventBus } from '../../core/event_bus'; import { MSearchService } from '../../core/msearch'; import { mSearch } from './msearch'; +disableTransformsCache(); const storageContextGetTransforms = jest.fn(); const spy = () => storageContextGetTransforms; @@ -150,8 +150,6 @@ describe('RPC -> mSearch()', () => { const ctx: any = { contentRegistry, requestHandlerContext, - getTransformsFactory: (contentTypeId: string, version: Version) => - getServiceObjectTransformFactory(contentTypeId, version, { cacheEnabled: false }), mSearchService, };