Skip to content

Interop with RouterTestingHarness  #383

Open
@lacolaco

Description

@lacolaco

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 by navigateByUrl(url, component) method. AFAIK, there is a conflict with the testing-library's render() 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions