Skip to content

Commit 3bccdc8

Browse files
[SIEM] Enable flow_target_select_connected unit tests (#55618)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
1 parent e5a0477 commit 3bccdc8

2 files changed

Lines changed: 17 additions & 7 deletions

File tree

x-pack/legacy/plugins/siem/public/components/page/network/flow_target_select_connected/index.test.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,37 @@
66

77
import { mount } from 'enzyme';
88
import React from 'react';
9+
import { MemoryRouter } from 'react-router-dom';
910

1011
import { TestProviders } from '../../../../mock';
11-
import { FlowTargetSelectConnected } from './index';
12+
import { FlowTargetSelectConnectedComponent } from './index';
1213
import { FlowTarget } from '../../../../graphql/types';
1314

14-
describe.skip('Flow Target Select Connected', () => {
15+
describe('Flow Target Select Connected', () => {
1516
test('renders correctly against snapshot flowTarget source', () => {
1617
const wrapper = mount(
1718
<TestProviders>
18-
<FlowTargetSelectConnected flowTarget={FlowTarget.source} />
19+
<MemoryRouter>
20+
<FlowTargetSelectConnectedComponent flowTarget={FlowTarget.source} />
21+
</MemoryRouter>
1922
</TestProviders>
2023
);
21-
expect(wrapper.find('FlowTargetSelectConnected')).toMatchSnapshot();
24+
expect(wrapper.find('Memo(FlowTargetSelectComponent)').prop('selectedTarget')).toEqual(
25+
FlowTarget.source
26+
);
2227
});
2328

2429
test('renders correctly against snapshot flowTarget destination', () => {
2530
const wrapper = mount(
2631
<TestProviders>
27-
<FlowTargetSelectConnected flowTarget={FlowTarget.destination} />
32+
<MemoryRouter>
33+
<FlowTargetSelectConnectedComponent flowTarget={FlowTarget.destination} />
34+
</MemoryRouter>
2835
</TestProviders>
2936
);
30-
expect(wrapper.find('FlowTargetSelectConnected')).toMatchSnapshot();
37+
38+
expect(wrapper.find('Memo(FlowTargetSelectComponent)').prop('selectedTarget')).toEqual(
39+
FlowTarget.destination
40+
);
3141
});
3242
});

x-pack/legacy/plugins/siem/public/components/page/network/flow_target_select_connected/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const getUpdatedFlowTargetPath = (
3636
return `${newPathame}${location.search}`;
3737
};
3838

39-
const FlowTargetSelectConnectedComponent: React.FC<Props> = ({ flowTarget }) => {
39+
export const FlowTargetSelectConnectedComponent: React.FC<Props> = ({ flowTarget }) => {
4040
const history = useHistory();
4141
const location = useLocation();
4242

0 commit comments

Comments
 (0)