]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
7a6faa7e8aceb2e35bcfaa1ba115200d04ded1ef
[ceph.git] /
1 import { ComponentFixture, TestBed } from '@angular/core/testing';
2
3 import { HttpClientTestingModule } from '@angular/common/http/testing';
4 import { ToastrModule, ToastrService } from 'ngx-toastr';
5 import { configureTestBed } from '~/testing/unit-test-helper';
6 import { CdDatePipe } from '~/app/shared/pipes/cd-date.pipe';
7 import { CrudFormComponent } from './crud-form.component';
8 import { RouterTestingModule } from '@angular/router/testing';
9
10 describe('CrudFormComponent', () => {
11   let component: CrudFormComponent;
12   let fixture: ComponentFixture<CrudFormComponent>;
13   const toastFakeService = {
14     error: () => true,
15     info: () => true,
16     success: () => true
17   };
18
19   configureTestBed({
20     imports: [ToastrModule.forRoot(), RouterTestingModule, HttpClientTestingModule],
21     providers: [
22       { provide: ToastrService, useValue: toastFakeService },
23       { provide: CdDatePipe, useValue: { transform: (d: any) => d } }
24     ]
25   });
26
27   beforeEach(async () => {
28     await TestBed.configureTestingModule({
29       declarations: [CrudFormComponent]
30     }).compileComponents();
31   });
32
33   beforeEach(() => {
34     fixture = TestBed.createComponent(CrudFormComponent);
35     component = fixture.componentInstance;
36     fixture.detectChanges();
37   });
38
39   it('should create', () => {
40     expect(component).toBeTruthy();
41   });
42 });