Skip to content

Commit

Permalink
update exploration jest test
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarezmelissa87 committed Jan 16, 2020
1 parent b88dc0e commit fbd3384
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import { shallow } from 'enzyme';
import React from 'react';
import { DATA_FRAME_TASK_STATE } from '../../../analytics_management/components/analytics_list/common';
import { KibanaContext } from '../../../../../contexts/kibana';
import { kibanaContextValueMock } from '../../../../../contexts/kibana/__mocks__/kibana_context_value';

jest.mock('../../../../../contexts/ui/use_ui_chrome_context');
jest.mock('ui/new_platform');
Expand All @@ -22,7 +24,9 @@ jest.mock('react', () => {
describe('Data Frame Analytics: <Exploration />', () => {
test('Minimal initialization', () => {
const wrapper = shallow(
<Exploration jobId="the-job-id" jobStatus={DATA_FRAME_TASK_STATE.STOPPED} />
<KibanaContext.Provider value={kibanaContextValueMock}>
<Exploration jobId="the-job-id" jobStatus={DATA_FRAME_TASK_STATE.STOPPED} />
</KibanaContext.Provider>
);
// Without the jobConfig being loaded, the component will just return empty.
expect(wrapper.text()).toMatch('');
Expand Down

0 comments on commit fbd3384

Please sign in to comment.