1 import { ComponentFixture, TestBed } from '@angular/core/testing';
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';
10 describe('CrudFormComponent', () => {
11 let component: CrudFormComponent;
12 let fixture: ComponentFixture<CrudFormComponent>;
13 const toastFakeService = {
20 imports: [ToastrModule.forRoot(), RouterTestingModule, HttpClientTestingModule],
22 { provide: ToastrService, useValue: toastFakeService },
23 { provide: CdDatePipe, useValue: { transform: (d: any) => d } }
27 beforeEach(async () => {
28 await TestBed.configureTestingModule({
29 declarations: [CrudFormComponent]
30 }).compileComponents();
34 fixture = TestBed.createComponent(CrudFormComponent);
35 component = fixture.componentInstance;
36 fixture.detectChanges();
39 it('should create', () => {
40 expect(component).toBeTruthy();