Skip to content

Commit

Permalink
Use data view stub instead of discover utils
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasolson committed Nov 7, 2023
1 parent c28374c commit 16e0f07
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { UI_SETTINGS } from '../../../constants';
import { GetConfigFn } from '../../../types';
import { getSearchParams, getSearchParamsFromRequest } from './get_search_params';
import { dataViewMock } from '@kbn/discover-utils/src/__mocks__';
import { createStubDataView } from '@kbn/data-views-plugin/common/data_views/data_view.stub';

function getConfigStub(config: any = {}): GetConfigFn {
return (key) => config[key];
Expand Down Expand Up @@ -53,10 +53,11 @@ describe('getSearchParams', () => {
[UI_SETTINGS.COURIER_SET_REQUEST_PREFERENCE]: 'custom',
[UI_SETTINGS.COURIER_CUSTOM_REQUEST_PREFERENCE]: 'aaa',
});
const index = {
...dataViewMock,
allowHidden: true,
};
const index = createStubDataView({
spec: {
allowHidden: true,
},
});
const searchParams = getSearchParamsFromRequest(
{
index,
Expand All @@ -75,10 +76,11 @@ describe('getSearchParams', () => {
[UI_SETTINGS.COURIER_SET_REQUEST_PREFERENCE]: 'custom',
[UI_SETTINGS.COURIER_CUSTOM_REQUEST_PREFERENCE]: 'aaa',
});
const index = {
...dataViewMock,
allowHidden: false,
};
const index = createStubDataView({
spec: {
allowHidden: false,
},
});
const searchParams = getSearchParamsFromRequest(
{
index,
Expand Down

0 comments on commit 16e0f07

Please sign in to comment.