Skip to content

Commit

Permalink
Change tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas committed May 11, 2020
1 parent 6010353 commit c44fb7b
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 476 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { connectors } from './__mock__';
describe('Connectors', () => {
let wrapper: ReactWrapper;
const onChangeConnector = jest.fn();
const handleShowAddFlyout = jest.fn();
const handleShowEditFlyout = jest.fn();

const props: Props = {
Expand All @@ -25,7 +24,6 @@ describe('Connectors', () => {
selectedConnector: 'none',
isLoading: false,
onChangeConnector,
handleShowAddFlyout,
handleShowEditFlyout,
};

Expand Down Expand Up @@ -92,6 +90,15 @@ describe('Connectors', () => {
expect(onChangeConnector).toHaveBeenCalledWith('none');
});

test('it shows the add connector button', () => {
wrapper.find('button[data-test-subj="dropdown-connectors"]').simulate('click');
wrapper.update();

expect(
wrapper.find('button[data-test-subj="dropdown-connector-add-connector"]').exists()
).toBeTruthy();
});

test('the text of the update button is shown correctly', () => {
const newWrapper = mount(<Connectors {...props} selectedConnector={'servicenow-1'} />, {
wrappingComponent: TestProviders,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiLink,
EuiButton,
} from '@elastic/eui';

import styled from 'styled-components';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import React, { useMemo } from 'react';
import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiSuperSelect, EuiButtonEmpty } from '@elastic/eui';
import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiSuperSelect } from '@elastic/eui';
import styled from 'styled-components';

import { Connector } from '../../../../containers/case/configure/types';
Expand Down
Loading

0 comments on commit c44fb7b

Please sign in to comment.