diff options
author | 2022-03-14 11:29:25 +0000 | |
---|---|---|
committer | 2022-03-14 17:16:31 +0000 | |
commit | 1e27cabdaf7c89a2c7381c8a46697be007778445 (patch) | |
tree | 122ebf8705508f8ffea8594ba81cfe2a4fb6326a /gui-clamp/ui-react/src/components/menu | |
parent | 5d87357d69ec81962fd6128a8aa12086b97f199f (diff) |
Added more unit tests for overall coverage
Issue-ID: POLICY-3932
Change-Id: I481f5da35047da7a790f02368cc915d5e1a9e04d
Signed-off-by: brunomilitzer <bruno.militzer@est.tech>
Diffstat (limited to 'gui-clamp/ui-react/src/components/menu')
3 files changed, 29 insertions, 69 deletions
diff --git a/gui-clamp/ui-react/src/components/menu/MenuBar.js b/gui-clamp/ui-react/src/components/menu/MenuBar.js index 769edb0..5ac5f88 100644 --- a/gui-clamp/ui-react/src/components/menu/MenuBar.js +++ b/gui-clamp/ui-react/src/components/menu/MenuBar.js @@ -37,24 +37,20 @@ const StyledLink = styled(Link)` text-align: inherit; white-space: nowrap; border: 0; - :hover { text-decoration: none; background-color: ${ props => props.theme.menuHighlightedBackgroundColor }; color: ${ props => props.theme.menuHighlightedFontColor }; - } -`; + }`; const StyledNavLink = styled(Nav.Link)` color: ${ props => props.theme.menuFontColor }; background-color: ${ props => props.theme.menuBackgroundColor }; font-weight: normal; padding: .25rem 1.5rem; - :hover { background-color: ${ props => props.theme.menuHighlightedBackgroundColor }; color: ${ props => props.theme.menuHighlightedFontColor }; - } -`; + }`; const StyledNavDropdown = styled(NavDropdown)` color: ${ props => props.theme.menuFontColor }; @@ -67,8 +63,7 @@ const StyledNavDropdown = styled(NavDropdown)` :hover { font-weight: bold; } - } -`; + }`; export default class MenuBar extends React.Component { state = { diff --git a/gui-clamp/ui-react/src/components/menu/MenuBar.test.js b/gui-clamp/ui-react/src/components/menu/MenuBar.test.js index bd55687..df1a17a 100644 --- a/gui-clamp/ui-react/src/components/menu/MenuBar.test.js +++ b/gui-clamp/ui-react/src/components/menu/MenuBar.test.js @@ -72,7 +72,7 @@ describe('Verify MenuBar', () => { it('Finds POLICY Framework Menu', () => { const component = shallow(<MenuBar />).childAt(4).dive(); - expect(component.find({ tile: 'TOSCA Control Loop' })); + expect(component.find({ tile: 'TOSCA Automation Composition' })); }); it('Finds POLICY Framework Menu', () => { @@ -84,4 +84,9 @@ describe('Verify MenuBar', () => { const component = shallow(<MenuBar />); expect(component.find('Styled(NavLink)').length).toEqual(2); }); + + it('Finds StyledNavDropdown', () => { + const component = shallow(<MenuBar />); + expect(component.find('Styled(NavDropdown)').length).toEqual(6); + }); }); diff --git a/gui-clamp/ui-react/src/components/menu/__snapshots__/MenuBar.test.js.snap b/gui-clamp/ui-react/src/components/menu/__snapshots__/MenuBar.test.js.snap index 86ae72d..336628d 100644 --- a/gui-clamp/ui-react/src/components/menu/__snapshots__/MenuBar.test.js.snap +++ b/gui-clamp/ui-react/src/components/menu/__snapshots__/MenuBar.test.js.snap @@ -31,7 +31,6 @@ exports[`Verify MenuBar Test the render method 1`] = ` text-align: inherit; white-space: nowrap; border: 0; - :hover { text-decoration: none; background-color: ", @@ -40,8 +39,7 @@ exports[`Verify MenuBar Test the render method 1`] = ` color: ", [Function], "; - } -", + }", ], "staticRulesId": "", }, @@ -100,7 +98,6 @@ exports[`Verify MenuBar Test the render method 1`] = ` text-align: inherit; white-space: nowrap; border: 0; - :hover { text-decoration: none; background-color: ", @@ -109,8 +106,7 @@ exports[`Verify MenuBar Test the render method 1`] = ` color: ", [Function], "; - } -", + }", ], "staticRulesId": "", }, @@ -168,7 +164,6 @@ exports[`Verify MenuBar Test the render method 1`] = ` text-align: inherit; white-space: nowrap; border: 0; - :hover { text-decoration: none; background-color: ", @@ -177,8 +172,7 @@ exports[`Verify MenuBar Test the render method 1`] = ` color: ", [Function], "; - } -", + }", ], "staticRulesId": "", }, @@ -237,7 +231,6 @@ exports[`Verify MenuBar Test the render method 1`] = ` text-align: inherit; white-space: nowrap; border: 0; - :hover { text-decoration: none; background-color: ", @@ -246,8 +239,7 @@ exports[`Verify MenuBar Test the render method 1`] = ` color: ", [Function], "; - } -", + }", ], "staticRulesId": "", }, @@ -302,7 +294,6 @@ exports[`Verify MenuBar Test the render method 1`] = ` text-align: inherit; white-space: nowrap; border: 0; - :hover { text-decoration: none; background-color: ", @@ -311,8 +302,7 @@ exports[`Verify MenuBar Test the render method 1`] = ` color: ", [Function], "; - } -", + }", ], "staticRulesId": "", }, @@ -367,7 +357,6 @@ exports[`Verify MenuBar Test the render method 1`] = ` text-align: inherit; white-space: nowrap; border: 0; - :hover { text-decoration: none; background-color: ", @@ -376,8 +365,7 @@ exports[`Verify MenuBar Test the render method 1`] = ` color: ", [Function], "; - } -", + }", ], "staticRulesId": "", }, @@ -432,7 +420,6 @@ exports[`Verify MenuBar Test the render method 1`] = ` text-align: inherit; white-space: nowrap; border: 0; - :hover { text-decoration: none; background-color: ", @@ -441,8 +428,7 @@ exports[`Verify MenuBar Test the render method 1`] = ` color: ", [Function], "; - } -", + }", ], "staticRulesId": "", }, @@ -500,7 +486,6 @@ exports[`Verify MenuBar Test the render method 1`] = ` text-align: inherit; white-space: nowrap; border: 0; - :hover { text-decoration: none; background-color: ", @@ -509,8 +494,7 @@ exports[`Verify MenuBar Test the render method 1`] = ` color: ", [Function], "; - } -", + }", ], "staticRulesId": "", }, @@ -565,7 +549,6 @@ exports[`Verify MenuBar Test the render method 1`] = ` text-align: inherit; white-space: nowrap; border: 0; - :hover { text-decoration: none; background-color: ", @@ -574,8 +557,7 @@ exports[`Verify MenuBar Test the render method 1`] = ` color: ", [Function], "; - } -", + }", ], "staticRulesId": "", }, @@ -634,7 +616,6 @@ exports[`Verify MenuBar Test the render method 1`] = ` text-align: inherit; white-space: nowrap; border: 0; - :hover { text-decoration: none; background-color: ", @@ -643,8 +624,7 @@ exports[`Verify MenuBar Test the render method 1`] = ` color: ", [Function], "; - } -", + }", ], "staticRulesId": "", }, @@ -699,7 +679,6 @@ exports[`Verify MenuBar Test the render method 1`] = ` text-align: inherit; white-space: nowrap; border: 0; - :hover { text-decoration: none; background-color: ", @@ -708,8 +687,7 @@ exports[`Verify MenuBar Test the render method 1`] = ` color: ", [Function], "; - } -", + }", ], "staticRulesId": "", }, @@ -764,7 +742,6 @@ exports[`Verify MenuBar Test the render method 1`] = ` text-align: inherit; white-space: nowrap; border: 0; - :hover { text-decoration: none; background-color: ", @@ -773,8 +750,7 @@ exports[`Verify MenuBar Test the render method 1`] = ` color: ", [Function], "; - } -", + }", ], "staticRulesId": "", }, @@ -829,7 +805,6 @@ exports[`Verify MenuBar Test the render method 1`] = ` text-align: inherit; white-space: nowrap; border: 0; - :hover { text-decoration: none; background-color: ", @@ -838,8 +813,7 @@ exports[`Verify MenuBar Test the render method 1`] = ` color: ", [Function], "; - } -", + }", ], "staticRulesId": "", }, @@ -897,7 +871,6 @@ exports[`Verify MenuBar Test the render method 1`] = ` text-align: inherit; white-space: nowrap; border: 0; - :hover { text-decoration: none; background-color: ", @@ -906,8 +879,7 @@ exports[`Verify MenuBar Test the render method 1`] = ` color: ", [Function], "; - } -", + }", ], "staticRulesId": "", }, @@ -962,7 +934,6 @@ exports[`Verify MenuBar Test the render method 1`] = ` text-align: inherit; white-space: nowrap; border: 0; - :hover { text-decoration: none; background-color: ", @@ -971,8 +942,7 @@ exports[`Verify MenuBar Test the render method 1`] = ` color: ", [Function], "; - } -", + }", ], "staticRulesId": "", }, @@ -1036,7 +1006,6 @@ exports[`Verify MenuBar Test the render method 1`] = ` text-align: inherit; white-space: nowrap; border: 0; - :hover { text-decoration: none; background-color: ", @@ -1045,8 +1014,7 @@ exports[`Verify MenuBar Test the render method 1`] = ` color: ", [Function], "; - } -", + }", ], "staticRulesId": "", }, @@ -1109,7 +1077,6 @@ exports[`Verify MenuBar Test the render method 1`] = ` text-align: inherit; white-space: nowrap; border: 0; - :hover { text-decoration: none; background-color: ", @@ -1118,8 +1085,7 @@ exports[`Verify MenuBar Test the render method 1`] = ` color: ", [Function], "; - } -", + }", ], "staticRulesId": "", }, @@ -1174,7 +1140,6 @@ exports[`Verify MenuBar Test the render method 1`] = ` text-align: inherit; white-space: nowrap; border: 0; - :hover { text-decoration: none; background-color: ", @@ -1183,8 +1148,7 @@ exports[`Verify MenuBar Test the render method 1`] = ` color: ", [Function], "; - } -", + }", ], "staticRulesId": "", }, @@ -1239,7 +1203,6 @@ exports[`Verify MenuBar Test the render method 1`] = ` text-align: inherit; white-space: nowrap; border: 0; - :hover { text-decoration: none; background-color: ", @@ -1248,8 +1211,7 @@ exports[`Verify MenuBar Test the render method 1`] = ` color: ", [Function], "; - } -", + }", ], "staticRulesId": "", }, @@ -1319,7 +1281,6 @@ exports[`Verify MenuBar Test the render method 1`] = ` text-align: inherit; white-space: nowrap; border: 0; - :hover { text-decoration: none; background-color: ", @@ -1328,8 +1289,7 @@ exports[`Verify MenuBar Test the render method 1`] = ` color: ", [Function], "; - } -", + }", ], "staticRulesId": "", }, |