Closed PauloKoglin closed 1 year ago
Hey @PauloKoglin, thanks for opening this issue. The property should be updated AFAIK (I think we also have a similar test in our codebase). I'll try to reproduce this, but maybe you were able to fix this in the meantime?
@PauloKoglin the "issue" is a different outcome when using input bindings [input]="inputValue"
VS just setting an input value input='an input value'
.
For the latter, the directive overrides the value (in the test, and in a real application), while with an input binding that value always "wins".
For a reproduction see https://github.com/testing-library/angular-testing-library/pull/401 For a working example see https://stackblitz.com/edit/stackblitz-starters-m55vyh?file=src%2Fmain.ts
Hey @PauloKoglin, thanks for opening this issue. The property should be updated AFAIK (I think we also have a similar test in our codebase). I'll try to reproduce this, but maybe you were able to fix this in the meantime?
Hi @timdeschryver, I still have the same problem. I've used a workaround to manipulate the property without a directive. I really would like to use the directive, like it's the clean way to override the component's properties.
@PauloKoglin did you try https://github.com/testing-library/angular-testing-library/issues/397#issuecomment-1651702501 ?
@PauloKoglin did you try #397 (comment) ?
Hi @timdeschryver, sorry for not replying your last comment quickly, I haven't seen it. :facepalm:
I just tried your code examples and it works! The problem was that I used the constructor to set/override the input. In your example I noticed that the only case it didn't work, was exactly the directive, which sets the input in the constructor, all others work like expected.
Thank you for bringing light to this issue. š
Hi, I'm having an issue with a directive which should override an @Input of a PrimeNG Component. In the real app it does work, but in the test not.
I have such a directive, that overrides the
virtualScroll
@Input from the PrimeNGp-table
:In the test, I would expect, that the
virtualScroll
attribute gets changed, but it's not the case:The
screen.debug()
results are this:As you can see, the attribute
ng-reflect-virtual-scroll
fromp-table
is stilltrue
.Is there anything I`m doing wrong? š
The versions I`m using