-
Notifications
You must be signed in to change notification settings - Fork 92
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
Interop with RouterTestingHarness #383
Comments
If we just want to query the generated DOM with the Testing Library, the |
Hi @lacolaco sorry, I missed this issue. Do you have any ideas? |
@timdeschryver I don't have yet. After I wrote this issue, Angular v16 supports router input binding |
I have a use-case for this (or at least for supporting routing).
However, the testing-library offers no utility functions for navigation nor does the Angular Testing Library. |
Angular introduced RouterTestingHarness as a utility for testing a component that depends on the router.
RouterTestingHarness manages a root component to instantiate
<router-outlet>
and returns routed component bynavigateByUrl(url, component)
method. AFAIK, there is a conflict with the testing-library'srender()
approach. The responsibility for instantiating a ComponentFixture must be one or the other.So, I can't suggest a specific solution yet, but I think that testing involving Router can be complex and this is precisely the kind of area that the Testing Library should help with. It would be desirable to provide a means to escape from MockRouter and MockActivatedRoute while still being able to use them with the Testing Library.
The text was updated successfully, but these errors were encountered: