MCPcopy Create free account
hub / github.com/angular/angular / TestCmp

Class TestCmp

packages/forms/signals/test/web/compat_form.spec.ts:18–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16describe('compatForm with [formField] directive', () => {
17 it('should bind compat form to input with [formField] directive', () => {
18 @Component({
19 imports: [FormField],
20 template: `
21 <input [formField]="f.name" />
22 <input type="number" [formField]="f.age" />
23 `,
24 })
25 class TestCmp {
26 readonly cat = signal({
27 name: new FormControl('pirojok-the-cat', {nonNullable: true}),
28 age: new FormControl(5, {nonNullable: true}),
29 });
30 readonly f = compatForm(this.cat);
31 }
32
33 const fixture = act(() => TestBed.createComponent(TestCmp));
34 const inputs = fixture.nativeElement.querySelectorAll('input');

Callers

nothing calls this directly

Calls 3

ComponentInterface · 0.90
signalFunction · 0.90
compatFormFunction · 0.90

Tested by

no test coverage detected