Skip to content

Commit

Permalink
[SIEM] Enable flow_target_select_connected unit tests (#55618) (#56738)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrykkopycinski authored Feb 4, 2020
1 parent 13476af commit 25d0c90
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,37 @@

import { mount } from 'enzyme';
import React from 'react';
import { MemoryRouter } from 'react-router-dom';

import { TestProviders } from '../../../../mock';
import { FlowTargetSelectConnected } from './index';
import { FlowTargetSelectConnectedComponent } from './index';
import { FlowTarget } from '../../../../graphql/types';

describe.skip('Flow Target Select Connected', () => {
describe('Flow Target Select Connected', () => {
test('renders correctly against snapshot flowTarget source', () => {
const wrapper = mount(
<TestProviders>
<FlowTargetSelectConnected flowTarget={FlowTarget.source} />
<MemoryRouter>
<FlowTargetSelectConnectedComponent flowTarget={FlowTarget.source} />
</MemoryRouter>
</TestProviders>
);
expect(wrapper.find('FlowTargetSelectConnected')).toMatchSnapshot();
expect(wrapper.find('Memo(FlowTargetSelectComponent)').prop('selectedTarget')).toEqual(
FlowTarget.source
);
});

test('renders correctly against snapshot flowTarget destination', () => {
const wrapper = mount(
<TestProviders>
<FlowTargetSelectConnected flowTarget={FlowTarget.destination} />
<MemoryRouter>
<FlowTargetSelectConnectedComponent flowTarget={FlowTarget.destination} />
</MemoryRouter>
</TestProviders>
);
expect(wrapper.find('FlowTargetSelectConnected')).toMatchSnapshot();

expect(wrapper.find('Memo(FlowTargetSelectComponent)').prop('selectedTarget')).toEqual(
FlowTarget.destination
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const getUpdatedFlowTargetPath = (
return `${newPathame}${location.search}`;
};

const FlowTargetSelectConnectedComponent: React.FC<Props> = ({ flowTarget }) => {
export const FlowTargetSelectConnectedComponent: React.FC<Props> = ({ flowTarget }) => {
const history = useHistory();
const location = useLocation();

Expand Down

0 comments on commit 25d0c90

Please sign in to comment.