converter/src/app/app.component.spec.ts

52 lines
1.9 KiB
TypeScript
Raw Normal View History

2017-04-15 19:04:49 +02:00
import {AppComponent} from './app.component';
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {FormsModule} from '@angular/forms';
2018-08-31 22:56:18 +02:00
import {InputComponentManagerService} from './input-component-manager.service';
2017-04-15 19:04:49 +02:00
import {Step} from './step';
import {VersionComponent} from './version/version.component';
2018-09-07 11:24:24 +02:00
import {ConverterSelectorComponent} from './converter-selector/converter-selector.component';
import {TextInputFieldComponent} from './text-input-field/text-input-field.component';
import {ErrorMessageComponent} from './error-message/error-message.component';
2018-09-01 01:21:06 +02:00
import createSpyObj = jasmine.createSpyObj;
describe('AppComponent', () => {
let sut: AppComponent;
let fixture: ComponentFixture<AppComponent>;
const firstStep: Step = new Step(0);
2018-09-01 01:21:06 +02:00
const inputComponentManagerServiceStub = createSpyObj(['getFirst']);
inputComponentManagerServiceStub.getFirst.and.returnValue(firstStep);
2018-09-01 01:21:06 +02:00
const converterRegistryServiceStub = createSpyObj(['getAllConverters', 'getConverter']);
converterRegistryServiceStub.getAllConverters.and.returnValue([]);
converterRegistryServiceStub.getConverter.and.returnValue(undefined);
2017-11-07 23:53:36 +01:00
beforeEach(async(() => {
TestBed.configureTestingModule({
2018-09-07 11:24:24 +02:00
declarations: [
AppComponent,
ConverterSelectorComponent,
ErrorMessageComponent,
TextInputFieldComponent,
VersionComponent
],
imports: [FormsModule],
2017-11-07 23:53:36 +01:00
providers: [
2018-09-07 11:24:24 +02:00
{provide: InputComponentManagerService, useValue: inputComponentManagerServiceStub}
2017-11-07 23:53:36 +01:00
]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AppComponent);
sut = fixture.componentInstance;
});
2017-11-07 23:53:36 +01:00
it('should create the app', async(() => {
// const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
});