Closed
Description
We're using query params to configure our feature when loading and have a redirect in place when missing to set those. When using the initalRoute property, to prevent the redirect, query params aren't accepted(link).
Navigation with query params is already available in a separate function.
it('allows initially rendering a specific route with query parameters', async () => {
const initialRoute = 'initial-route?param=query';
const routes = [
{ path: initialRoute, component: FixtureComponent },
];
await render(RouterFixtureComponent, {
initialRoute,
routes,
});
const router = TestBed.inject(Router);
expect(router.url).toEqual(initialRoute);
// could also be implemented by actually reading the params from ActivatedRoute but is more complex and the above does the same
});
Metadata
Metadata
Assignees
Labels
No labels