Skip to content

Commit

Permalink
fix jest test search_bar (elastic#130876)
Browse files Browse the repository at this point in the history
  • Loading branch information
nlatipov authored Apr 25, 2022
1 parent 63e95ab commit b61ef24
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion x-pack/plugins/graph/public/components/search_bar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import {
import { act } from 'react-dom/test-utils';
import { QueryStringInput } from '@kbn/unified-search-plugin/public';
import type { DataView } from '@kbn/data-views-plugin/public';

import { setAutocomplete } from '@kbn/unified-search-plugin/public/services';
import { unifiedSearchPluginMock } from '@kbn/unified-search-plugin/public/mocks';
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
import { I18nProvider, InjectedIntl } from '@kbn/i18n-react';

Expand Down Expand Up @@ -103,6 +104,11 @@ describe('search_bar', () => {
},
};

beforeEach(() => {
const autocompleteStart = unifiedSearchPluginMock.createStartContract();
setAutocomplete(autocompleteStart.autocomplete);
});

beforeEach(() => {
store = createMockGraphStore({
sagas: [submitSearchSaga],
Expand Down

0 comments on commit b61ef24

Please sign in to comment.