File tree Expand file tree Collapse file tree
x-pack/legacy/plugins/siem/public/components/page/network/flow_target_select_connected Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77import { mount } from 'enzyme' ;
88import React from 'react' ;
9+ import { MemoryRouter } from 'react-router-dom' ;
910
1011import { TestProviders } from '../../../../mock' ;
11- import { FlowTargetSelectConnected } from './index' ;
12+ import { FlowTargetSelectConnectedComponent } from './index' ;
1213import { 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} ) ;
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments