JK
Size: a a a
JK
DK
DK
JK
DK
E
РА
const url = pm.request.url.getRaw() // {{base_url}}/api/collection/recommended/VT
const url = pm.request.url.getRaw() // {{base_url}}/api/collection/recommended/РА
В
beforeEach(() => {
TestBed.configureTestingModule({
imports: [AppModule ]
});
router = TestBed.get(Router);
authService = TestBed.get(AuthService);
loginSpy = spyOn(authService, 'login');
});
it('should call login api when navigate to lazy route', fakeAsync(() => {
const ngZone: NgZone = TestBed.get(NgZone);
ngZone.run(() => {
router.navigate(['lazy-route-1']);
});
tick();
expect(loginSpy).toHaveBeenCalled();
}));В
K🔥
В
K🔥
authService.login?В
authService.login?export const routes: Routes = [
{
path: 'login',
component: AuthFormComponent
},
{
path: 'lazy-route-1',
loadChildren: () =>
import('./lazy-module1/lazy1.module').then(m => m.Lazy1Module),
canLoad: [AuthGuard], // <- ЭТОТ ГАРД ВЫЗЫВАЕТ
canActivate: [AuthGuard]
},
K🔥
В
K🔥
K🔥