]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/crud-form/formly-object-type/formly-object-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-object-type / formly-object-type.component.spec.ts
1 import { ComponentFixture, TestBed } from '@angular/core/testing';
2
3 import { FormlyObjectTypeComponent } from './formly-object-type.component';
4 import { FormlyFieldConfig, FormlyModule } from '@ngx-formly/core';
5 import { Component } from '@angular/core';
6 import { FormGroup } from '@angular/forms';
7
8 @Component({
9 template: ` <form [formGroup]="form">
10 <formly-form [model]="{}" [fields]="fields" [options]="{}" [form]="form"></formly-form>
11 </form>`
12 })
13 class MockFormComponent {
14 form = new FormGroup({});
15 fields: FormlyFieldConfig[] = [
16 {
17 wrappers: ['object'],
18 defaultValue: {}
19 }
20 ];
21 }
22
23 describe('FormlyObjectTypeComponent', () => {
24 let fixture: ComponentFixture<MockFormComponent>;
25 let mockComponent: MockFormComponent;
26
27 beforeEach(async () => {
28 await TestBed.configureTestingModule({
29 declarations: [FormlyObjectTypeComponent],
30 imports: [
31 FormlyModule.forRoot({
32 types: [{ name: 'object', component: FormlyObjectTypeComponent }]
33 })
34 ]
35 }).compileComponents();
36 });
37
38 beforeEach(() => {
39 fixture = TestBed.createComponent(MockFormComponent);
40 mockComponent = fixture.componentInstance;
41 fixture.detectChanges();
42 });
43
44 it('should create', () => {
45 expect(mockComponent).toBeTruthy();
46 });
47 });