[Canvas] Fixes Storybook for DatasourceComponent is crashing. (#110180)

* Added mock for `es_service`.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Yaroslav Kuznietsov 2021-08-27 13:58:10 +03:00 committed by GitHub
parent 73f8a92a33
commit d43e9f586b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View file

@ -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');
};

View file

@ -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'
),
},
},
};