54 lines
1.6 KiB
TypeScript
54 lines
1.6 KiB
TypeScript
import {AppComponent} from './app.component';
|
|
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
|
|
import {FormsModule} from '@angular/forms';
|
|
import {InputComponentManagerService} from './input-component-manager.service';
|
|
import {Step} from './step';
|
|
import {ConverterRegistryService} from './converter-registry.service';
|
|
import {Converter} from './converter/converter';
|
|
import {VersionComponent} from './version/version.component';
|
|
|
|
describe('AppComponent', () => {
|
|
let sut: AppComponent;
|
|
let fixture: ComponentFixture<AppComponent>;
|
|
const firstStep: Step = new Step(0);
|
|
|
|
const inputComponentManagerServiceStub = {
|
|
getFirst: () => {
|
|
return firstStep;
|
|
}
|
|
};
|
|
|
|
const converterRegistryServiceStub = {
|
|
getAllConverters: (): Converter[] => {
|
|
return [];
|
|
},
|
|
|
|
getConverter: (id: string): Converter => {
|
|
return undefined;
|
|
}
|
|
};
|
|
|
|
beforeEach(async(() => {
|
|
/*return */
|
|
TestBed.configureTestingModule({
|
|
declarations: [AppComponent, VersionComponent],
|
|
imports: [FormsModule],
|
|
providers: [
|
|
{provide: InputComponentManagerService, useValue: inputComponentManagerServiceStub},
|
|
{provide: ConverterRegistryService, useValue: converterRegistryServiceStub}
|
|
]
|
|
})
|
|
.compileComponents();
|
|
}));
|
|
|
|
beforeEach(() => {
|
|
fixture = TestBed.createComponent(AppComponent);
|
|
sut = fixture.componentInstance;
|
|
});
|
|
|
|
it('should create the app', async(() => {
|
|
// const fixture = TestBed.createComponent(AppComponent);
|
|
const app = fixture.debugElement.componentInstance;
|
|
expect(app).toBeTruthy();
|
|
}));
|
|
});
|