| 5007 | } |
| 5008 | |
| 5009 | @Component({ |
| 5010 | template: ` <my-input [formField]="f" /> `, |
| 5011 | imports: [CustomInput, FormField], |
| 5012 | }) |
| 5013 | class HiddenTestCmp { |
| 5014 | myInput = viewChild.required<CustomInput>(CustomInput); |
| 5015 | data = signal(''); |
| 5016 | f = form(this.data, (p) => { |
| 5017 | hidden(p, {when: ({value}) => value() === ''}); |
| 5018 | }); |
| 5019 | } |
| 5020 | |
| 5021 | const comp = act(() => TestBed.createComponent(HiddenTestCmp)).componentInstance; |
| 5022 | expect(comp.myInput().hidden()).toBe(true); |