| 4988 | } |
| 4989 | |
| 4990 | @Component({ |
| 4991 | template: ` <my-input [formField]="f" /> `, |
| 4992 | imports: [CustomInput, FormField], |
| 4993 | }) |
| 4994 | class HiddenTestCmp { |
| 4995 | myInput = viewChild.required<CustomInput>(CustomInput); |
| 4996 | data = signal(''); |
| 4997 | f = form(this.data, (p) => { |
| 4998 | hidden(p, {when: ({value}) => value() === ''}); |
| 4999 | }); |
| 5000 | } |
| 5001 | |
| 5002 | const comp = act(() => TestBed.createComponent(HiddenTestCmp)).componentInstance; |
| 5003 | expect(comp.myInput().hidden()).toBe(true); |