Skip to content

Commit 61e8986

Browse files
committed
Fix spaces tests
1 parent 816fd4d commit 61e8986

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

x-pack/plugins/spaces/server/lib/request_interceptors/on_post_auth_interceptor.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ describe('onPostAuthInterceptor', () => {
107107
availableSpaces: any[],
108108
testOptions = { simulateGetSpacesFailure: false, simulateGetSingleSpaceFailure: false }
109109
) {
110-
const { http } = await root.setup();
110+
const { http, elasticsearch } = await root.setup();
111+
112+
// Mock esNodesCompatibility$ to prevent `root.start()` from blocking on ES version check
113+
elasticsearch.esNodesCompatibility$ = elasticsearchServiceMock.createInternalSetup().esNodesCompatibility$;
111114

112115
const loggingMock = loggingServiceMock
113116
.create()

x-pack/plugins/spaces/server/lib/request_interceptors/on_request_interceptor.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717

1818
import * as kbnTestServer from '../../../../../../src/test_utils/kbn_server';
1919
import { LegacyAPI } from '../../plugin';
20+
import { elasticsearchServiceMock } from 'src/core/server/mocks';
2021

2122
describe('onRequestInterceptor', () => {
2223
let root: ReturnType<typeof kbnTestServer.createRoot>;
@@ -104,7 +105,9 @@ describe('onRequestInterceptor', () => {
104105
routes: 'legacy' | 'new-platform';
105106
}
106107
async function setup(opts: SetupOpts = { basePath: '/', routes: 'legacy' }) {
107-
const { http } = await root.setup();
108+
const { http, elasticsearch } = await root.setup();
109+
// Mock esNodesCompatibility$ to prevent `root.start()` from blocking on ES version check
110+
elasticsearch.esNodesCompatibility$ = elasticsearchServiceMock.createInternalSetup().esNodesCompatibility$;
108111

109112
initSpacesOnRequestInterceptor({
110113
getLegacyAPI: () =>

0 commit comments

Comments
 (0)