Skip to content

Commit

Permalink
Merge branch '7.x' into backport/7.x/pr-56607
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Feb 4, 2020
2 parents c05de77 + 25d0c90 commit f124369
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 f124369

Please sign in to comment.