feat : page not found
This commit is contained in:
@@ -6,11 +6,15 @@ import { of } from 'rxjs';
|
||||
import { ProfileRepository } from '@app/domain/profiles/profile.repository';
|
||||
import { PROFILE_REPOSITORY_TOKEN } from '@app/infrastructure/profiles/profile-repository.token';
|
||||
import { Profile } from '@app/domain/profiles/profile.model';
|
||||
import { SECTOR_REPOSITORY_TOKEN } from '@app/infrastructure/sectors/sector-repository.token';
|
||||
import { SectorRepository } from '@app/domain/sectors/sector.repository';
|
||||
import { Sector } from '@app/domain/sectors/sector.model';
|
||||
|
||||
describe('ProfileListComponent', () => {
|
||||
let component: ProfileListComponent;
|
||||
let fixture: ComponentFixture<ProfileListComponent>;
|
||||
let mockProfileRepository: jest.Mocked<ProfileRepository>;
|
||||
let mockProfileRepository: jest.Mocked<Partial<ProfileRepository>>;
|
||||
let mockSectorRepository: jest.Mocked<Partial<SectorRepository>>;
|
||||
|
||||
beforeEach(async () => {
|
||||
mockProfileRepository = {
|
||||
@@ -20,11 +24,17 @@ describe('ProfileListComponent', () => {
|
||||
update: jest.fn().mockReturnValue(of({} as Profile)),
|
||||
};
|
||||
|
||||
mockSectorRepository = {
|
||||
list: jest.fn().mockReturnValue(of([])),
|
||||
getOne: jest.fn().mockReturnValue(of({} as Sector)),
|
||||
};
|
||||
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [ProfileListComponent],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
{ provide: PROFILE_REPOSITORY_TOKEN, useValue: mockProfileRepository },
|
||||
{ provide: SECTOR_REPOSITORY_TOKEN, useValue: mockSectorRepository },
|
||||
],
|
||||
}).compileComponents();
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import { UntilDestroy } from '@ngneat/until-destroy';
|
||||
import { ProfileFacade } from '@app/ui/profiles/profile.facade';
|
||||
import { LoadingComponent } from '@app/shared/components/loading/loading.component';
|
||||
import { Router } from '@angular/router';
|
||||
import { SearchFilters } from '@app/domain/search-filters';
|
||||
|
||||
@Component({
|
||||
selector: 'app-profile-list',
|
||||
@@ -26,7 +27,8 @@ export class ProfileListComponent implements OnInit {
|
||||
this.facade.load();
|
||||
}
|
||||
|
||||
showNewQuery(newQuery: string) {
|
||||
this.router.navigate(['/profiles'], { queryParams: { search: newQuery } });
|
||||
showNewQuery(filters: SearchFilters) {
|
||||
console.log(filters);
|
||||
this.router.navigate(['/profiles'], { queryParams: { search: filters.search } });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user