[File upload] Switch to index pattern service shim (#49893)
* Switch to index pattern service shim * Fix test breaking due to unrelated import in same file * Move mock and require out of before call to top of file since they're not directly test-related * Some minor cleanup * One more thing...
This commit is contained in:
parent
dbc9a52fd8
commit
cf03665b98
|
@ -4,10 +4,6 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { start as data } from '../../../../../src/legacy/core_plugins/data/public/legacy';
|
||||
|
||||
export let indexPatternService;
|
||||
|
||||
uiModules.get('app/file_upload').run(($injector) => {
|
||||
indexPatternService = $injector.get('indexPatterns');
|
||||
});
|
||||
export const indexPatternService = data.indexPatterns.indexPatterns;
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
// Not all index pattern dependencies are avab. in jest context,
|
||||
// prevent unrelated import errors by mocking kibana services
|
||||
jest.mock('../kibana_services', () => {});
|
||||
import { checkIndexPatternValid } from './indexing_service';
|
||||
|
||||
describe('indexing_service', () => {
|
||||
|
|
Loading…
Reference in a new issue