]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-input-type/formly-input-type.component.spec.ts
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / forms / crud-form / formly-input-type / formly-input-type.component.spec.ts
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-input-type/formly-input-type.component.spec.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-input-type/formly-input-type.component.spec.ts
new file mode 100644 (file)
index 0000000..0a36356
--- /dev/null
@@ -0,0 +1,47 @@
+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 { FormlyInputTypeComponent } from './formly-input-type.component';
+
+@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('FormlyInputTypeComponent', () => {
+  let component: MockFormComponent;
+  let fixture: ComponentFixture<MockFormComponent>;
+
+  beforeEach(async () => {
+    await TestBed.configureTestingModule({
+      declarations: [FormlyInputTypeComponent],
+      imports: [
+        FormlyModule.forRoot({
+          types: [{ name: 'input', component: FormlyInputTypeComponent }]
+        })
+      ]
+    }).compileComponents();
+  });
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(MockFormComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});