-
Notifications
You must be signed in to change notification settings - Fork 92
Closed
Description
I have a simple component:
@Component({
selector: "foo-divider",
standalone: true,
imports: [CommonModule],
template: `
<div class="fui-divider">
<div class="fui-divider__line"></div>
@if (name()) {
<div class="fui-divider__text">
{{ name() }}
</div>
<div class="fui-divider__line"></div>
}
</div>
`,
})
export class DividerComponent {
name = input<string>();
}In my tests, using @testing-library/jest-dom/vitest I have the following:
const { container } = await render(DividerComponent, {
imports: [DividerComponent],
inputs: {
name: 'hello',
},
});I get the following stderr: NG0303: Can't set value of the 'name' input on the 'DividerComponent' component. Make sure that the 'name' property is declared as an input using the input() or model() function or the @Input() decorator.
The input isn't passed to the component either, so the if statement doesn't resolve to true which causes tests to fail. I've seen #432 but I'm just unable to get this working.
Any clues what to try?
Metadata
Metadata
Assignees
Labels
No labels