From 919393e58cace534614b1224f84760a23c30ed9f Mon Sep 17 00:00:00 2001 From: "fabio.formosa" Date: Fri, 26 Apr 2019 11:52:48 +0200 Subject: [PATCH] fixed tests --- .../src/app/app.component.spec.ts | 2 - .../src/app/guard/admin.guard.spec.ts | 2 +- .../src/app/signup/signup.component.spec.ts | 37 ++++++++++++++++++- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/quartz-manager-frontend/src/app/app.component.spec.ts b/quartz-manager-frontend/src/app/app.component.spec.ts index 8ab6c09..9957006 100644 --- a/quartz-manager-frontend/src/app/app.component.spec.ts +++ b/quartz-manager-frontend/src/app/app.component.spec.ts @@ -2,7 +2,6 @@ import { TestBed, async } from '@angular/core/testing'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { RouterTestingModule } from '@angular/router/testing'; import { AppComponent } from './app.component'; -import { HomeComponent } from './home'; import { ManagerComponent } from './manager'; import { LoginComponent } from './login'; import { MockApiService } from './service/mocks/api.service.mock'; @@ -10,7 +9,6 @@ import { MockApiService } from './service/mocks/api.service.mock'; import { LoginGuard } from './guard'; import { NotFoundComponent } from './not-found'; import { - ApiCardComponent, FooterComponent, GithubComponent, } from './component'; diff --git a/quartz-manager-frontend/src/app/guard/admin.guard.spec.ts b/quartz-manager-frontend/src/app/guard/admin.guard.spec.ts index e6ca05e..a90713f 100644 --- a/quartz-manager-frontend/src/app/guard/admin.guard.spec.ts +++ b/quartz-manager-frontend/src/app/guard/admin.guard.spec.ts @@ -16,7 +16,7 @@ describe('AdminGuard', () => { { provide: Router, useClass: RouterStub - } + }, { provide: UserService, useClass: MockUserService diff --git a/quartz-manager-frontend/src/app/signup/signup.component.spec.ts b/quartz-manager-frontend/src/app/signup/signup.component.spec.ts index 43e46a5..a7b3a19 100644 --- a/quartz-manager-frontend/src/app/signup/signup.component.spec.ts +++ b/quartz-manager-frontend/src/app/signup/signup.component.spec.ts @@ -1,6 +1,21 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { + MatCardModule, MatInputModule, MatProgressSpinnerModule, MatProgressBarModule + } from '@angular/material'; import { SignupComponent } from './signup.component'; +import { ReactiveFormsModule } from '@angular/forms'; +import { RouterTestingModule } from '@angular/router/testing'; +import { + MockUserService, + MockApiService + } from 'app/service/mocks'; +import { + UserService, + AuthService, + ApiService, + ConfigService + } from 'app/service'; describe('SignupComponent', () => { let component: SignupComponent; @@ -8,7 +23,25 @@ describe('SignupComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SignupComponent ] + declarations: [ SignupComponent ], + imports : [RouterTestingModule, + BrowserAnimationsModule, + MatCardModule, + MatInputModule, + MatProgressSpinnerModule, + MatProgressBarModule, + ReactiveFormsModule], + providers: [ + { + provide: UserService, + useClass: MockUserService + }, + { + provide: ApiService, + useClass: MockApiService + }, + AuthService, + ConfigService] }) .compileComponents(); }));