From b86d1e5a880ce3fc1389cae99b1d3c53c50114a1 Mon Sep 17 00:00:00 2001 From: pgayvallet Date: Tue, 23 Apr 2024 09:23:14 +0200 Subject: [PATCH] fix rendering service tests --- .../rendering_service.test.ts.snap | 32 +++++++++---------- .../src/test_helpers/params.ts | 3 ++ 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/packages/core/rendering/core-rendering-server-internal/src/__snapshots__/rendering_service.test.ts.snap b/packages/core/rendering/core-rendering-server-internal/src/__snapshots__/rendering_service.test.ts.snap index 250073318a3ac..69f534cf837b4 100644 --- a/packages/core/rendering/core-rendering-server-internal/src/__snapshots__/rendering_service.test.ts.snap +++ b/packages/core/rendering/core-rendering-server-internal/src/__snapshots__/rendering_service.test.ts.snap @@ -37,7 +37,7 @@ Object { ], }, "i18n": Object { - "translationsUrl": "/mock-server-basepath/translations/en.json", + "translationsUrl": "/mock-server-basepath/translations/MOCK_HASH/en.json", }, "legacyMetadata": Object { "globalUiSettings": Object { @@ -117,7 +117,7 @@ Object { ], }, "i18n": Object { - "translationsUrl": "/mock-server-basepath/translations/en.json", + "translationsUrl": "/mock-server-basepath/translations/MOCK_HASH/en.json", }, "legacyMetadata": Object { "globalUiSettings": Object { @@ -193,7 +193,7 @@ Object { ], }, "i18n": Object { - "translationsUrl": "/mock-server-basepath/translations/en.json", + "translationsUrl": "/mock-server-basepath/translations/MOCK_HASH/en.json", }, "legacyMetadata": Object { "globalUiSettings": Object { @@ -273,7 +273,7 @@ Object { ], }, "i18n": Object { - "translationsUrl": "/translations/en.json", + "translationsUrl": "/mock-server-basepath/translations/MOCK_HASH/en.json", }, "legacyMetadata": Object { "globalUiSettings": Object { @@ -349,7 +349,7 @@ Object { ], }, "i18n": Object { - "translationsUrl": "/mock-server-basepath/translations/en.json", + "translationsUrl": "/mock-server-basepath/translations/MOCK_HASH/en.json", }, "legacyMetadata": Object { "globalUiSettings": Object { @@ -425,7 +425,7 @@ Object { ], }, "i18n": Object { - "translationsUrl": "/mock-server-basepath/translations/en.json", + "translationsUrl": "/mock-server-basepath/translations/MOCK_HASH/en.json", }, "legacyMetadata": Object { "globalUiSettings": Object { @@ -505,7 +505,7 @@ Object { ], }, "i18n": Object { - "translationsUrl": "/mock-server-basepath/translations/en.json", + "translationsUrl": "/mock-server-basepath/translations/MOCK_HASH/en.json", }, "legacyMetadata": Object { "globalUiSettings": Object { @@ -581,7 +581,7 @@ Object { ], }, "i18n": Object { - "translationsUrl": "/mock-server-basepath/translations/en.json", + "translationsUrl": "/mock-server-basepath/translations/MOCK_HASH/en.json", }, "legacyMetadata": Object { "globalUiSettings": Object { @@ -662,7 +662,7 @@ Object { ], }, "i18n": Object { - "translationsUrl": "/mock-server-basepath/translations/en.json", + "translationsUrl": "/mock-server-basepath/translations/MOCK_HASH/en.json", }, "legacyMetadata": Object { "globalUiSettings": Object { @@ -742,7 +742,7 @@ Object { ], }, "i18n": Object { - "translationsUrl": "/mock-server-basepath/translations/en.json", + "translationsUrl": "/mock-server-basepath/translations/MOCK_HASH/en.json", }, "legacyMetadata": Object { "globalUiSettings": Object { @@ -823,7 +823,7 @@ Object { ], }, "i18n": Object { - "translationsUrl": "/mock-server-basepath/translations/en.json", + "translationsUrl": "/mock-server-basepath/translations/MOCK_HASH/en.json", }, "legacyMetadata": Object { "globalUiSettings": Object { @@ -908,7 +908,7 @@ Object { ], }, "i18n": Object { - "translationsUrl": "/translations/en.json", + "translationsUrl": "/mock-server-basepath/translations/MOCK_HASH/en.json", }, "legacyMetadata": Object { "globalUiSettings": Object { @@ -984,7 +984,7 @@ Object { ], }, "i18n": Object { - "translationsUrl": "/mock-server-basepath/translations/en.json", + "translationsUrl": "/mock-server-basepath/translations/MOCK_HASH/en.json", }, "legacyMetadata": Object { "globalUiSettings": Object { @@ -1065,7 +1065,7 @@ Object { ], }, "i18n": Object { - "translationsUrl": "/mock-server-basepath/translations/en.json", + "translationsUrl": "/mock-server-basepath/translations/MOCK_HASH/en.json", }, "legacyMetadata": Object { "globalUiSettings": Object { @@ -1150,7 +1150,7 @@ Object { ], }, "i18n": Object { - "translationsUrl": "/mock-server-basepath/translations/en.json", + "translationsUrl": "/mock-server-basepath/translations/MOCK_HASH/en.json", }, "legacyMetadata": Object { "globalUiSettings": Object { @@ -1231,7 +1231,7 @@ Object { ], }, "i18n": Object { - "translationsUrl": "/mock-server-basepath/translations/en.json", + "translationsUrl": "/mock-server-basepath/translations/MOCK_HASH/en.json", }, "legacyMetadata": Object { "globalUiSettings": Object { diff --git a/packages/core/rendering/core-rendering-server-internal/src/test_helpers/params.ts b/packages/core/rendering/core-rendering-server-internal/src/test_helpers/params.ts index 42c48d9e0bd21..d7b44157f4a6d 100644 --- a/packages/core/rendering/core-rendering-server-internal/src/test_helpers/params.ts +++ b/packages/core/rendering/core-rendering-server-internal/src/test_helpers/params.ts @@ -12,6 +12,7 @@ import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; import { statusServiceMock } from '@kbn/core-status-server-mocks'; import { customBrandingServiceMock } from '@kbn/core-custom-branding-server-mocks'; import { userSettingsServiceMock } from '@kbn/core-user-settings-server-mocks'; +import { i18nServiceMock } from '@kbn/core-i18n-server-mocks'; const context = mockCoreContext.create(); const httpPreboot = httpServiceMock.createInternalPrebootContract(); @@ -33,6 +34,7 @@ export const mockRenderingServiceParams = context; export const mockRenderingPrebootDeps = { http: httpPreboot, uiPlugins: createUiPlugins(), + i18n: i18nServiceMock.createInternalPrebootContract(), }; export const mockRenderingSetupDeps = { elasticsearch, @@ -41,4 +43,5 @@ export const mockRenderingSetupDeps = { customBranding, status, userSettings, + i18n: i18nServiceMock.createSetupContract(), };