Hi,
I encounter an issue on the angular unit test when I want to set a value to an input.
Inside my component, i've only one input :
export class Component {
items = input<Item[]>([]);
}
Inside my test I want to set the items value with the setInput() method.
fixture.componentRef.setInput('items', items);
But this issue is encountered when I use this method.
Error: NG0303: Can't set value of the 'items' input on the 'r' component. Make sure that the 'items' property is annotated with @input() or a mapped @input('items') exists.
I'm using :
- ng-mock: 14.13.2
- jasmine: 5.1.4
- Angular: 19
Hi,
I encounter an issue on the angular unit test when I want to set a value to an input.
Inside my component, i've only one input :
Inside my test I want to set the items value with the
setInput()method.fixture.componentRef.setInput('items', items);But this issue is encountered when I use this method.
Error: NG0303: Can't set value of the 'items' input on the 'r' component. Make sure that the 'items' property is annotated with @input() or a mapped @input('items') exists.
I'm using :