You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be cool with some helpers when testing components and/or services that import RouterStore. Both in relation to provideGlobalRouterStore() vs provideLocalRouterStore() and when setting up the spec with routing in mind as that also depends on RouterTestingModule.
Funding
You can sponsor this specific effort via a Polar.sh pledge below
We receive 90% of the pledge once the issue is completed & verified
Polar receives 10% of the pledge as a fee
The text was updated successfully, but these errors were encountered:
We could add a provideTestingRouterStore provider factory that provides a TestingRouterStore service for the RouterStore dependency injection token. But we have to figure out which observable properties we want to stub and whether it makes sense to emit a stubbed value to each observable property individually.
We could also explore and document how RouterTestingModule can be used with any of the actual RouterStore implementations for integrated component tests where we use Router#navigate and Router#navigateByUrl as well as click on routing links. I think this is a possibility.
I think documenting how RouterTestingModule can be used together with RouterStore is a fairly good idea. they go hand in hand, sort of. I would usually trigger a route change ( ex[routerLink] from a template ) in the test and thus have this trigger the RouterStore observables in return.
That is not to say the other option is not viable at all, it just has more considerations to be made for a proper API that makes sense to all.
It would be cool with some helpers when testing components and/or services that import
RouterStore
. Both in relation toprovideGlobalRouterStore()
vsprovideLocalRouterStore()
and when setting up the spec with routing in mind as that also depends onRouterTestingModule
.Funding
The text was updated successfully, but these errors were encountered: