Open XavierDupessey opened 2 years ago
Faces the same problem. Found that this change on line breaks behavior with TestBed modules. Pull request #105 It caches first injected Store when TestBed creates new Store in every test cycle. So you get the values from the past store.
Can someone please approve the open PR or otherwise show some workaround?
+1
+1
Stumbled upon this issue myself yesterday. Had to rely on jest.spyOn
to override the selector.
Can https://github.com/ngxs-labs/select-snapshot/pull/154 be reviewed and merged as it apparently fix the issue? @arturovt
@vanmxpx i see https://github.com/ngxs-labs/select-snapshot/pull/152 is still open, can it be closed to avoid confusion?
I have merged PR #154. @arturovt could you do a release for this?
I'm submitting a...
Current behavior
I updated @ngxs-labs/select-snapshot from 1.2.0 to 3.0.0. I noticed a change in unit tests:
Let's take as an example this very simple component that uses
@SelectSnapshot()
:And test it:
In the test, I use
store.reset()
to change the content of the state.With @ngxs-labs/select-snapshot v1.2.0, the tests pass. With v3.0.0, they fail:
I tried to call
TestBed.createComponent()
afterstore.reset()
and to calldetectChanges()
on the component fixture, without success.Is it a bug or I am missing something?
Environment