Skip to content

Commit

Permalink
fix(admin): fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
pYassine committed Dec 20, 2023
1 parent 9b447a1 commit 1dc7ee7
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/portail-admins/src/app/guards/auth-guard.spec.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import { APP_BASE_HREF } from "@angular/common";
import { HttpClientTestingModule } from "@angular/common/http/testing";
import { inject, TestBed } from "@angular/core/testing";
import {
ActivatedRouteSnapshot,
Router,
RouterStateSnapshot,
} from "@angular/router";
import { ActivatedRouteSnapshot, RouterStateSnapshot } from "@angular/router";
import { RouterTestingModule } from "@angular/router/testing";
import { AdminAuthService } from "../modules/admin-auth/services/admin-auth.service";
import { AuthGuard } from "./auth-guard";

describe("AuthGuard", () => {
let authGuard: AuthGuard;
let router: Router;

let authService: AdminAuthService;

beforeEach(() => {
Expand All @@ -39,15 +35,14 @@ describe("AuthGuard", () => {

authService = TestBed.inject(AdminAuthService);
authGuard = TestBed.inject(AuthGuard);
router = TestBed.inject(Router);
});

it("should be created", inject([AuthGuard], (service: AuthGuard) => {
expect(service).toBeTruthy();
}));

it("CanActivate", () => {
authGuard = new AuthGuard(router, authService);
authGuard = new AuthGuard(authService);
expect(authGuard).toBeTruthy();
});
});

0 comments on commit 1dc7ee7

Please sign in to comment.