I am currently facing a challenge while testing a component that utilizes routerLink
in the template (handled by RouterTestingModule
) and getCurrentNavigation()
in the corresponding ts
file to access navigation state information.
Initially, I attempted to utilize only RouterTestingModule
, but encountered difficulties with mocking getCurrentNavigation()
.
Another approach involved using a stubbed class, which became complex as it required essentially mocking the entire Router using ts-mockito.
Below is the code snippet for reference:
N/A - Rewriting the code snippet...
I would greatly appreciate any assistance or insights on this matter!