]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
b115fd5b6f6fb997e7d241717ec40bdf150da72b
[ceph.git] /
1 import { HttpClientTestingModule } from '@angular/common/http/testing';
2 import { ReactiveFormsModule } from '@angular/forms';
3 import { RouterTestingModule } from '@angular/router/testing';
4 import { ComponentFixture, TestBed } from '@angular/core/testing';
5
6 import { ToastrModule } from 'ngx-toastr';
7 import { NgbActiveModal, NgbTypeaheadModule } from '@ng-bootstrap/ng-bootstrap';
8
9 import { SharedModule } from '~/app/shared/shared.module';
10 import { NvmeofService } from '~/app/shared/api/nvmeof.service';
11 import { NvmeofListenersFormComponent } from './nvmeof-listeners-form.component';
12
13 describe('NvmeofListenersFormComponent', () => {
14   let component: NvmeofListenersFormComponent;
15   let fixture: ComponentFixture<NvmeofListenersFormComponent>;
16   let nvmeofService: NvmeofService;
17
18   beforeEach(async () => {
19     await TestBed.configureTestingModule({
20       declarations: [NvmeofListenersFormComponent],
21       providers: [NgbActiveModal],
22       imports: [
23         HttpClientTestingModule,
24         NgbTypeaheadModule,
25         ReactiveFormsModule,
26         RouterTestingModule,
27         SharedModule,
28         ToastrModule.forRoot()
29       ]
30     }).compileComponents();
31
32     fixture = TestBed.createComponent(NvmeofListenersFormComponent);
33     component = fixture.componentInstance;
34     component.ngOnInit();
35     fixture.detectChanges();
36   });
37
38   it('should create', () => {
39     expect(component).toBeTruthy();
40   });
41
42   describe('should test form', () => {
43     beforeEach(() => {
44       nvmeofService = TestBed.inject(NvmeofService);
45       spyOn(nvmeofService, 'createListener').and.stub();
46     });
47   });
48 });