Add component tests #8
					 1 changed files with 1 additions and 13 deletions
				
			
		|  | @ -1,26 +1,17 @@ | ||||||
| import {AppComponent} from './app.component'; | import {AppComponent} from './app.component'; | ||||||
| import {async, ComponentFixture, TestBed} from '@angular/core/testing'; | import {async, ComponentFixture, TestBed} from '@angular/core/testing'; | ||||||
| import {FormsModule} from '@angular/forms'; | import {FormsModule} from '@angular/forms'; | ||||||
| import {InputComponentManagerService} from './input-component-manager.service'; |  | ||||||
| import {Step} from './step'; | import {Step} from './step'; | ||||||
| import {VersionComponent} from './version/version.component'; | import {VersionComponent} from './version/version.component'; | ||||||
| import {ConverterSelectorComponent} from './converter-selector/converter-selector.component'; | import {ConverterSelectorComponent} from './converter-selector/converter-selector.component'; | ||||||
| import {TextInputFieldComponent} from './text-input-field/text-input-field.component'; | import {TextInputFieldComponent} from './text-input-field/text-input-field.component'; | ||||||
| import {ErrorMessageComponent} from './error-message/error-message.component'; | import {ErrorMessageComponent} from './error-message/error-message.component'; | ||||||
| import createSpyObj = jasmine.createSpyObj; |  | ||||||
| 
 | 
 | ||||||
| describe('AppComponent', () => { | describe('AppComponent', () => { | ||||||
|   let sut: AppComponent; |   let sut: AppComponent; | ||||||
|   let fixture: ComponentFixture<AppComponent>; |   let fixture: ComponentFixture<AppComponent>; | ||||||
|   const firstStep: Step = new Step(0); |   const firstStep: Step = new Step(0); | ||||||
| 
 | 
 | ||||||
|   const inputComponentManagerServiceStub = createSpyObj(['getFirst']); |  | ||||||
|   inputComponentManagerServiceStub.getFirst.and.returnValue(firstStep); |  | ||||||
| 
 |  | ||||||
|   const converterRegistryServiceStub = createSpyObj(['getAllConverters', 'getConverter']); |  | ||||||
|   converterRegistryServiceStub.getAllConverters.and.returnValue([]); |  | ||||||
|   converterRegistryServiceStub.getConverter.and.returnValue(undefined); |  | ||||||
| 
 |  | ||||||
|   beforeEach(async(() => { |   beforeEach(async(() => { | ||||||
|     TestBed.configureTestingModule({ |     TestBed.configureTestingModule({ | ||||||
|       declarations: [ |       declarations: [ | ||||||
|  | @ -30,10 +21,7 @@ describe('AppComponent', () => { | ||||||
|         TextInputFieldComponent, |         TextInputFieldComponent, | ||||||
|         VersionComponent |         VersionComponent | ||||||
|       ], |       ], | ||||||
|       imports: [FormsModule], |       imports: [FormsModule] | ||||||
|       providers: [ |  | ||||||
|         {provide: InputComponentManagerService, useValue: inputComponentManagerServiceStub} |  | ||||||
|       ] |  | ||||||
|     }) |     }) | ||||||
|       .compileComponents(); |       .compileComponents(); | ||||||
|   })); |   })); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue