it('should update treatment instruction data in UI', async(() => {
const spy = spyOnProperty(appService.treatmentInstruction, 'next',
'get').and.returnValue(treatmentInst);
component.updateTemplateInUI();
fixture.whenStable().then(() => {
expect(component.structuresInfo.length).toBe(2);
expect(component.oarStructureLength).toBe(4);
expect(component.notesArray.length).toBe(2);
});
}));
ReferenceError: spyOnProperty is not defined error is coming on running test case.
I want to spyOn treatmentInstruction BehaviorSubjectthat is present in my service as mentioned below :
treatmentInstruction = new BehaviorSubject(this.myGlobalVar);
currentTreatmentInstruction = this.treatmentInstruction.asObservable();