]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
58a20e2c391b89df00f1047591df5e67a03e35fa
[ceph.git] /
1 import { Component } from '@angular/core';
2 import { ComponentFixture, TestBed } from '@angular/core/testing';
3 import { FormGroup } from '@angular/forms';
4 import { FormlyFieldConfig, FormlyModule } from '@ngx-formly/core';
5
6 import { FormlyArrayTypeComponent } from './formly-array-type.component';
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: ['input'],
18       defaultValue: {}
19     }
20   ];
21 }
22 describe('FormlyArrayTypeComponent', () => {
23   let component: MockFormComponent;
24   let fixture: ComponentFixture<MockFormComponent>;
25
26   beforeEach(async () => {
27     await TestBed.configureTestingModule({
28       declarations: [FormlyArrayTypeComponent],
29       imports: [
30         FormlyModule.forRoot({
31           types: [{ name: 'array', component: FormlyArrayTypeComponent }]
32         })
33       ]
34     }).compileComponents();
35   });
36
37   beforeEach(() => {
38     fixture = TestBed.createComponent(MockFormComponent);
39     component = fixture.componentInstance;
40     fixture.detectChanges();
41   });
42
43   it('should create', () => {
44     expect(component).toBeTruthy();
45   });
46 });