definma-ui/src/app/documentation/documentation.component.spec.ts

43 lines
1.1 KiB
TypeScript
Raw Normal View History

2020-07-14 15:58:33 +02:00
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { DocumentationComponent } from './documentation.component';
2020-08-16 20:01:56 +02:00
import {RbCustomInputsModule} from '../rb-custom-inputs/rb-custom-inputs.module';
2020-08-17 14:51:02 +02:00
import {ApiService} from '../services/api.service';
2020-08-16 20:01:56 +02:00
// TODO
2020-07-14 15:58:33 +02:00
2020-08-17 14:51:02 +02:00
let apiServiceSpy: jasmine.SpyObj<ApiService>;
2020-07-14 15:58:33 +02:00
describe('DocumentationComponent', () => {
let component: DocumentationComponent;
let fixture: ComponentFixture<DocumentationComponent>;
beforeEach(async(() => {
2020-08-17 14:51:02 +02:00
const apiSpy = jasmine.createSpyObj('ApiService', ['post', 'put']);
2020-07-14 15:58:33 +02:00
TestBed.configureTestingModule({
2020-08-16 20:01:56 +02:00
declarations: [ DocumentationComponent ],
imports: [
RbCustomInputsModule
2020-08-17 14:51:02 +02:00
],
providers: [
{provide: ApiService, useValue: apiSpy}
2020-08-16 20:01:56 +02:00
]
2020-07-14 15:58:33 +02:00
})
.compileComponents();
2020-08-17 14:51:02 +02:00
apiServiceSpy = TestBed.inject(ApiService) as jasmine.SpyObj<ApiService>;
2020-07-14 15:58:33 +02:00
}));
beforeEach(() => {
fixture = TestBed.createComponent(DocumentationComponent);
component = fixture.componentInstance;
2020-08-16 20:01:56 +02:00
component.ngOnInit();
2020-07-14 15:58:33 +02:00
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});