diff options
Diffstat (limited to 'ui-react/src/components/menu')
-rw-r--r-- | ui-react/src/components/menu/MenuBar.test.js | 46 | ||||
-rw-r--r-- | ui-react/src/components/menu/__snapshots__/MenuBar.test.js.snap | 594 |
2 files changed, 640 insertions, 0 deletions
diff --git a/ui-react/src/components/menu/MenuBar.test.js b/ui-react/src/components/menu/MenuBar.test.js new file mode 100644 index 000000000..3e96dbf38 --- /dev/null +++ b/ui-react/src/components/menu/MenuBar.test.js @@ -0,0 +1,46 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP CLAMP + * ================================================================================ + * Copyright (C) 2019 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END============================================ + * =================================================================== + * + */ +import React from 'react'; +import { shallow } from 'enzyme'; +import MenuBar from './MenuBar'; + +describe('Verify MenuBar', () => { + + it('Test the render method', () => { + const component = shallow(<MenuBar />) + + expect(component).toMatchSnapshot(); + }); + + it('Update loopName', () => { + const component = shallow(<MenuBar />) + component.setProps({ loopName: "newLoop" }); + expect(component.state('disabled')).toBe(false); + }); + + it('Default loopName', () => { + const component = shallow(<MenuBar />) + component.setProps({ loopName: "Empty (NO loop loaded yet)" }); + expect(component.state('disabled')).toBe(true); + }); +}); diff --git a/ui-react/src/components/menu/__snapshots__/MenuBar.test.js.snap b/ui-react/src/components/menu/__snapshots__/MenuBar.test.js.snap new file mode 100644 index 000000000..3ee733463 --- /dev/null +++ b/ui-react/src/components/menu/__snapshots__/MenuBar.test.js.snap @@ -0,0 +1,594 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Verify MenuBar Test the render method 1`] = ` +<NavbarCollapse> + <Styled(NavDropdown) + title="Closed Loop" + > + <DropdownItem + as={ + Object { + "$$typeof": Symbol(react.forward_ref), + "attrs": Array [], + "componentStyle": ComponentStyle { + "componentId": "sc-kpOJdX", + "isStatic": false, + "rules": Array [ + " + color: ", + [Function], + "; + background-color: ", + [Function], + "; + font-weight: normal; + display: block; + width: 100%; + padding: .25rem 1.5rem; + clear: both; + text-align: inherit; + white-space: nowrap; + border: 0; + :hover { + text-decoration: none; + background-color: ", + [Function], + "; + color: ", + [Function], + "; + } +", + ], + }, + "displayName": "Styled(Link)", + "foldedComponentIds": Array [], + "render": [Function], + "styledComponentId": "sc-kpOJdX", + "target": [Function], + "toString": [Function], + "warnTooManyClasses": [Function], + "withComponent": [Function], + } + } + disabled={false} + to="/openLoop" + > + Open CL + </DropdownItem> + <DropdownItem + as={ + Object { + "$$typeof": Symbol(react.forward_ref), + "attrs": Array [], + "componentStyle": ComponentStyle { + "componentId": "sc-kpOJdX", + "isStatic": false, + "rules": Array [ + " + color: ", + [Function], + "; + background-color: ", + [Function], + "; + font-weight: normal; + display: block; + width: 100%; + padding: .25rem 1.5rem; + clear: both; + text-align: inherit; + white-space: nowrap; + border: 0; + :hover { + text-decoration: none; + background-color: ", + [Function], + "; + color: ", + [Function], + "; + } +", + ], + }, + "displayName": "Styled(Link)", + "foldedComponentIds": Array [], + "render": [Function], + "styledComponentId": "sc-kpOJdX", + "target": [Function], + "toString": [Function], + "warnTooManyClasses": [Function], + "withComponent": [Function], + } + } + disabled={true} + to="/loopProperties" + > + Properties CL + </DropdownItem> + <DropdownItem + as={ + Object { + "$$typeof": Symbol(react.forward_ref), + "attrs": Array [], + "componentStyle": ComponentStyle { + "componentId": "sc-kpOJdX", + "isStatic": false, + "rules": Array [ + " + color: ", + [Function], + "; + background-color: ", + [Function], + "; + font-weight: normal; + display: block; + width: 100%; + padding: .25rem 1.5rem; + clear: both; + text-align: inherit; + white-space: nowrap; + border: 0; + :hover { + text-decoration: none; + background-color: ", + [Function], + "; + color: ", + [Function], + "; + } +", + ], + }, + "displayName": "Styled(Link)", + "foldedComponentIds": Array [], + "render": [Function], + "styledComponentId": "sc-kpOJdX", + "target": [Function], + "toString": [Function], + "warnTooManyClasses": [Function], + "withComponent": [Function], + } + } + disabled={true} + to="/closeLoop" + > + Close Model + </DropdownItem> + </Styled(NavDropdown)> + <Styled(NavDropdown) + title="Manage" + > + <DropdownItem + as={ + Object { + "$$typeof": Symbol(react.forward_ref), + "attrs": Array [], + "componentStyle": ComponentStyle { + "componentId": "sc-kpOJdX", + "isStatic": false, + "rules": Array [ + " + color: ", + [Function], + "; + background-color: ", + [Function], + "; + font-weight: normal; + display: block; + width: 100%; + padding: .25rem 1.5rem; + clear: both; + text-align: inherit; + white-space: nowrap; + border: 0; + :hover { + text-decoration: none; + background-color: ", + [Function], + "; + color: ", + [Function], + "; + } +", + ], + }, + "displayName": "Styled(Link)", + "foldedComponentIds": Array [], + "render": [Function], + "styledComponentId": "sc-kpOJdX", + "target": [Function], + "toString": [Function], + "warnTooManyClasses": [Function], + "withComponent": [Function], + } + } + disabled={true} + to="/submit" + > + Submit + </DropdownItem> + <DropdownItem + as={ + Object { + "$$typeof": Symbol(react.forward_ref), + "attrs": Array [], + "componentStyle": ComponentStyle { + "componentId": "sc-kpOJdX", + "isStatic": false, + "rules": Array [ + " + color: ", + [Function], + "; + background-color: ", + [Function], + "; + font-weight: normal; + display: block; + width: 100%; + padding: .25rem 1.5rem; + clear: both; + text-align: inherit; + white-space: nowrap; + border: 0; + :hover { + text-decoration: none; + background-color: ", + [Function], + "; + color: ", + [Function], + "; + } +", + ], + }, + "displayName": "Styled(Link)", + "foldedComponentIds": Array [], + "render": [Function], + "styledComponentId": "sc-kpOJdX", + "target": [Function], + "toString": [Function], + "warnTooManyClasses": [Function], + "withComponent": [Function], + } + } + disabled={true} + to="/stop" + > + Stop + </DropdownItem> + <DropdownItem + as={ + Object { + "$$typeof": Symbol(react.forward_ref), + "attrs": Array [], + "componentStyle": ComponentStyle { + "componentId": "sc-kpOJdX", + "isStatic": false, + "rules": Array [ + " + color: ", + [Function], + "; + background-color: ", + [Function], + "; + font-weight: normal; + display: block; + width: 100%; + padding: .25rem 1.5rem; + clear: both; + text-align: inherit; + white-space: nowrap; + border: 0; + :hover { + text-decoration: none; + background-color: ", + [Function], + "; + color: ", + [Function], + "; + } +", + ], + }, + "displayName": "Styled(Link)", + "foldedComponentIds": Array [], + "render": [Function], + "styledComponentId": "sc-kpOJdX", + "target": [Function], + "toString": [Function], + "warnTooManyClasses": [Function], + "withComponent": [Function], + } + } + disabled={true} + to="/restart" + > + Restart + </DropdownItem> + <DropdownItem + as={ + Object { + "$$typeof": Symbol(react.forward_ref), + "attrs": Array [], + "componentStyle": ComponentStyle { + "componentId": "sc-kpOJdX", + "isStatic": false, + "rules": Array [ + " + color: ", + [Function], + "; + background-color: ", + [Function], + "; + font-weight: normal; + display: block; + width: 100%; + padding: .25rem 1.5rem; + clear: both; + text-align: inherit; + white-space: nowrap; + border: 0; + :hover { + text-decoration: none; + background-color: ", + [Function], + "; + color: ", + [Function], + "; + } +", + ], + }, + "displayName": "Styled(Link)", + "foldedComponentIds": Array [], + "render": [Function], + "styledComponentId": "sc-kpOJdX", + "target": [Function], + "toString": [Function], + "warnTooManyClasses": [Function], + "withComponent": [Function], + } + } + disabled={true} + to="/delete" + > + Delete + </DropdownItem> + <DropdownItem + as={ + Object { + "$$typeof": Symbol(react.forward_ref), + "attrs": Array [], + "componentStyle": ComponentStyle { + "componentId": "sc-kpOJdX", + "isStatic": false, + "rules": Array [ + " + color: ", + [Function], + "; + background-color: ", + [Function], + "; + font-weight: normal; + display: block; + width: 100%; + padding: .25rem 1.5rem; + clear: both; + text-align: inherit; + white-space: nowrap; + border: 0; + :hover { + text-decoration: none; + background-color: ", + [Function], + "; + color: ", + [Function], + "; + } +", + ], + }, + "displayName": "Styled(Link)", + "foldedComponentIds": Array [], + "render": [Function], + "styledComponentId": "sc-kpOJdX", + "target": [Function], + "toString": [Function], + "warnTooManyClasses": [Function], + "withComponent": [Function], + } + } + disabled={true} + to="/deploy" + > + Deploy + </DropdownItem> + <DropdownItem + as={ + Object { + "$$typeof": Symbol(react.forward_ref), + "attrs": Array [], + "componentStyle": ComponentStyle { + "componentId": "sc-kpOJdX", + "isStatic": false, + "rules": Array [ + " + color: ", + [Function], + "; + background-color: ", + [Function], + "; + font-weight: normal; + display: block; + width: 100%; + padding: .25rem 1.5rem; + clear: both; + text-align: inherit; + white-space: nowrap; + border: 0; + :hover { + text-decoration: none; + background-color: ", + [Function], + "; + color: ", + [Function], + "; + } +", + ], + }, + "displayName": "Styled(Link)", + "foldedComponentIds": Array [], + "render": [Function], + "styledComponentId": "sc-kpOJdX", + "target": [Function], + "toString": [Function], + "warnTooManyClasses": [Function], + "withComponent": [Function], + } + } + disabled={true} + to="/undeploy" + > + UnDeploy + </DropdownItem> + </Styled(NavDropdown)> + <Styled(NavDropdown) + title="View" + > + <DropdownItem + as={ + Object { + "$$typeof": Symbol(react.forward_ref), + "attrs": Array [], + "componentStyle": ComponentStyle { + "componentId": "sc-kpOJdX", + "isStatic": false, + "rules": Array [ + " + color: ", + [Function], + "; + background-color: ", + [Function], + "; + font-weight: normal; + display: block; + width: 100%; + padding: .25rem 1.5rem; + clear: both; + text-align: inherit; + white-space: nowrap; + border: 0; + :hover { + text-decoration: none; + background-color: ", + [Function], + "; + color: ", + [Function], + "; + } +", + ], + }, + "displayName": "Styled(Link)", + "foldedComponentIds": Array [], + "render": [Function], + "styledComponentId": "sc-kpOJdX", + "target": [Function], + "toString": [Function], + "warnTooManyClasses": [Function], + "withComponent": [Function], + } + } + disabled={true} + to="/refreshStatus" + > + Refresh Status + </DropdownItem> + </Styled(NavDropdown)> + <Styled(NavDropdown) + title="Help" + > + <Styled(NavLink) + href="https://wiki.onap.org/" + target="_blank" + > + Wiki + </Styled(NavLink)> + <Styled(NavLink) + href="mailto:onap-discuss@lists.onap.org?subject=CLAMP&body=Please send us suggestions or feature enhancements or defect. If possible, please send us the steps to replicate any defect." + > + Contact Us + </Styled(NavLink)> + <DropdownItem + as={ + Object { + "$$typeof": Symbol(react.forward_ref), + "attrs": Array [], + "componentStyle": ComponentStyle { + "componentId": "sc-kpOJdX", + "isStatic": false, + "rules": Array [ + " + color: ", + [Function], + "; + background-color: ", + [Function], + "; + font-weight: normal; + display: block; + width: 100%; + padding: .25rem 1.5rem; + clear: both; + text-align: inherit; + white-space: nowrap; + border: 0; + :hover { + text-decoration: none; + background-color: ", + [Function], + "; + color: ", + [Function], + "; + } +", + ], + }, + "displayName": "Styled(Link)", + "foldedComponentIds": Array [], + "render": [Function], + "styledComponentId": "sc-kpOJdX", + "target": [Function], + "toString": [Function], + "warnTooManyClasses": [Function], + "withComponent": [Function], + } + } + disabled={false} + to="/userInfo" + > + User Info + </DropdownItem> + </Styled(NavDropdown)> +</NavbarCollapse> +`; |