ui support for archive items
Issue-ID: SDC-1088
Change-Id: I836e4896a8ec6bb065f9d2571f514916ccf6759f
Signed-off-by: svishnev <shlomo-stanisla.vishnevetskiy@amdocs.com>
diff --git a/openecomp-ui/test/versionsPage/VersionsPage.test.js b/openecomp-ui/test/versionsPage/VersionsPage.test.js
index 61e93cb..fd7659e 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 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 @@
userInfo: 'user123'
},
versionsPage: {
- permissions: {},
+ permissions: {
+ contributors: [],
+ owner: {
+ userId: 'fgfgfg',
+ permission: 'Owner',
+ fullName: 'Test User',
+ role: 'Test ROLE'
+ }
+ },
versionsList: {versions: []},
versionCreation: {}
}
@@ -71,7 +81,7 @@
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 @@
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');
+ // });
+
+
});