Skip to content

Commit

Permalink
[ML] Update tests to include UrlStateProvider.
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed Jul 6, 2020
1 parent a80e5c8 commit 53d20e6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ import { mount } from 'enzyme';

import { EuiSelect } from '@elastic/eui';

import { UrlStateProvider } from '../../../util/url_state';

import { SelectInterval } from './select_interval';

describe('SelectInterval', () => {
test('creates correct initial selected value', () => {
const wrapper = mount(
<MemoryRouter>
<SelectInterval />
<UrlStateProvider>
<SelectInterval />
</UrlStateProvider>
</MemoryRouter>
);
const select = wrapper.find(EuiSelect);
Expand All @@ -29,7 +33,9 @@ describe('SelectInterval', () => {
test('currently selected value is updated correctly on click', (done) => {
const wrapper = mount(
<MemoryRouter>
<SelectInterval />
<UrlStateProvider>
<SelectInterval />
</UrlStateProvider>
</MemoryRouter>
);
const select = wrapper.find(EuiSelect).first();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ import { mount } from 'enzyme';

import { EuiSuperSelect } from '@elastic/eui';

import { UrlStateProvider } from '../../../util/url_state';

import { SelectSeverity } from './select_severity';

describe('SelectSeverity', () => {
test('creates correct severity options and initial selected value', () => {
const wrapper = mount(
<MemoryRouter>
<SelectSeverity />
<UrlStateProvider>
<SelectSeverity />
</UrlStateProvider>
</MemoryRouter>
);
const select = wrapper.find(EuiSuperSelect);
Expand Down Expand Up @@ -65,7 +69,9 @@ describe('SelectSeverity', () => {
test('state for currently selected value is updated correctly on click', (done) => {
const wrapper = mount(
<MemoryRouter>
<SelectSeverity />
<UrlStateProvider>
<SelectSeverity />
</UrlStateProvider>
</MemoryRouter>
);

Expand Down

0 comments on commit 53d20e6

Please sign in to comment.