Skip to content

Commit

Permalink
Added mock for es_service.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuznietsov committed Aug 26, 2021
1 parent 5d19559 commit 208fd91
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
import { isEqual } from 'lodash';
import { i18n } from '@kbn/i18n';

import { getDefaultIndex } from '../../lib/es_service';
import { getDefaultIndex } from '../../../public/lib/es_service';
import { DatasourceSelector } from './datasource_selector';
import { DatasourcePreview } from './datasource_preview';

Expand Down
10 changes: 10 additions & 0 deletions x-pack/plugins/canvas/storybook/__mocks__/es_service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export const getDefaultIndex = () => {
return Promise.resolve('Demonstration index');
};
4 changes: 4 additions & 0 deletions x-pack/plugins/canvas/storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ const canvasWebpack = {
resolve: {
alias: {
'src/plugins': resolve(KIBANA_ROOT, 'src/plugins'),
'../../../public/lib/es_service': resolve(
KIBANA_ROOT,
'x-pack/plugins/canvas/storybook/__mocks__/es_service.ts'
),
},
},
};
Expand Down

0 comments on commit 208fd91

Please sign in to comment.