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 --- .../test/nfvo-components/SubmitErrorResponse.test.js | 8 ++++---- .../test/nfvo-components/editor/TabulatedEditor.test.js | 12 ++++++------ .../nfvo-components/input/dualListBox/dualListbox.test.js | 12 ++++++------ .../test/nfvo-components/input/validation/input.test.js | 8 ++++---- .../test/nfvo-components/listEditor/listEditor.test.js | 8 ++++---- .../test/nfvo-components/modal/globalModal.test.js | 14 +++++++------- .../panel/VersionController/versionController.test.js | 8 ++++---- 7 files changed, 35 insertions(+), 35 deletions(-) (limited to 'openecomp-ui/test/nfvo-components') diff --git a/openecomp-ui/test/nfvo-components/SubmitErrorResponse.test.js b/openecomp-ui/test/nfvo-components/SubmitErrorResponse.test.js index 27be13bc02..77b8467791 100644 --- a/openecomp-ui/test/nfvo-components/SubmitErrorResponse.test.js +++ b/openecomp-ui/test/nfvo-components/SubmitErrorResponse.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 React from 'react'; -import TestUtils from 'react-addons-test-utils'; +import TestUtils from 'react-dom/test-utils'; import SubmitErrorResponse from 'nfvo-components/SubmitErrorResponse.jsx'; import {SubmitErrorMessageFactory} from 'test-utils/factories/SubnitErrorMessageFactorie.js'; diff --git a/openecomp-ui/test/nfvo-components/editor/TabulatedEditor.test.js b/openecomp-ui/test/nfvo-components/editor/TabulatedEditor.test.js index 7a86933770..0738bbb03d 100644 --- a/openecomp-ui/test/nfvo-components/editor/TabulatedEditor.test.js +++ b/openecomp-ui/test/nfvo-components/editor/TabulatedEditor.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,8 +16,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 TabulatedEditor from 'nfvo-components/editor/TabulatedEditor.jsx'; import { Provider } from 'react-redux'; import {storeCreator} from 'sdc-app/AppStore.js'; @@ -25,7 +25,7 @@ import {storeCreator} from 'sdc-app/AppStore.js'; describe('Tabulated Editor test: ', function () { const store = storeCreator(); it('basic view test', () => { - var renderer = TestUtils.createRenderer(); + const renderer = new ShallowRenderer(); renderer.render( ); diff --git a/openecomp-ui/test/nfvo-components/input/dualListBox/dualListbox.test.js b/openecomp-ui/test/nfvo-components/input/dualListBox/dualListbox.test.js index 1af7e44a46..fbfabe7975 100644 --- a/openecomp-ui/test/nfvo-components/input/dualListBox/dualListbox.test.js +++ b/openecomp-ui/test/nfvo-components/input/dualListBox/dualListbox.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,9 +15,9 @@ */ import React from 'react'; -import TestUtils from 'react-addons-test-utils'; +import TestUtils from 'react-dom/test-utils'; import DualListboxView from 'nfvo-components/input/dualListbox/DualListboxView.jsx'; - +import ShallowRenderer from 'react-test-renderer/shallow'; const ITEMS = [{id: '1', name: 'aaa'}, {id: '2', name: 'bbb'}, {id: '3', name: 'ccc'}]; @@ -25,7 +25,7 @@ describe('dualListBox Module Tests', function () { it('should render basically', () => { - var renderer = TestUtils.createRenderer(); + const renderer = new ShallowRenderer(); renderer.render({}}/>); var renderedOutput = renderer.getRenderOutput(); expect(renderedOutput).toBeTruthy(); diff --git a/openecomp-ui/test/nfvo-components/input/validation/input.test.js b/openecomp-ui/test/nfvo-components/input/validation/input.test.js index f27e206093..841f64ac3f 100644 --- a/openecomp-ui/test/nfvo-components/input/validation/input.test.js +++ b/openecomp-ui/test/nfvo-components/input/validation/input.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 {scryRenderedDOMComponentsWithTestId} from 'test-utils/Util.js'; import Input from 'nfvo-components/input/validation/Input.jsx'; import Overlay from 'react-bootstrap/lib/Overlay.js'; diff --git a/openecomp-ui/test/nfvo-components/listEditor/listEditor.test.js b/openecomp-ui/test/nfvo-components/listEditor/listEditor.test.js index bcc72e3059..269e5681c4 100644 --- a/openecomp-ui/test/nfvo-components/listEditor/listEditor.test.js +++ b/openecomp-ui/test/nfvo-components/listEditor/listEditor.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 React from 'react'; import {mount} from 'enzyme'; -import TestUtils from 'react-addons-test-utils'; +import TestUtils from 'react-dom/test-utils'; import ListEditorView from 'src/nfvo-components/listEditor/ListEditorView.jsx'; import ListEditorItemView from 'src/nfvo-components/listEditor/ListEditorItemView.jsx'; diff --git a/openecomp-ui/test/nfvo-components/modal/globalModal.test.js b/openecomp-ui/test/nfvo-components/modal/globalModal.test.js index a67f02ce0c..270b7d7357 100644 --- a/openecomp-ui/test/nfvo-components/modal/globalModal.test.js +++ b/openecomp-ui/test/nfvo-components/modal/globalModal.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 GlobalModal, {GlobalModalView, mapStateToProps} from 'src/nfvo-components/modal/GlobalModal.js'; import React from 'react'; -import TestUtils from 'react-addons-test-utils'; +import ShallowRenderer from 'react-test-renderer/shallow'; import store from 'sdc-app/AppStore.js'; import {actionTypes, typeEnum} from 'src/nfvo-components/modal/GlobalModalConstants.js'; @@ -57,7 +57,7 @@ describe('Global Modal tests: ', function () { expect(store.getState().modal).toBeTruthy(); - var renderer = TestUtils.createRenderer(); + const renderer = new ShallowRenderer(); renderer.render(); let renderedOutput = renderer.getRenderOutput(); expect(renderedOutput).toBeTruthy(); @@ -69,7 +69,7 @@ describe('Global Modal tests: ', function () { store.dispatch({type: actionTypes.GLOBAL_MODAL_SHOW, data: {title, msg}}); expect(store.getState().modal).toBeTruthy(); - var renderer = TestUtils.createRenderer(); + const renderer = new ShallowRenderer(); renderer.render(); let renderedOutput = renderer.getRenderOutput(); expect(renderedOutput).toBeTruthy(); @@ -81,7 +81,7 @@ describe('Global Modal tests: ', function () { it('checking component default render', ()=> { expect(window.document).toBeTruthy(); - var renderer = TestUtils.createRenderer(); + const renderer = new ShallowRenderer(); renderer.render({}} />); const globalModalView = renderer.getRenderOutput(); expect(globalModalView).toBeTruthy(); diff --git a/openecomp-ui/test/nfvo-components/panel/VersionController/versionController.test.js b/openecomp-ui/test/nfvo-components/panel/VersionController/versionController.test.js index 5b68319a9f..3b4f0de893 100644 --- a/openecomp-ui/test/nfvo-components/panel/VersionController/versionController.test.js +++ b/openecomp-ui/test/nfvo-components/panel/VersionController/versionController.test.js @@ -1,5 +1,5 @@ /*! - * 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. @@ -16,8 +16,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 VersionController from 'nfvo-components/panel/versionController/VersionController.jsx'; import {actionsEnum} from 'nfvo-components/panel/versionController/VersionControllerConstants.js'; import {scryRenderedDOMComponentsWithTestId} from 'test-utils/Util.js'; @@ -36,7 +36,7 @@ describe('versionController UI Component', () => { const store = storeCreator(); it('function does exist', () => { - var renderer = TestUtils.createRenderer(); + const renderer = new ShallowRenderer(); renderer.render(); var renderedOutput = renderer.getRenderOutput(); -- cgit 1.2.3-korg