Let\'s say I have this
export class QuestionnaireQuestionsComponent {
questions: Question[] = [];
private loading:boolean = true;
constructor(
For scenarios in which you are reading the query params from the ActivatedRouteSnapshot like:
this.someProperty = this.route.snapshot.data.query['paramKey'];
The below code will be helpful in tests for feeding query params data into the route
{
provide: ActivatedRoute,
useValue: {
snapshot: {
data: {
query: {
paramKey: 'paramValue'
}
}
}
}
}