Skip to content

Commit

Permalink
Replace deprecated IndexPatternsContract
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro Fernández Gómez committed Feb 7, 2022
1 parent f3b2fb8 commit 68656d0
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import * as useValuesListHook from '../../../hooks/use_values_list';
import dataViewData from './configurations/test_data/test_data_view.json';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { setIndexPatterns } from '../../../../../../../src/plugins/data/public/services';
import { DataView, IndexPatternsContract } from '../../../../../../../src/plugins/data/common';
import { DataView, DataViewsContract } from '../../../../../../../src/plugins/data/common';

import { AppDataType, SeriesUrl, UrlFilter } from './types';
import { createStubDataView } from '../../../../../../../src/plugins/data/common/stubs';
Expand Down Expand Up @@ -145,12 +145,12 @@ export function MockKibanaProvider<ExtraCore extends Partial<CoreStart>>({
core,
kibanaProps,
}: MockKibanaProviderProps<ExtraCore>) {
const indexPattern = mockDataView;
const dataView = mockDataView;

setIndexPatterns({
...[indexPattern],
get: async () => indexPattern,
} as unknown as IndexPatternsContract);
...[dataView],
get: async () => dataView,
} as unknown as DataViewsContract);

return (
<KibanaContextProvider services={{ ...core }} {...kibanaProps}>
Expand Down

0 comments on commit 68656d0

Please sign in to comment.