Files
Bonsai-webapp/src/app/menu/menu.spec.ts
T
2026-05-23 20:18:18 +02:00

34 lines
969 B
TypeScript

import { ComponentFixture, TestBed } from '@angular/core/testing';
import { provideRouter } from '@angular/router';
import { Menu } from './menu';
describe('Menu', () => {
let component: Menu;
let fixture: ComponentFixture<Menu>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [Menu],
providers: [provideRouter([])],
}).compileComponents();
fixture = TestBed.createComponent(Menu);
component = fixture.componentInstance;
await fixture.whenStable();
});
it('should create', () => {
expect(component).toBeTruthy();
});
it('should have three menu items', () => {
const items = (component as any).menuItems as { label: string; path: string }[];
expect(items.length).toBe(3);
});
it('should contain Issues link', () => {
const items = (component as any).menuItems as { label: string; path: string }[];
expect(items.some((i) => i.path === '/issues')).toBe(true);
});
});