]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
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'; | |
aee94f69 | 7 | import { configureTestBed } from '~/testing/unit-test-helper'; |
1e59de90 TL |
8 | |
9 | @Component({ | |
10 | template: ` <form [formGroup]="form"> | |
11 | <formly-form [model]="{}" [fields]="fields" [options]="{}" [form]="form"></formly-form> | |
12 | </form>` | |
13 | }) | |
14 | class MockFormComponent { | |
15 | form = new FormGroup({}); | |
16 | fields: FormlyFieldConfig[] = [ | |
17 | { | |
18 | wrappers: ['object'], | |
19 | defaultValue: {} | |
20 | } | |
21 | ]; | |
22 | } | |
23 | ||
24 | describe('FormlyObjectTypeComponent', () => { | |
25 | let fixture: ComponentFixture<MockFormComponent>; | |
26 | let mockComponent: MockFormComponent; | |
27 | ||
aee94f69 TL |
28 | configureTestBed({ |
29 | declarations: [FormlyObjectTypeComponent], | |
30 | imports: [ | |
31 | FormlyModule.forRoot({ | |
32 | types: [{ name: 'object', component: FormlyObjectTypeComponent }] | |
33 | }) | |
34 | ] | |
1e59de90 TL |
35 | }); |
36 | ||
37 | beforeEach(() => { | |
38 | fixture = TestBed.createComponent(MockFormComponent); | |
39 | mockComponent = fixture.componentInstance; | |
40 | fixture.detectChanges(); | |
41 | }); | |
42 | ||
43 | it('should create', () => { | |
44 | expect(mockComponent).toBeTruthy(); | |
45 | }); | |
46 | }); |