Commit 9804594c authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰

[#164] Written test for menu items visibility

parent dcffce99
......@@ -40,10 +40,23 @@ describe('AppComponent', () => {
expect(app).toBeTruthy()
})
it(`should have as title 'Stork'`, () => {
it(`should have necessary menu items`, () => {
// This test checks if the menu items are there. It is basic for now.
// @todo: extend this to check if the menu items are shown or hidden (e.g. grafana is hidden by default)
const fixture = TestBed.createComponent(AppComponent)
const app = fixture.debugElement.componentInstance
expect(app.title).toEqual('Stork')
// This is the list of menu elements that are expected to be there.
var expMenuItems = [ "DHCP", "Dashboard", "Host Reservations", "Subnets", "Shared Networks", "Services",
"Kea Apps", "BIND 9 Apps", "Machines", "Grafana",
"Monitoring", "Events",
"Configuration", "Users", "Settings",
"Help", "Stork Manual", "Stork API Docs (SwaggerUI)", "Stork API Docs (Redoc)", "BIND 9 Manual", "Kea Manual" ]
for (var i = 0; i < expMenuItems.length; i++) {
expect(app.getMenuItem(expMenuItems[i])).toBeTruthy()
console.log("Checked existence of " + expMenuItems[i] + " menu item.")
}
})
it('should render title', () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment