Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Router Example Expansion #153

Closed
ReshmiCode opened this issue Oct 30, 2020 · 3 comments · Fixed by #154
Closed

Router Example Expansion #153

ReshmiCode opened this issue Oct 30, 2020 · 3 comments · Fixed by #154
Labels

Comments

@ReshmiCode
Copy link

I just came across this library, I used the original for a React project and I'm trying to expand it to our Angular project! I'm having some issues testing routing. Could the current routing example be expanded to show how to check if the href has been navigated too? I tried following a bunch of examples from other sources but they did not work.

Currently, in my render function for the test I add routes: [{ path: 'reset/request', component: BlankComponent }] and then in the test I currently have:
const navSpy = jest.spyOn(Router.prototype, 'navigate'); await initialState.navigate(screen.getByText(/forgot password/i)); expect(navSpy).toHaveBeenCalledWith(['/reset/request']);

I tried a bunch of things with location.href and this is the closest I got to it working, but the test is failing because the spy is apparently called with "{"queryParams": undefined}". The correct way to test this with the library would be helpful.

@timdeschryver
Copy link
Member

Thanks for creating this issue @ReshmiCode.
I think you just found a bug 😅

@github-actions
Copy link

🎉 This issue has been resolved in version 10.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@timdeschryver
Copy link
Member

@ReshmiCode the latest release should fix this, if that's not the case feel free to re-open this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants