// TODO: Fix circular dependencies // import { TestBed } from '@angular/core/testing'; // import { Actions } from '@ngrx/effects'; // import { provideMockActions } from '@ngrx/effects/testing'; // import { Action } from '@ngrx/store'; // import { Observable, of } from 'rxjs'; // import { OIDCEffects } from './oidc.effects'; // import * as actions from './oidc.actions'; // import { MwAuthService } from '../services/auth.service'; // import { Router } from '@angular/router'; // describe('oidc.effects.ts', () => { // let actions$: Observable; // let effects: OIDCEffects; // let url = ''; // const authServiceMock: Partial = { // authorize: () => {}, // }; // beforeEach(() => { // TestBed.configureTestingModule({ // providers: [ // OIDCEffects, // provideMockActions(() => actions$), // { // provide: MwAuthService, // useValue: authServiceMock, // }, // { // provide: Router, // useValue: { // location: { // _platformLocation: { // _doc: { // URL: url, // }, // }, // }, // }, // }, // ], // }); // url = ''; // const method: any = 'authorize'; // spyOn(authServiceMock, method); // effects = TestBed.inject(OIDCEffects); // actions$ = TestBed.inject(Actions); // }); // it('should ignore authorize call if URL has auto-login token', () => { // const router = TestBed.inject(Router) as any; // router.location._platformLocation._doc.URL = // 'http://localhost:4200/#/login-preloader?autologin=3a9713ac-2297-44e5-b09c-cf60b3ece5ed&language=EN'; // actions$ = of(actions.authorize); // effects.authorize$.subscribe(); // expect(authServiceMock.authorize).not.toHaveBeenCalled(); // }); // it('should call authorize if URL has not auto-login token', () => { // const router = TestBed.inject(Router) as any; // router.location._platformLocation._doc.URL = 'http://localhost:4200'; // actions$ = of(actions.authorize); // effects.authorize$.subscribe(); // expect(authServiceMock.authorize).toHaveBeenCalled(); // }); // it('should call authorize if page has no route events', () => { // const router = TestBed.inject(Router) as any; // router.location._platformLocation._doc.URL = ''; // actions$ = of(actions.authorize); // effects.authorize$.subscribe(); // expect(authServiceMock.authorize).toHaveBeenCalled(); // }); // });