From 1bbba774b3c9a9afba3a23e2f8dd71956185e1cd Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Tue, 7 Nov 2017 23:53:36 +0100 Subject: [PATCH] Fix test --- src/app/app.component.spec.ts | 45 ++++++++++++++++------------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index eb14905..a82fbf1 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -3,6 +3,8 @@ import {async, ComponentFixture, TestBed} from '@angular/core/testing'; import {FormsModule} from '@angular/forms'; import {InputComponentManagerService} from './inputcomponentmanager.service'; import {Step} from './step'; +import {ConverterRegistryService} from './converterregistry.service'; +import {Converter} from './converter/converter'; describe('AppComponent', () => { let sut: AppComponent; @@ -15,14 +17,25 @@ describe('AppComponent', () => { } }; + const converterRegistryServiceStub = { + getAllConverters: (): Converter[] => { + return []; + }, + + getConverter: (id: string): Converter => { + return undefined; + } + }; + beforeEach(async(() => { /*return */ TestBed.configureTestingModule({ declarations: [AppComponent], imports: [FormsModule], - providers: [{ - provide: InputComponentManagerService, useValue: inputComponentManagerServiceStub - }] + providers: [ + {provide: InputComponentManagerService, useValue: inputComponentManagerServiceStub}, + {provide: ConverterRegistryService, useValue: converterRegistryServiceStub} + ] }) .compileComponents(); })); @@ -31,26 +44,10 @@ describe('AppComponent', () => { fixture = TestBed.createComponent(AppComponent); sut = fixture.componentInstance; }); - // beforeEach(async(() => { - // TestBed.configureTestingModule({ - // imports: [ - // RouterTestingModule - // ], - // declarations: [ - // AppComponent - // ], - // }).compileComponents(); - // })); - - it('should be true that true is true', () => { - expect(true).toBe(true); - }); - - // it('should create the app', async(() => { - // const fixture = TestBed.createComponent(AppComponent); - // const app = fixture.debugElement.componentInstance; - // expect(app).toBeTruthy(); - // })); - + it('should create the app', async(() => { + // const fixture = TestBed.createComponent(AppComponent); + const app = fixture.debugElement.componentInstance; + expect(app).toBeTruthy(); + })); });