I am reading data from the activatedRoute.data as below Not able to mock the ActivatedRoute. Please some one suggest me.
import { BehaviorSubject } from "rxjs";
export class MockActivatedRoute { data: BehaviorSubject;
constructor(){
this.data = of({
"projectdata": {data: "data"}
});
}
private paramsSubject = new BehaviorSubject(this.testParams);
private _testParams: {};
params = this.paramsSubject.asObservable();
get testParams() {
return this._testParams;
}
set testParams(newParams: any) {
this._testParams = newParams;
this.paramsSubject.next(newParams);
}
}
I have tried like this
but unable to resolve the issue. the above code is used for mocking paramaters i want to mock the data..
Any suggestions Please let me know.