Skip to content

Commit 87becfd

Browse files
committed
Adjusted unit tests
1 parent 94350a1 commit 87becfd

1 file changed

Lines changed: 1 addition & 17 deletions

File tree

src/app/shared/guards/non-admin.guard.spec.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
// import { TestBed } from '@angular/core/testing';
2-
// import { CanActivateFn } from '@angular/router';
3-
//
4-
// import { NonAdminGuard } from './non-admin.guard';
5-
//
6-
// xdescribe('nonAdminGuard', () => {
7-
// const executeGuard: CanActivateFn = (...guardParameters) => TestBed.runInInjectionContext(() => NonAdminGuard(...guardParameters));
8-
//
9-
// beforeEach(() => {
10-
// TestBed.configureTestingModule({});
11-
// });
12-
//
13-
// it('should be created', () => {
14-
// expect(executeGuard).toBeTruthy();
15-
// });
16-
// });
171
import { TestBed } from '@angular/core/testing';
182
import { CanActivateFn, Router, UrlTree } from '@angular/router';
193
import { NonAdminGuard } from './non-admin.guard';
@@ -46,7 +30,7 @@ describe('NonAdminGuard', () => {
4630
const result = executeGuard({} as any, { url } as any);
4731
const assert = (res: boolean | UrlTree) => {
4832
if (res instanceof UrlTree) {
49-
expect(expected).toBeTrue(); // assume redirect counts as "true"
33+
expect(expected).toBeTrue();
5034
} else {
5135
expect(res).toBe(expected);
5236
}

0 commit comments

Comments
 (0)