Closed
Description
Hi!
What's the correct way to change input after initial render ?
Because componentProperties
only set input on the first render, but we cannot test subsequent input changes this way (which leads to subsequent calls to ngOnChanges
).
For now, this works :
component.fixture.componentInstance.myInput = 'stuff';
component.detectChanges();
But accessing fixture
is not recommended (https://testing-library.com/docs/angular-testing-library/api#fixture, and I agree with this), and since I do not consider testing dynamic input change is testing an implementation detail, I believe there's should be another way, right ?
Edit: Maybe something like this :
// component is a RenderResult here
component.setComponentInputs({
myInput: 'value'
});
// And call detectChanges / ngOnChanges automatically
Also, thanks for this library it's really usefull !