| 5047 | } |
| 5048 | |
| 5049 | @Component({ |
| 5050 | template: ` <my-input [formField]="f" /> `, |
| 5051 | imports: [CustomInput, FormField], |
| 5052 | }) |
| 5053 | class HiddenTestCmp { |
| 5054 | myInput = viewChild.required<CustomInput>(CustomInput); |
| 5055 | data = signal(''); |
| 5056 | f = form(this.data, (p) => { |
| 5057 | hidden(p, {when: ({value}) => value() === ''}); |
| 5058 | }); |
| 5059 | } |
| 5060 | |
| 5061 | const comp = act(() => TestBed.createComponent(HiddenTestCmp)).componentInstance; |
| 5062 | expect(comp.myInput().hidden()).toBe(true); |