test au vert
This commit is contained in:
@@ -1,14 +1,32 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ProjectListComponent } from './project-list.component';
|
||||
import { ProjectRepository } from '@app/domain/projects/project.repository';
|
||||
import { of } from 'rxjs';
|
||||
import { Project } from '@app/domain/projects/project.model';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { PROJECT_REPOSITORY_TOKEN } from '@app/infrastructure/projects/project-repository.token';
|
||||
|
||||
describe('ProjectListComponent', () => {
|
||||
let component: ProjectListComponent;
|
||||
let fixture: ComponentFixture<ProjectListComponent>;
|
||||
|
||||
let mockProjectRepository: jest.Mocked<ProjectRepository>;
|
||||
|
||||
beforeEach(async () => {
|
||||
mockProjectRepository = {
|
||||
create: jest.fn().mockReturnValue(of({} as Project)),
|
||||
list: jest.fn().mockReturnValue(of([])),
|
||||
get: jest.fn().mockReturnValue(of({} as Project)),
|
||||
update: jest.fn().mockReturnValue(of({} as Project)),
|
||||
};
|
||||
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [ProjectListComponent],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
{ provide: PROJECT_REPOSITORY_TOKEN, useValue: mockProjectRepository },
|
||||
],
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ProjectListComponent);
|
||||
|
||||
Reference in New Issue
Block a user