Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-FAIR
Commits
cf2e3269
Commit
cf2e3269
authored
Dec 21, 2020
by
Markus Scheidgen
Browse files
Added (commented) main menue test.
parent
f70bf6aa
Pipeline
#89971
passed with stages
in 24 minutes and 34 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
gui/babel.config.json
View file @
cf2e3269
{
"presets"
:
[
"@babel/react"
,
"@babel/env"
]
"presets"
:
[
"@babel/react"
,
"@babel/env"
,
"next/babel"
,
{
"targets"
:
{
"node"
:
"current"
}
}
]
}
\ No newline at end of file
gui/src/components/nav/MainMenu.js
View file @
cf2e3269
...
...
@@ -175,7 +175,7 @@ export default function MainMenu() {
<
/MenuBarMenu
>
<
MenuBarMenu
name
=
"
about
"
route
=
"
/
"
icon
=
{
<
AboutIcon
/>
}
>
<
MenuBarItem
label
=
"
Information
"
name
=
"
about
"
route
=
"
/
"
label
=
"
Information
"
name
=
"
info
"
route
=
"
/
"
tooltip
=
"
About the NOMAD Repository and Archive
"
/>
<
MenuBarItem
...
...
gui/src/components/nav/MainMenu.spec.js
0 → 100644
View file @
cf2e3269
/*
* Copyright The NOMAD Authors.
*
* This file is part of NOMAD. See https://nomad-lab.eu for further info.
*
* 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.
*/
// import React from 'react'
import
'
regenerator-runtime/runtime
'
// import { toBeInTheDocument } from '@testing-library/jest-dom'
// import { render, screen, within } from '@testing-library/react'
// import { MemoryRouter } from 'react-router-dom'
// import MainMenu from './MainMenu'
// import { allRoutes as routes } from './Routes'
// expect.extend({ toBeInTheDocument })
describe
(
'
<MainMenu />
'
,
()
=>
{
it
(
'
renders menu items for all nav paths
'
,
()
=>
{
// render(<MemoryRouter>
// <MainMenu />
// </MemoryRouter>)
// Object.keys(routes).forEach(key => {
// const route = routes[key]
// if (route.navPath) {
// let item = screen
// const path = route.navPath.split('/')
// for (let i = 0; i < path.length; i++) {
// const itemId = path[i]
// const element = item.getByTestId(itemId)
// expect(element).toBeInTheDocument()
// item = within(element)
// }
// }
// })
})
})
gui/src/components/nav/MenuBar.js
View file @
cf2e3269
...
...
@@ -109,6 +109,7 @@ export const MenuBarItem = React.forwardRef(({name, label, tooltip, route, href,
}
const
item
=
<
MuiMenuItem
data
-
testid
=
{
name
}
ref
=
{
ref
}
dense
classes
=
{{
root
:
selected
?
classes
.
selected
:
undefined
}}
...
...
@@ -185,6 +186,7 @@ export function MenuBarMenu({name, label, children}) {
<
/Button
>
<
/ClickAwayListener
>
<
MuiMenu
data
-
testid
=
{
name
}
PopoverClasses
=
{{
root
:
classes
.
menuPopover
,
paper
:
classes
.
menuPaper
}}
elevation
=
{
1
}
anchorEl
=
{
anchorEl
}
...
...
gui/src/components/nav/Routes.js
View file @
cf2e3269
...
...
@@ -130,7 +130,7 @@ export const routes = {
exact
:
true
,
path
:
'
/
'
,
appBarTitle
:
'
About, Documentation, Getting Help
'
,
navPath
:
'
about/
about
'
,
navPath
:
'
about/
info
'
,
component
:
About
}
}
...
...
gui/src/setupTests.js
0 → 100644
View file @
cf2e3269
global
.
nomadEnv
=
{
'
keycloakBase
'
:
'
https://nomad-lab.eu/fairdi/keycloak/auth/
'
,
'
keycloakRealm
'
:
'
fairdi_nomad_test
'
,
'
keycloakClientId
'
:
'
nomad_gui_dev
'
,
'
appBase
'
:
'
http://nomad-lab.eu/prod/rae/beta
'
,
'
debug
'
:
false
,
'
matomoEnabled
'
:
false
,
'
matomoUrl
'
:
'
https://nomad-lab.eu/fairdi/stat
'
,
'
matomoSiteId
'
:
'
2
'
,
'
version
'
:
{
'
label
'
:
'
0.9.8
'
,
'
isBeta
'
:
false
,
'
isTest
'
:
true
,
'
usesBetaData
'
:
true
,
'
officialUrl
'
:
'
https://nomad-lab.eu/prod/rae/gui
'
},
'
encyclopediaEnabled
'
:
true
,
'
aitoolkitEnabled
'
:
true
,
'
oasis
'
:
false
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment