started testing

This commit is contained in:
VLE2FE
2020-08-16 20:01:56 +02:00
parent f07c3be23a
commit 9197e8a187
29 changed files with 371 additions and 65 deletions

View File

@ -1,21 +1,44 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ChangelogComponent } from './changelog.component';
import {ApiService} from '../services/api.service';
import {ModalService, 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>;
let modalServiceSpy: jasmine.SpyObj<ModalService>;
describe('ChangelogComponent', () => {
let component: ChangelogComponent;
let fixture: ComponentFixture<ChangelogComponent>;
beforeEach(async(() => {
const apiSpy = jasmine.createSpyObj('ApiService', ['get']);
const modalSpy = jasmine.createSpyObj('ModalService', ['open']);
TestBed.configureTestingModule({
declarations: [ ChangelogComponent ]
declarations: [ ChangelogComponent ],
imports: [
],
providers: [
{provide: ApiService, useValue: apiSpy},
{provide: ModalService, useValue: modalSpy}
]
})
.compileComponents();
apiServiceSpy = TestBed.inject(ApiService) as jasmine.SpyObj<ApiService>;
modalServiceSpy = TestBed.inject(ModalService) as jasmine.SpyObj<ModalService>;
}));
beforeEach(() => {
fixture = TestBed.createComponent(ChangelogComponent);
component = fixture.componentInstance;
component.ngOnInit();
fixture.detectChanges();
});