diff options
Diffstat (limited to 'openecomp-ui/test/nfvo-components/editor')
-rw-r--r-- | openecomp-ui/test/nfvo-components/editor/TabulatedEditor.test.js | 76 |
1 files changed, 44 insertions, 32 deletions
diff --git a/openecomp-ui/test/nfvo-components/editor/TabulatedEditor.test.js b/openecomp-ui/test/nfvo-components/editor/TabulatedEditor.test.js index 0738bbb03d..cc694398ec 100644 --- a/openecomp-ui/test/nfvo-components/editor/TabulatedEditor.test.js +++ b/openecomp-ui/test/nfvo-components/editor/TabulatedEditor.test.js @@ -14,43 +14,55 @@ * limitations under the License. */ - import React from 'react'; 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'; - -describe('Tabulated Editor test: ', function () { - const store = storeCreator(); - it('basic view test', () => { - const renderer = new ShallowRenderer(); - renderer.render( - <Provider store={store}><TabulatedEditor><button>test</button></TabulatedEditor></Provider> - ); - let renderedOutput = renderer.getRenderOutput(); - expect(renderedOutput).toBeTruthy(); - - }); +import { storeCreator } from 'sdc-app/AppStore.js'; - it('handle func test', () => { - let props = { - navigationBarProps: { - groups: [], - onNavigationItemClick: ()=>{} - }, - versionControllerProps: { - isCheckedOut: false, - version: {id: '0.1', label: '0.1'}, - viewableVersions: [{id: '0.1', label: '0.1'}], - itemPermission: {isCertified: false, isCollaborator: true, isDirty: false}, - onSubmit: ()=>{}, - onRevert: ()=>{} - } - }; - const view = TestUtils.renderIntoDocument(<Provider store={store}><TabulatedEditor {...props}><button>test</button></TabulatedEditor></Provider>); - expect(view).toBeTruthy(); - }); +describe('Tabulated Editor test: ', function() { + const store = storeCreator(); + it('basic view test', () => { + const renderer = new ShallowRenderer(); + renderer.render( + <Provider store={store}> + <TabulatedEditor> + <button>test</button> + </TabulatedEditor> + </Provider> + ); + let renderedOutput = renderer.getRenderOutput(); + expect(renderedOutput).toBeTruthy(); + }); + it('handle func test', () => { + let props = { + navigationBarProps: { + groups: [], + onNavigationItemClick: () => {}, + activeItemId: 'test' + }, + versionControllerProps: { + isCheckedOut: false, + version: { id: '0.1', label: '0.1' }, + viewableVersions: [{ id: '0.1', label: '0.1' }], + itemPermission: { + isCertified: false, + isCollaborator: true, + isDirty: false + }, + onSubmit: () => {}, + onRevert: () => {} + } + }; + const view = TestUtils.renderIntoDocument( + <Provider store={store}> + <TabulatedEditor {...props}> + <button>test</button> + </TabulatedEditor> + </Provider> + ); + expect(view).toBeTruthy(); + }); }); |