summaryrefslogtreecommitdiffstats
path: root/openecomp-ui/test/softwareProduct/landingPage
diff options
context:
space:
mode:
authorAvi Ziv <avi.ziv@amdocs.com>2017-07-18 19:45:38 +0300
committerAvi Ziv <avi.ziv@amdocs.com>2017-07-18 19:45:38 +0300
commitb8e2faf476202b6ffe61bc3a9a37df1304881d40 (patch)
treef78b8c0517d8e16c5ae610bf8b49f68ea8a312a1 /openecomp-ui/test/softwareProduct/landingPage
parent75aacbbe1acf78fa53378f07f0a8c7769449a17e (diff)
[SDC] Onboarding 1710 rebase.
Change-Id: If3b6b81d221fde13908f1e8160db6f7d9433c535 Signed-off-by: Avi Ziv <avi.ziv@amdocs.com>
Diffstat (limited to 'openecomp-ui/test/softwareProduct/landingPage')
-rw-r--r--openecomp-ui/test/softwareProduct/landingPage/landingPage.test.js58
1 files changed, 39 insertions, 19 deletions
diff --git a/openecomp-ui/test/softwareProduct/landingPage/landingPage.test.js b/openecomp-ui/test/softwareProduct/landingPage/landingPage.test.js
index f06ad61e4f..4da0ec98d4 100644
--- a/openecomp-ui/test/softwareProduct/landingPage/landingPage.test.js
+++ b/openecomp-ui/test/softwareProduct/landingPage/landingPage.test.js
@@ -28,6 +28,8 @@ import {default as VspQdataFactory} from 'test-utils/factories/softwareProduct/
import {VSPComponentsFactory} from 'test-utils/factories/softwareProduct/SoftwareProductComponentsFactories.js';
import {FinalizedLicenseModelFactory} from 'test-utils/factories/licenseModel/LicenseModelFactories.js';
+import { Provider } from 'react-redux';
+import {storeCreator} from 'sdc-app/AppStore.js';
import {mapStateToProps} from 'sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPage.js';
import SoftwareProductLandingPageView from 'sdc-app/onboarding/softwareProduct/landingPage/SoftwareProductLandingPageView.jsx';
@@ -95,8 +97,9 @@ describe('Software Product Landing Page: ', function () {
componentsList: VSPComponentsFactory.buildList(2)
};
- let vspLandingView = TestUtils.renderIntoDocument(<SoftwareProductLandingPageView
- {...params}/>);
+ const store = storeCreator();
+ let vspLandingView = TestUtils.renderIntoDocument(<Provider store={store}><SoftwareProductLandingPageView
+ {...params}/></Provider>);
expect(vspLandingView).toBeTruthy();
});
@@ -108,11 +111,16 @@ describe('Software Product Landing Page: ', function () {
componentsList: VSPComponentsFactory.buildList(2)
};
- let vspLandingView = TestUtils.renderIntoDocument(<SoftwareProductLandingPageView
- {...params}/>);
+ const store = storeCreator();
+ let vspLandingView = TestUtils.renderIntoDocument(<Provider store={store}><SoftwareProductLandingPageView
+ {...params}/></Provider>);
+ let vspLandingViewWrapper = TestUtils.findRenderedComponentWithType(
+ vspLandingView,
+ SoftwareProductLandingPageView
+ );
expect(vspLandingView).toBeTruthy();
- vspLandingView.handleOnDragEnter(false);
- expect(vspLandingView.state.dragging).toEqual(true);
+ vspLandingViewWrapper.handleOnDragEnter(false);
+ expect(vspLandingViewWrapper.state.dragging).toEqual(true);
});
@@ -126,10 +134,7 @@ describe('Software Product Landing Page: ', function () {
onUpload: dummyFunc,
onInvalidFileSizeUpload: dummyFunc
};
-
- let vspLandingView = TestUtils.renderIntoDocument(<SoftwareProductLandingPageView
- {...params}/>);
- expect(vspLandingView).toBeTruthy();
+
const files = [
{
name: 'aaa',
@@ -137,16 +142,24 @@ describe('Software Product Landing Page: ', function () {
}
];
- vspLandingView.handleImportSubmit(files, false);
- expect(vspLandingView.state.dragging).toEqual(false);
- expect(vspLandingView.state.fileName).toEqual(files[0].name);
+ const store = storeCreator();
+
+ let vspLandingView = TestUtils.renderIntoDocument(<Provider store={store}><SoftwareProductLandingPageView {...params}/></Provider>);
+ let vspLandingViewWrapper = TestUtils.findRenderedComponentWithType(
+ vspLandingView,
+ SoftwareProductLandingPageView
+ );
+ expect(vspLandingView).toBeTruthy();
+ vspLandingViewWrapper.handleImportSubmit(files, false);
+ expect(vspLandingViewWrapper.state.dragging).toEqual(false);
+ expect(vspLandingViewWrapper.state.fileName).toEqual(files[0].name);
const files1 = [
{
name: 'bbb',
size: 0
}
];
- vspLandingView.handleImportSubmit(files1, false);
+ vspLandingViewWrapper.handleImportSubmit(files1, false);
});
it('vsp landing handleImportSubmit with damaged file test ', () => {
@@ -160,8 +173,15 @@ describe('Software Product Landing Page: ', function () {
onInvalidFileSizeUpload: dummyFunc
};
- let vspLandingView = TestUtils.renderIntoDocument(<SoftwareProductLandingPageView
- {...params}/>);
+ const store = storeCreator();
+
+ let vspLandingView = TestUtils.renderIntoDocument(<Provider store={store}><SoftwareProductLandingPageView
+ {...params}/></Provider>);
+
+ let vspLandingViewWrapper = TestUtils.findRenderedComponentWithType(
+ vspLandingView,
+ SoftwareProductLandingPageView
+ );
expect(vspLandingView).toBeTruthy();
const files = [
{
@@ -170,8 +190,8 @@ describe('Software Product Landing Page: ', function () {
}
];
- vspLandingView.handleImportSubmit(files, false);
- expect(vspLandingView.state.dragging).toEqual(false);
- expect(vspLandingView.state.fileName).toEqual('');
+ vspLandingViewWrapper.handleImportSubmit(files, false);
+ expect(vspLandingViewWrapper.state.dragging).toEqual(false);
+ expect(vspLandingViewWrapper.state.fileName).toEqual('');
});
});