aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-ui/test/versionsPage
diff options
context:
space:
mode:
authorsvishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>2018-03-19 12:15:19 +0200
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2018-03-20 07:51:05 +0000
commit091edfdac90f66d91caff1b93131f99ba74f9aeb (patch)
treea6a24fc4a295b7f804aeb2a2211e58b38bbf922a /openecomp-ui/test/versionsPage
parentfefa3e408f77289594e47edc878d1bee61fca90b (diff)
ui support for archive items
Issue-ID: SDC-1088 Change-Id: I836e4896a8ec6bb065f9d2571f514916ccf6759f Signed-off-by: svishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>
Diffstat (limited to 'openecomp-ui/test/versionsPage')
-rw-r--r--openecomp-ui/test/versionsPage/VersionsPage.test.js33
1 files changed, 30 insertions, 3 deletions
diff --git a/openecomp-ui/test/versionsPage/VersionsPage.test.js b/openecomp-ui/test/versionsPage/VersionsPage.test.js
index 61e93cb9d2..fd7659e70e 100644
--- a/openecomp-ui/test/versionsPage/VersionsPage.test.js
+++ b/openecomp-ui/test/versionsPage/VersionsPage.test.js
@@ -16,11 +16,12 @@
import React from 'react';
import ShallowRenderer from 'react-test-renderer/shallow';
+import {mount} from 'enzyme';
+import {Provider} from 'react-redux';
import deepFreeze from 'deep-freeze';
import mockRest from 'test-utils/MockRest.js';
import Configuration from 'sdc-app/config/Configuration.js';
import {storeCreator} from 'sdc-app/AppStore.js';
-
import {mapStateToProps, mapActionsToProps} from 'sdc-app/onboarding/versionsPage/VersionsPage.js';
import VersionsPageView from 'sdc-app/onboarding/versionsPage/VersionsPage.jsx';
import VersionsPageActionHelper from 'sdc-app/onboarding/versionsPage/VersionsPageActionHelper.js';
@@ -29,6 +30,7 @@ import {itemTypes as versionPageItemTypes} from 'sdc-app/onboarding/versionsPage
import VersionFactory from 'test-utils/factories/common/VersionFactory.js';
import {VersionsPageCreationFactory} from 'test-utils/factories/versionsPage/VersionsPageCreationFactories.js';
import {VersionsPageAdditionalPropsFactory} from 'test-utils/factories/versionsPage/VersionsPageFactories.js';
+import {cloneAndSet} from 'test-utils/Util.js';
describe('Versions Page Module Tests', () => {
@@ -45,7 +47,15 @@ describe('Versions Page Module Tests', () => {
userInfo: 'user123'
},
versionsPage: {
- permissions: {},
+ permissions: {
+ contributors: [],
+ owner: {
+ userId: 'fgfgfg',
+ permission: 'Owner',
+ fullName: 'Test User',
+ role: 'Test ROLE'
+ }
+ },
versionsList: {versions: []},
versionCreation: {}
}
@@ -71,7 +81,7 @@ describe('Versions Page Module Tests', () => {
const additionalProps = VersionsPageAdditionalPropsFactory.build();
- const props = Object.assign({}, mapStateToProps(state), mapActionsToProps(dispatch, additionalProps));
+ const props = {...mapStateToProps(state), ...mapActionsToProps(dispatch, additionalProps)};
const renderer = new ShallowRenderer();
renderer.render(<VersionsPageView {...props} />);
@@ -79,6 +89,23 @@ describe('Versions Page Module Tests', () => {
expect(renderedOutput).toBeTruthy();
});
+ /**
+ * turn on when ARCHIVE_ITEM feature toggle will be removed in VersionPage.jsx
+ */
+ // it('archive btn test', () => {
+
+ // const store = storeCreator();
+ // const dispatch = store.dispatch;
+
+ // const additionalProps = VersionsPageAdditionalPropsFactory.build();
+ // const props = {...mapStateToProps(state), ...mapActionsToProps(dispatch, additionalProps)};
+ // const wrapper = mount(<Provider store={store}><VersionsPageView {...props}/></Provider>);
+ // const depricateBtn = wrapper.find('.depricate-btn');
+ // expect(depricateBtn).toBeTruthy();
+ // expect(depricateBtn.text()).toBe('ARCHIVE');
+ // });
+
+
});