import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ReactiveFormsModule } from '@angular/forms';
+import { RouterTestingModule } from '@angular/router/testing';
import { ToastModule } from 'ng2-toastr';
import { BsModalRef, BsModalService } from 'ngx-bootstrap';
HttpClientTestingModule,
ServicesModule,
ApiModule,
- ToastModule.forRoot()
+ ToastModule.forRoot(),
+ RouterTestingModule
],
declarations: [RbdSnapshotFormComponent],
providers: [BsModalRef, BsModalService, AuthStorageService]
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';
+import { RouterTestingModule } from '@angular/router/testing';
import { configureTestBed } from '../../../../testing/unit-test-helper';
import { SharedModule } from '../../../shared/shared.module';
let fixture: ComponentFixture<DashboardHelpComponent>;
configureTestBed({
- imports: [HttpClientTestingModule, SharedModule],
+ imports: [HttpClientTestingModule, SharedModule, RouterTestingModule],
declarations: [DashboardHelpComponent]
});
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';
+import { RouterTestingModule } from '@angular/router/testing';
import { PopoverModule } from 'ngx-bootstrap';
};
configureTestBed({
- imports: [SharedModule, PopoverModule.forRoot(), HttpClientTestingModule],
+ imports: [SharedModule, PopoverModule.forRoot(), HttpClientTestingModule, RouterTestingModule],
declarations: [TaskManagerComponent]
});
import { HttpClient } from '@angular/common/http';
import { fakeAsync, TestBed, tick } from '@angular/core/testing';
+import { RouterTestingModule } from '@angular/router/testing';
import { of as observableOf, Subscriber } from 'rxjs';
};
configureTestBed({
+ imports: [RouterTestingModule],
providers: [
SummaryService,
AuthStorageService,
import { HttpClient } from '@angular/common/http';
import { Injectable, NgZone } from '@angular/core';
+import { Router } from '@angular/router';
import * as _ from 'lodash';
import { BehaviorSubject, Subscription } from 'rxjs';
import { ExecutingTask } from '../models/executing-task';
-import { AuthStorageService } from './auth-storage.service';
import { ServicesModule } from './services.module';
@Injectable({
// Observable streams
summaryData$ = this.summaryDataSource.asObservable();
- constructor(
- private http: HttpClient,
- private authStorageService: AuthStorageService,
- private ngZone: NgZone
- ) {
+ constructor(private http: HttpClient, private router: Router, private ngZone: NgZone) {
this.refresh();
}
refresh() {
- if (this.authStorageService.isLoggedIn()) {
+ if (this.router.url !== '/login') {
this.http.get('api/summary').subscribe((data) => {
this.summaryDataSource.next(data);
});
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { inject, TestBed } from '@angular/core/testing';
+import { RouterTestingModule } from '@angular/router/testing';
import { ToastModule } from 'ng2-toastr';
import { Observable } from 'rxjs/Observable';
let service: TaskWrapperService;
configureTestBed({
- imports: [HttpClientTestingModule, ToastModule.forRoot(), SharedModule],
+ imports: [HttpClientTestingModule, ToastModule.forRoot(), SharedModule, RouterTestingModule],
providers: [TaskWrapperService]
});