This commit is contained in:
Manuel Friedli 2017-11-07 23:53:36 +01:00
parent dbe0107281
commit 1bbba774b3

View file

@ -3,6 +3,8 @@ import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {FormsModule} from '@angular/forms'; import {FormsModule} from '@angular/forms';
import {InputComponentManagerService} from './inputcomponentmanager.service'; import {InputComponentManagerService} from './inputcomponentmanager.service';
import {Step} from './step'; import {Step} from './step';
import {ConverterRegistryService} from './converterregistry.service';
import {Converter} from './converter/converter';
describe('AppComponent', () => { describe('AppComponent', () => {
let sut: AppComponent; let sut: AppComponent;
@ -15,14 +17,25 @@ describe('AppComponent', () => {
} }
}; };
const converterRegistryServiceStub = {
getAllConverters: (): Converter[] => {
return [];
},
getConverter: (id: string): Converter => {
return undefined;
}
};
beforeEach(async(() => { beforeEach(async(() => {
/*return */ /*return */
TestBed.configureTestingModule({ TestBed.configureTestingModule({
declarations: [AppComponent], declarations: [AppComponent],
imports: [FormsModule], imports: [FormsModule],
providers: [{ providers: [
provide: InputComponentManagerService, useValue: inputComponentManagerServiceStub {provide: InputComponentManagerService, useValue: inputComponentManagerServiceStub},
}] {provide: ConverterRegistryService, useValue: converterRegistryServiceStub}
]
}) })
.compileComponents(); .compileComponents();
})); }));
@ -31,26 +44,10 @@ describe('AppComponent', () => {
fixture = TestBed.createComponent(AppComponent); fixture = TestBed.createComponent(AppComponent);
sut = fixture.componentInstance; sut = fixture.componentInstance;
}); });
// beforeEach(async(() => {
// TestBed.configureTestingModule({
// imports: [
// RouterTestingModule
// ],
// declarations: [
// AppComponent
// ],
// }).compileComponents();
// }));
it('should be true that true is true', () => { it('should create the app', async(() => {
expect(true).toBe(true);
});
// it('should create the app', async(() => {
// const fixture = TestBed.createComponent(AppComponent); // const fixture = TestBed.createComponent(AppComponent);
// const app = fixture.debugElement.componentInstance; const app = fixture.debugElement.componentInstance;
// expect(app).toBeTruthy(); expect(app).toBeTruthy();
// })); }));
}); });