Ajout des tests
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user