diff options
Diffstat (limited to 'src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-input-wrapper/formly-input-wrapper.component.spec.ts')
-rw-r--r-- | src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-input-wrapper/formly-input-wrapper.component.spec.ts | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-input-wrapper/formly-input-wrapper.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-input-wrapper/formly-input-wrapper.component.spec.ts new file mode 100644 index 000000000..52358d660 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-input-wrapper/formly-input-wrapper.component.spec.ts @@ -0,0 +1,46 @@ +import { Component } from '@angular/core'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { FormGroup } from '@angular/forms'; +import { FormlyFieldConfig, FormlyModule } from '@ngx-formly/core'; + +import { FormlyInputWrapperComponent } from './formly-input-wrapper.component'; +import { configureTestBed } from '~/testing/unit-test-helper'; + +@Component({ + template: ` <form [formGroup]="form"> + <formly-form [model]="{}" [fields]="fields" [options]="{}" [form]="form"></formly-form> + </form>` +}) +class MockFormComponent { + form = new FormGroup({}); + fields: FormlyFieldConfig[] = [ + { + wrappers: ['input'], + defaultValue: {} + } + ]; +} + +describe('FormlyInputWrapperComponent', () => { + let component: MockFormComponent; + let fixture: ComponentFixture<MockFormComponent>; + + configureTestBed({ + declarations: [FormlyInputWrapperComponent], + imports: [ + FormlyModule.forRoot({ + types: [{ name: 'input', component: FormlyInputWrapperComponent }] + }) + ] + }); + + beforeEach(() => { + fixture = TestBed.createComponent(MockFormComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); |