diff options
Diffstat (limited to '')
-rw-r--r-- | src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/crud-form.component.spec.ts | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/crud-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/crud-form.component.spec.ts new file mode 100644 index 000000000..50c6bb199 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/crud-form.component.spec.ts @@ -0,0 +1,40 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { ToastrModule, ToastrService } from 'ngx-toastr'; +import { configureTestBed } from '~/testing/unit-test-helper'; +import { CdDatePipe } from '~/app/shared/pipes/cd-date.pipe'; +import { CrudFormComponent } from './crud-form.component'; +import { RouterTestingModule } from '@angular/router/testing'; + +describe('CrudFormComponent', () => { + let component: CrudFormComponent; + let fixture: ComponentFixture<CrudFormComponent>; + const toastFakeService = { + error: () => true, + info: () => true, + success: () => true + }; + + configureTestBed({ + imports: [ToastrModule.forRoot(), RouterTestingModule, HttpClientTestingModule], + providers: [ + { provide: ToastrService, useValue: toastFakeService }, + { provide: CdDatePipe, useValue: { transform: (d: any) => d } } + ] + }); + + configureTestBed({ + declarations: [CrudFormComponent] + }); + + beforeEach(() => { + fixture = TestBed.createComponent(CrudFormComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); |