Ajout des tests

This commit is contained in:
2026-05-23 20:18:18 +02:00
parent 5b5edbb3da
commit 80f8b56ec4
10 changed files with 1222 additions and 9 deletions
+12 -1
View File
@@ -1,5 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { provideRouter } from '@angular/router';
import { Menu } from './menu';
describe('Menu', () => {
@@ -9,6 +9,7 @@ describe('Menu', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [Menu],
providers: [provideRouter([])],
}).compileComponents();
fixture = TestBed.createComponent(Menu);
@@ -19,4 +20,14 @@ describe('Menu', () => {
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);
});
});