started testing
This commit is contained in:
@ -1,21 +1,40 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { PredictionComponent } from './prediction.component';
|
||||
import {ApiService} from '../services/api.service';
|
||||
import {RbUiComponentsModule} from '@inst-iot/bosch-angular-ui-components';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {ValidationService} from '../services/validation.service';
|
||||
import {DataService} from '../services/data.service';
|
||||
|
||||
// TODO
|
||||
|
||||
let apiServiceSpy: jasmine.SpyObj<ApiService>;
|
||||
|
||||
describe('PredictionComponent', () => {
|
||||
let component: PredictionComponent;
|
||||
let fixture: ComponentFixture<PredictionComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
const apiSpy = jasmine.createSpyObj('ApiService', ['post']);
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ PredictionComponent ]
|
||||
declarations: [ PredictionComponent ],
|
||||
imports: [
|
||||
],
|
||||
providers: [
|
||||
{provide: ApiService, useValue: apiSpy}
|
||||
]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
apiServiceSpy = TestBed.inject(ApiService) as jasmine.SpyObj<ApiService>;
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(PredictionComponent);
|
||||
component = fixture.componentInstance;
|
||||
component.ngOnInit();
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user