Apply code style

This commit is contained in:
ziajka
2019-01-15 11:15:54 +01:00
parent fd8fbf3919
commit 74b84a13f0
357 changed files with 5859 additions and 6469 deletions

View File

@ -1,12 +1,11 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ProgressComponent } from './progress.component';
import { MatIconModule, MatProgressSpinnerModule } from "@angular/material";
import { ProgressService } from "./progress.service";
import { RouterTestingModule } from "@angular/router/testing";
import { Router } from "@angular/router";
import { BehaviorSubject } from "rxjs";
import { MatIconModule, MatProgressSpinnerModule } from '@angular/material';
import { ProgressService } from './progress.service';
import { RouterTestingModule } from '@angular/router/testing';
import { Router } from '@angular/router';
import { BehaviorSubject } from 'rxjs';
class MockedRouter {
events: BehaviorSubject<boolean>;
@ -16,7 +15,6 @@ class MockedRouter {
}
}
describe('ProgressComponent', () => {
let component: ProgressComponent;
let fixture: ComponentFixture<ProgressComponent>;
@ -25,18 +23,10 @@ describe('ProgressComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule,
MatProgressSpinnerModule,
MatIconModule
],
providers: [
ProgressService,
{ provide: Router, useClass: MockedRouter}
],
declarations: [ ProgressComponent ]
})
.compileComponents();
imports: [RouterTestingModule, MatProgressSpinnerModule, MatIconModule],
providers: [ProgressService, { provide: Router, useClass: MockedRouter }],
declarations: [ProgressComponent]
}).compileComponents();
progressService = TestBed.get(ProgressService);
router = TestBed.get(Router);
@ -53,26 +43,26 @@ describe('ProgressComponent', () => {
expect(component.visible).toEqual(false);
});
it( 'should change visibility when activated', () => {
it('should change visibility when activated', () => {
progressService.activate();
expect(component.visible).toEqual(true);
});
it( 'should change visibility when deactivated', () => {
it('should change visibility when deactivated', () => {
component.visible = true;
progressService.deactivate();
expect(component.visible).toEqual(false);
});
it( 'should set error state when error defined', () => {
const error = new Error("test");
it('should set error state when error defined', () => {
const error = new Error('test');
progressService.setError(error);
expect(component.error).toEqual(error);
});
it( 'should clear error when changes route', () => {
const error = new Error("test");
it('should clear error when changes route', () => {
const error = new Error('test');
component.error = error;
spyOn(progressService, 'clear');
@ -81,5 +71,4 @@ describe('ProgressComponent', () => {
expect(progressService.clear).toHaveBeenCalled();
});
});