Skip to content

Bug: Angular 19 setInput with InputSignal on test #11001

@handja

Description

@handja

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions