Skip to content

Commit

Permalink
[ML] set wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Apr 30, 2020
1 parent 00cd6d1 commit 172807e
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ import React from 'react';
import { render } from '@testing-library/react';
import { ExplorerSwimlaneContainer } from './explorer_swimlane_container';
import { BehaviorSubject, Observable } from 'rxjs';
import { I18nProvider } from '@kbn/i18n/react';
import {
AnomalySwimlaneEmbeddableInput,
AnomalySwimlaneServices,
} from './anomaly_swimlane_embeddable';
import { CoreStart } from 'kibana/public';
import { MlStartDependencies } from '../../plugin';
import { useSwimlaneInputResolver } from './swimlane_input_resolver';
// @ts-ignore
import { ExplorerSwimlane } from '../../application/explorer/explorer_swimlane';
// @ts-ignore
import { MlTooltipComponent } from '../../application/components/chart_tooltip';
import { SWIMLANE_TYPE } from '../../application/explorer/explorer_constants';

jest.mock('./swimlane_input_resolver', () => ({
Expand All @@ -35,6 +32,8 @@ jest.mock('../../application/components/chart_tooltip', () => ({
MlTooltipComponent: jest.fn(),
}));

const defaultOptions = { wrapper: I18nProvider };

describe('ExplorerSwimlaneContainer', () => {
let embeddableInput: BehaviorSubject<Partial<AnomalySwimlaneEmbeddableInput>>;
let refresh: BehaviorSubject<any>;
Expand Down Expand Up @@ -75,7 +74,8 @@ describe('ExplorerSwimlaneContainer', () => {
}
services={services}
refresh={refresh}
/>
/>,
defaultOptions
);
expect(
await findByTestId('mlMaxAnomalyScoreEmbeddable_test-swimlane-embeddable')
Expand All @@ -98,7 +98,8 @@ describe('ExplorerSwimlaneContainer', () => {
}
services={services}
refresh={refresh}
/>
/>,
defaultOptions
);
const errorMessage = await findByText('Something went wrong');
expect(errorMessage).toBeDefined();
Expand All @@ -113,7 +114,8 @@ describe('ExplorerSwimlaneContainer', () => {
}
services={services}
refresh={refresh}
/>
/>,
defaultOptions
);
expect(
await findByTestId('loading_mlMaxAnomalyScoreEmbeddable_test-swimlane-embeddable')
Expand Down

0 comments on commit 172807e

Please sign in to comment.