Skip to content

Commit

Permalink
Fix spaces tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolf committed Jan 28, 2020
1 parent 816fd4d commit 61e8986
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ describe('onPostAuthInterceptor', () => {
availableSpaces: any[],
testOptions = { simulateGetSpacesFailure: false, simulateGetSingleSpaceFailure: false }
) {
const { http } = await root.setup();
const { http, elasticsearch } = await root.setup();

// Mock esNodesCompatibility$ to prevent `root.start()` from blocking on ES version check
elasticsearch.esNodesCompatibility$ = elasticsearchServiceMock.createInternalSetup().esNodesCompatibility$;

const loggingMock = loggingServiceMock
.create()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {

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

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

initSpacesOnRequestInterceptor({
getLegacyAPI: () =>
Expand Down

0 comments on commit 61e8986

Please sign in to comment.