Skip to content

Commit

Permalink
[Canvas] Fixes Storybook for DatasourceComponent is crashing. (#110180)
Browse files Browse the repository at this point in the history
* Added mock for `es_service`.

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
Kuznietsov and kibanamachine committed Aug 27, 2021
1 parent 62f1770 commit cac2c4f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
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'),
'../../lib/es_service': resolve(
KIBANA_ROOT,
'x-pack/plugins/canvas/storybook/__mocks__/es_service.ts'
),
},
},
};
Expand Down

0 comments on commit cac2c4f

Please sign in to comment.