Commit 9b8fd8e6 authored by Vitali Stupin's avatar Vitali Stupin

Changing unit tests

parent 4fe9ab3e
import { AppRoutingModule } from './app-routing.module';
describe('AppModule', () => {
describe('AppRoutingModule', () => {
let module: AppRoutingModule;
beforeEach(() => {
......
......@@ -2,14 +2,15 @@ import { AppModule, HttpLoaderFactory } from './app.module';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { AppConfig } from './app.config';
import { TestBed } from '@angular/core/testing';
import { HttpClient } from 'selenium-webdriver/http';
describe('AppModule', () => {
let appModule: AppModule;
let httpClientSpy: { get: jasmine.Spy };
let appConfigSpy: { load: jasmine.Spy };
beforeEach(() => {
httpClientSpy = jasmine.createSpyObj('HttpClient', ['get']);
appConfigSpy = jasmine.createSpyObj('HttpClient', ['load']);
appModule = new AppModule();
});
......@@ -25,9 +26,10 @@ describe('AppModule', () => {
TestBed.configureTestingModule({
imports: [ AppModule ],
providers: [
{ provide: HttpClient, useValue: httpClientSpy }
{ provide: AppConfig, useValue: appConfigSpy }
]
});
expect(TestBed.get(AppConfig)).toBeTruthy();
expect(appConfigSpy.load).toHaveBeenCalledTimes(1);
});
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment