Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Commit

Permalink
Fix mapping wizard tests and update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
mturley committed Oct 1, 2019
1 parent f044386 commit 4b8ff6c
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 74 deletions.
Expand Up @@ -23,32 +23,3 @@ Array [
},
]
`;
exports[`queryProvidersAction dispatches PENDING and FULFILLED actions 1`] = `
Array [
Object {
"type": "QUERY_V2V_PROVIDERS_PENDING",
},
Object {
"payload": Array [
Object {
"mock": "data",
},
],
"type": "QUERY_V2V_PROVIDERS_FULFILLED",
},
]
`;
exports[`queryProvidersAction dispatches PENDING and REJECTED actions 1`] = `
Array [
Object {
"type": "QUERY_V2V_PROVIDERS_PENDING",
},
Object {
"error": true,
"payload": [Error: <mocked error>],
"type": "QUERY_V2V_PROVIDERS_REJECTED",
},
]
`;
Expand Up @@ -2,50 +2,38 @@

exports[`fetching source clusters is pending 1`] = `
Object {
"errorQueryProviders": null,
"errorSourceClusters": null,
"errorTargetClusters": null,
"isFetchingSourceClusters": true,
"isFetchingTargetClusters": false,
"isQueryingProviders": false,
"isRejectedQueryProviders": false,
"isRejectedSourceClusters": false,
"isRejectedTargetClusters": false,
"providers": Array [],
"sourceClusters": Array [],
"targetClusters": Array [],
}
`;

exports[`fetching source clusters is rejected 1`] = `
Object {
"errorQueryProviders": null,
"errorSourceClusters": "error",
"errorTargetClusters": null,
"isFetchingSourceClusters": false,
"isFetchingTargetClusters": false,
"isQueryingProviders": false,
"isRejectedQueryProviders": false,
"isRejectedSourceClusters": true,
"isRejectedTargetClusters": false,
"providers": Array [],
"sourceClusters": Array [],
"targetClusters": Array [],
}
`;

exports[`fetching source clusters is successful, and there is data 1`] = `
Object {
"errorQueryProviders": null,
"errorSourceClusters": null,
"errorTargetClusters": null,
"isFetchingSourceClusters": false,
"isFetchingTargetClusters": false,
"isQueryingProviders": false,
"isRejectedQueryProviders": false,
"isRejectedSourceClusters": false,
"isRejectedTargetClusters": false,
"providers": Array [],
"sourceClusters": Array [
Object {
"0": Object {
Expand Down Expand Up @@ -131,33 +119,25 @@ Object {

exports[`fetching source clusters is successful, and there is no data 1`] = `
Object {
"errorQueryProviders": null,
"errorSourceClusters": null,
"errorTargetClusters": null,
"isFetchingSourceClusters": false,
"isFetchingTargetClusters": false,
"isQueryingProviders": false,
"isRejectedQueryProviders": false,
"isRejectedSourceClusters": false,
"isRejectedTargetClusters": false,
"providers": Array [],
"sourceClusters": Array [],
"targetClusters": Array [],
}
`;

exports[`sets default state 1`] = `
Object {
"errorQueryProviders": null,
"errorSourceClusters": null,
"errorTargetClusters": null,
"isFetchingSourceClusters": false,
"isFetchingTargetClusters": false,
"isQueryingProviders": false,
"isRejectedQueryProviders": false,
"isRejectedSourceClusters": false,
"isRejectedTargetClusters": false,
"providers": Array [],
"sourceClusters": Array [],
"targetClusters": Array [],
}
Expand Down
Expand Up @@ -16,7 +16,6 @@ Object {
"isRejectedTargetClusters": false,
"keepDirtyOnReinitialize": true,
"ospConversionHosts": Array [],
"queryProvidersAction": [Function],
"rhvConversionHosts": Array [],
"showAlertAction": [Function],
"sourceClusters": Array [],
Expand Down
Expand Up @@ -4,7 +4,7 @@ import { shallow } from 'enzyme';
import ClustersStepForm from '../ClustersStepForm';
import { srcClusters, tgtClusters } from '../clustersStepForm.fixtures';
import { targetClusterWithExtendedData, sourceClusterWithExtendedData } from '../helpers';
import { RHV, OPENSTACK } from '../../../../../MappingWizardConstants';
import { RHV } from '../../../../../MappingWizardConstants';

let onChange;
let baseProps;
Expand Down Expand Up @@ -92,29 +92,6 @@ describe('#addMapping', () => {
});
});

describe('OSP RSA key pairs', () => {
const input = { value: [], onChange };
const props = {
...baseProps,
sourceClusters: [],
targetClusters: [{ id: '1', name: 'target project', ems_id: '1', ext_management_system: { name: 'OSP' } }],
targetProvider: OPENSTACK
};
test('displays a warning icon if the provider does not have a RSA key', () => {
const providers = [{ name: 'OSP', id: '1', authentications: [] }];
const wrapper = shallow(<ClustersStepForm {...props} input={input} providers={providers} />);
const listItem = wrapper.find('DualPaneMapperListItem');
expect(listItem.prop('warningMessage')).toBeTruthy();
});

test('does not display a warning icon if the provider has a RSA key', () => {
const providers = [{ name: 'OSP', id: '1', authentications: [{ authtype: 'ssh_keypair' }] }];
const wrapper = shallow(<ClustersStepForm {...props} input={input} providers={providers} />);
const listItem = wrapper.find('DualPaneMapperListItem');
expect(listItem.prop('warningMessage')).toBeFalsy();
});
});

describe('RHV conversion hosts', () => {
const props = {
...baseProps,
Expand Down

0 comments on commit 4b8ff6c

Please sign in to comment.