| 5234 | } |
| 5235 | |
| 5236 | @Component({ |
| 5237 | template: ` <my-input [formField]="f" /> `, |
| 5238 | imports: [CustomInput, FormField], |
| 5239 | }) |
| 5240 | class HiddenTestCmp { |
| 5241 | myInput = viewChild.required<CustomInput>(CustomInput); |
| 5242 | data = signal(''); |
| 5243 | f = form(this.data, (p) => { |
| 5244 | hidden(p, {when: ({value}) => value() === ''}); |
| 5245 | }); |
| 5246 | } |
| 5247 | |
| 5248 | const comp = act(() => TestBed.createComponent(HiddenTestCmp)).componentInstance; |
| 5249 | expect(comp.myInput().hidden()).toBe(true); |