SoCreate / angular-playground

A drop in app module for working on Angular components in isolation (Angular version 2.x and above).
http://www.angularplayground.it
MIT License
458 stars 62 forks source link

Testing routerLinkActive #260

Closed jhyot closed 4 years ago

jhyot commented 4 years ago

Is there any possibility to test the routerLinkActive directive with angular-playground?

For this I would somehow need to mock the router, or configure a custom route to be activated upon displaying a component in playground. Obviously by default the route that angular-playground uses does not match the routes in my real application.

lurock commented 4 years ago

The only way to do this is to provide a mock for the Router and control when you want the isActive method to be active.