diff --git a/src/app/cv-redirect.guard.spec.ts b/src/app/cv-redirect.guard.spec.ts index 225f559..fb44bbd 100644 --- a/src/app/cv-redirect.guard.spec.ts +++ b/src/app/cv-redirect.guard.spec.ts @@ -1,11 +1,13 @@ import { TestBed } from '@angular/core/testing'; -import { CanActivateFn } from '@angular/router'; +import { CanActivateFn, Router } from '@angular/router'; -import { cvRedirectGuard } from './cv-redirect.guard'; +import { CvRedirectGuard } from './cv-redirect.guard'; describe('cvRedirectGuard', () => { - const executeGuard: CanActivateFn = (...guardParameters) => - TestBed.runInInjectionContext(() => cvRedirectGuard(...guardParameters)); + const executeGuard: CanActivateFn = (...guardParameters) => + TestBed.runInInjectionContext( + () => new CvRedirectGuard(TestBed.inject(Router)) // Pass the Router instance + ).canActivate(...guardParameters); beforeEach(() => { TestBed.configureTestingModule({});