Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SIEM] Enable flow_target_select_connected unit tests #55618

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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