Commit 7e1b5931 authored by François Agneray's avatar François Agneray
Browse files

Ajout du test mission-list-table component

parent 21192ad4
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
RouterTestingModule
],
declarations: [
AppComponent
],
}).compileComponents();
});
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
it(`should have as title 'client'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('client');
});
it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('.content span')?.textContent).toContain('client app is running!');
});
});
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { MissionListTableComponent } from "./mission-list-table.component";
describe('Test du component MissionListTableComponent', () => {
let component: MissionListTableComponent;
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [
MissionListTableComponent
],
imports: [
RouterTestingModule
]
}).compileComponents();
const fixture = TestBed.createComponent(MissionListTableComponent);
component = fixture.componentInstance;
});
it('should create the component', () => {
expect(component).toBeTruthy();
});
it('#getFullNameByIdAgent(idAgent) should return agent full name', () => {
component.agents.push({
id_agent: 5,
firstname: 'Mickey',
lastname: 'Mouse',
status: 'Chercheur',
cap: 1
});
expect(component.getFullNameByIdAgent(5)).toEqual('Mickey Mouse');
});
});
\ No newline at end of file
Supports Markdown
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