From d2f5794e8565764e71e171e77ff0a548ad206b05 Mon Sep 17 00:00:00 2001 From: Einav Weiss Keidar Date: Wed, 14 Feb 2018 14:00:07 +0200 Subject: upgrade react framework Issue-ID: SDC-894 Change-Id: Iab219b465333d88c2679b01639e8bad6232750d9 Signed-off-by: einavk --- .../attachments/SoftwareProductAttachmentsView.test.js | 12 ++++++------ .../softwareProduct/attachments/setup/heatSetup.test.js | 8 ++++---- .../attachments/validation/HeatValidationView.test.js | 10 +++++----- .../SoftwareProductComponentComputeEditor.test.js | 10 +++++----- .../compute/SoftwareProductComponentsComputes.test.js | 10 +++++----- .../general/SoftwareProductComponentsGeneral.test.js | 10 +++++----- .../softwareProductComponentLoadbalancing.test.js | 10 +++++----- .../SoftwareProductComponentsMonitoring.test.js | 14 +++++++------- .../network/SoftwareProductComponentsNICEditor.test.js | 12 ++++++------ .../network/SoftwareProductComponentsNetwork.test.js | 10 +++++----- .../SoftwareProductComponentsProcessesEditor.test.js | 8 ++++---- .../SoftwareProductComponentsProcessesView.test.js | 16 ++++++++-------- .../creation/SoftwareProductCreation.test.js | 12 ++++++------ .../deployment/SoftwareProductDeploymentEditor.test.js | 12 ++++++------ .../deployment/SoftwareProductDeploymentView.test.js | 10 +++++----- .../test/softwareProduct/details/detailsView.test.js | 12 ++++++------ .../test/softwareProduct/landingPage/landingPage.test.js | 8 ++++---- .../networks/SoftwareProductNetworksView.test.js | 10 +++++----- .../processes/SoftwareProductEditor.test.js | 8 ++++---- .../processes/SoftwareProductProcessesView.test.js | 10 +++++----- 20 files changed, 106 insertions(+), 106 deletions(-) (limited to 'openecomp-ui/test/softwareProduct') diff --git a/openecomp-ui/test/softwareProduct/attachments/SoftwareProductAttachmentsView.test.js b/openecomp-ui/test/softwareProduct/attachments/SoftwareProductAttachmentsView.test.js index cebd1ee362..d7b28eb053 100644 --- a/openecomp-ui/test/softwareProduct/attachments/SoftwareProductAttachmentsView.test.js +++ b/openecomp-ui/test/softwareProduct/attachments/SoftwareProductAttachmentsView.test.js @@ -1,12 +1,12 @@ /* - * Copyright © 2016-2017 European Support Limited + * Copyright © 2016-2018 European Support Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,8 +15,8 @@ */ import React from 'react'; - -import TestUtils from 'react-addons-test-utils'; +import ShallowRenderer from 'react-test-renderer/shallow'; +import TestUtils from 'react-dom/test-utils'; import {VSPAttachmentTreeNodeWithChildrenFactory, VSPAttachmentDetailedError} from 'test-utils/factories/softwareProduct/SoftwareProductAttachmentsFactories.js'; import {defaultStoreFactory} from 'test-utils/factories/onboard/OnboardingCatalogFactories.js'; @@ -69,7 +69,7 @@ describe('SoftwareProduct Attachments - View: ', function () { let data = defaultStoreFactory.build({softwareProduct: {softwareProductAttachments, softwareProductEditor: {data: {...versionControllerData}}}}); var params = mapStateToProps(data); - var renderer = TestUtils.createRenderer(); + const renderer = new ShallowRenderer(); renderer.render(); var renderedOutput = renderer.getRenderOutput(); expect(renderedOutput).toBeTruthy(); diff --git a/openecomp-ui/test/softwareProduct/attachments/setup/heatSetup.test.js b/openecomp-ui/test/softwareProduct/attachments/setup/heatSetup.test.js index 9d80e58d2f..ba17f91ffd 100644 --- a/openecomp-ui/test/softwareProduct/attachments/setup/heatSetup.test.js +++ b/openecomp-ui/test/softwareProduct/attachments/setup/heatSetup.test.js @@ -1,12 +1,12 @@ /* - * Copyright © 2016-2017 European Support Limited + * Copyright © 2016-2018 European Support Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,7 +15,7 @@ */ import React from 'react'; -import TestUtils from 'react-addons-test-utils'; +import TestUtils from 'react-dom/test-utils'; import {mapStateToProps} from 'sdc-app/onboarding/softwareProduct/attachments/setup/HeatSetup.js'; import HeatSetupView from 'sdc-app/onboarding/softwareProduct/attachments/setup/HeatSetupView.jsx'; import {storeCreator} from 'sdc-app/AppStore.js'; diff --git a/openecomp-ui/test/softwareProduct/attachments/validation/HeatValidationView.test.js b/openecomp-ui/test/softwareProduct/attachments/validation/HeatValidationView.test.js index 3b7c3b7edb..eedd714f5e 100644 --- a/openecomp-ui/test/softwareProduct/attachments/validation/HeatValidationView.test.js +++ b/openecomp-ui/test/softwareProduct/attachments/validation/HeatValidationView.test.js @@ -1,12 +1,12 @@ /* - * Copyright © 2016-2017 European Support Limited + * Copyright © 2016-2018 European Support Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,7 +15,7 @@ */ import React from 'react'; -import TestUtils from 'react-addons-test-utils'; +import ShallowRenderer from 'react-test-renderer/shallow'; import {mapStateToProps} from 'sdc-app/onboarding/softwareProduct/attachments/validation/HeatValidation.js'; import HeatValidationView from 'sdc-app/onboarding/softwareProduct/attachments/validation/HeatValidationView.jsx'; @@ -165,7 +165,7 @@ describe('SoftwareProductAttachments Modal Mapper and View Classes', () => { var onDeSelect = () => { return null; } ; var onToggle = () => { return null; } ; - var renderer = TestUtils.createRenderer(); + const renderer = new ShallowRenderer(); renderer.render( {} }; - var renderer = TestUtils.createRenderer(); + const renderer = new ShallowRenderer(); renderer.render(); var renderedOutput = renderer.getRenderOutput(); expect(renderedOutput).toBeTruthy(); diff --git a/openecomp-ui/test/softwareProduct/components/compute/SoftwareProductComponentsComputes.test.js b/openecomp-ui/test/softwareProduct/components/compute/SoftwareProductComponentsComputes.test.js index f3801beb40..37109c87db 100644 --- a/openecomp-ui/test/softwareProduct/components/compute/SoftwareProductComponentsComputes.test.js +++ b/openecomp-ui/test/softwareProduct/components/compute/SoftwareProductComponentsComputes.test.js @@ -1,12 +1,12 @@ /* - * Copyright © 2016-2017 European Support Limited + * Copyright © 2016-2018 European Support Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ import deepFreeze from 'deep-freeze'; import React from 'react'; -import TestUtils from 'react-addons-test-utils'; +import ShallowRenderer from 'react-test-renderer/shallow'; import {storeCreator} from 'sdc-app/AppStore.js'; import ComputeFlavors from 'sdc-app/onboarding/softwareProduct/components/compute/computeComponents/ComputeFlavors.js'; import {ComputeFlavorBaseData} from 'test-utils/factories/softwareProduct/SoftwareProductComponentsComputeFactory.js'; @@ -32,7 +32,7 @@ describe('Software Product Component ComputeFlavors - View Classes.', () => { const ComputeFlavorsList = ComputeFlavorBaseData.buildList(1); - var renderer = TestUtils.createRenderer(); + const renderer = new ShallowRenderer(); renderer.render( { name: '' }; - var renderer = TestUtils.createRenderer(); + const renderer = new ShallowRenderer(); renderer.render( const versionControllerData = VSPComponentsVersionControllerFactory.build(); - var renderer = TestUtils.createRenderer(); + const renderer = new ShallowRenderer(); renderer.render( ); let renderedOutput = renderer.getRenderOutput(); expect(renderedOutput).toBeTruthy(); @@ -80,7 +80,7 @@ describe('SoftwareProductComponentsMonitoring Module Tests', function () { expect(results.filenames[trap]).toEqual(monitoring[trap]); expect(results.filenames[ves]).toEqual(monitoring[ves]); - var renderer = TestUtils.createRenderer(); + const renderer = new ShallowRenderer(); renderer.render(); let renderedOutput = renderer.getRenderOutput(); expect(renderedOutput).toBeTruthy(); diff --git a/openecomp-ui/test/softwareProduct/components/network/SoftwareProductComponentsNICEditor.test.js b/openecomp-ui/test/softwareProduct/components/network/SoftwareProductComponentsNICEditor.test.js index 1a1aacf677..4e71dc6fa7 100644 --- a/openecomp-ui/test/softwareProduct/components/network/SoftwareProductComponentsNICEditor.test.js +++ b/openecomp-ui/test/softwareProduct/components/network/SoftwareProductComponentsNICEditor.test.js @@ -1,12 +1,12 @@ /* - * Copyright © 2016-2017 European Support Limited + * Copyright © 2016-2018 European Support Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,8 +15,8 @@ */ import React from 'react'; - -import TestUtils from 'react-addons-test-utils'; +import ShallowRenderer from 'react-test-renderer/shallow'; +import TestUtils from 'react-dom/test-utils'; import {mapStateToProps} from 'sdc-app/onboarding/softwareProduct/components/network/SoftwareProductComponentsNICEditor.js'; import SoftwareProductComponentsNICEditorView from 'sdc-app/onboarding/softwareProduct/components/network/SoftwareProductComponentsNICEditorView.jsx'; @@ -82,7 +82,7 @@ describe('Software Product Component Network NIC Editor and View Classes', () => protocols: [] }; - var renderer = TestUtils.createRenderer(); + const renderer = new ShallowRenderer(); renderer.render(); var renderedOutput = renderer.getRenderOutput(); expect(renderedOutput).toBeTruthy(); diff --git a/openecomp-ui/test/softwareProduct/components/network/SoftwareProductComponentsNetwork.test.js b/openecomp-ui/test/softwareProduct/components/network/SoftwareProductComponentsNetwork.test.js index 816f6150ff..91512913f4 100644 --- a/openecomp-ui/test/softwareProduct/components/network/SoftwareProductComponentsNetwork.test.js +++ b/openecomp-ui/test/softwareProduct/components/network/SoftwareProductComponentsNetwork.test.js @@ -1,12 +1,12 @@ /* - * Copyright © 2016-2017 European Support Limited + * Copyright © 2016-2018 European Support Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,7 +15,7 @@ */ import React from 'react'; -import TestUtils from 'react-addons-test-utils'; +import ShallowRenderer from 'react-test-renderer/shallow'; import {mapStateToProps} from 'sdc-app/onboarding/softwareProduct/components/network/SoftwareProductComponentsNetworkList.js'; import SoftwareProductComponentsNetworkListView from 'sdc-app/onboarding/softwareProduct/components/network/SoftwareProductComponentsNetworkListView.jsx'; @@ -71,7 +71,7 @@ describe('Software Product Component Network Mapper and View Classes', () => { const nicList = VSPComponentsNicWithIdFactory.buildList(1); - var renderer = TestUtils.createRenderer(); + const renderer = new ShallowRenderer(); renderer.render( { - it('mapStateToProps mapper exists', () => { + it('mapStateToProps mapper exists', () => { expect(mapStateToProps).toBeTruthy(); }); - it('mapStateToProps data test', () => { + it('mapStateToProps data test', () => { const currentSoftwareProduct = VSPEditorFactory.build(); const processesList = VSPProcessStoreFactory.buildList(2); @@ -52,12 +52,12 @@ describe('SoftwareProductComponetsProcesses Mapper and View Classes', () => { expect(results.processesList.length).toBe(2); }); - it('view simple test', () => { + it('view simple test', () => { const currentSoftwareProduct = VSPEditorFactory.build(); const currentSoftwareProductComponent = VSPComponentsFactory.build(); const processesList = VSPProcessStoreFactory.buildList(2); - var renderer = TestUtils.createRenderer(); + const renderer = new ShallowRenderer(); renderer.render( ); @@ -107,7 +107,7 @@ describe('Software Product Creation Module Tests', function() { } }; let props = Object.assign({}, mapStateToProps(state), mapActionsToProps(dispatch)); - var renderer = TestUtils.createRenderer(); + const renderer = new ShallowRenderer(); renderer.render( ); diff --git a/openecomp-ui/test/softwareProduct/deployment/SoftwareProductDeploymentEditor.test.js b/openecomp-ui/test/softwareProduct/deployment/SoftwareProductDeploymentEditor.test.js index 3d0f7fca2d..3edeebfed9 100644 --- a/openecomp-ui/test/softwareProduct/deployment/SoftwareProductDeploymentEditor.test.js +++ b/openecomp-ui/test/softwareProduct/deployment/SoftwareProductDeploymentEditor.test.js @@ -1,12 +1,12 @@ /* - * Copyright © 2016-2017 European Support Limited + * Copyright © 2016-2018 European Support Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -14,8 +14,8 @@ * limitations under the License. */ import React from 'react'; - -import TestUtils from 'react-addons-test-utils'; +import ShallowRenderer from 'react-test-renderer/shallow'; +import TestUtils from 'react-dom/test-utils'; import { mapStateToProps } from 'sdc-app/onboarding/softwareProduct/deployment/editor/SoftwareProductDeploymentEditor.js'; import SoftwareProductDeploymentEditorView from 'sdc-app/onboarding/softwareProduct/deployment/editor/SoftwareProductDeploymentEditorView.jsx'; import { VSPComponentsFactory } from 'test-utils/factories/softwareProduct/SoftwareProductComponentsFactories.js'; @@ -67,7 +67,7 @@ describe('Software Product Deployment Editor Module Tests', function () { it('jsx view test', () => { const componentsList = VSPComponentsFactory.buildList(1); - var renderer = TestUtils.createRenderer(); + const renderer = new ShallowRenderer(); renderer.render( { const deploymentFlavors = VSPDeploymentStoreFactory.buildList(2); - var renderer = TestUtils.createRenderer(); + const renderer = new ShallowRenderer(); renderer.render( { const networksList = VSPNetworkFactory.buildList(2); const versionControllerData = VSPComponentsVersionControllerFactory.build(); - var renderer = TestUtils.createRenderer(); + const renderer = new ShallowRenderer(); renderer.render(); var renderedOutput = renderer.getRenderOutput(); expect(renderedOutput).toBeTruthy(); diff --git a/openecomp-ui/test/softwareProduct/processes/SoftwareProductEditor.test.js b/openecomp-ui/test/softwareProduct/processes/SoftwareProductEditor.test.js index e61f2673a3..b3f5e350eb 100644 --- a/openecomp-ui/test/softwareProduct/processes/SoftwareProductEditor.test.js +++ b/openecomp-ui/test/softwareProduct/processes/SoftwareProductEditor.test.js @@ -1,12 +1,12 @@ /* - * Copyright © 2016-2017 European Support Limited + * Copyright © 2016-2018 European Support Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,7 +15,7 @@ */ import React from 'react'; -import TestUtils from 'react-addons-test-utils'; +import TestUtils from 'react-dom/test-utils'; import {mapStateToProps} from 'sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcessesEditor.js'; import SoftwareProductProcessesEditorView from 'sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcessesEditorView.jsx'; import {VSPEditorFactory} from 'test-utils/factories/softwareProduct/SoftwareProductEditorFactories.js'; diff --git a/openecomp-ui/test/softwareProduct/processes/SoftwareProductProcessesView.test.js b/openecomp-ui/test/softwareProduct/processes/SoftwareProductProcessesView.test.js index 345c46999b..e48e6c6534 100644 --- a/openecomp-ui/test/softwareProduct/processes/SoftwareProductProcessesView.test.js +++ b/openecomp-ui/test/softwareProduct/processes/SoftwareProductProcessesView.test.js @@ -1,12 +1,12 @@ /* - * Copyright © 2016-2017 European Support Limited + * Copyright © 2016-2018 European Support Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,7 +15,7 @@ */ import React from 'react'; -import TestUtils from 'react-addons-test-utils'; +import ShallowRenderer from 'react-test-renderer/shallow'; import {mapStateToProps} from 'sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcesses.js'; import SoftwareProductProcessesView from 'sdc-app/onboarding/softwareProduct/processes/SoftwareProductProcessesView.jsx'; @@ -56,7 +56,7 @@ describe('SoftwareProductProcesses Mapper and View Classes', () => { const versionControllerData = VSPComponentsVersionControllerFactory.build(); - var renderer = TestUtils.createRenderer(); + const renderer = new ShallowRenderer(); renderer.render(