it('needs to be able to update treatment instructions in the user interface', 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);
});
}));
A ReferenceError is occurring when attempting to run the test case due to spyOnProperty not being defined.
I am aiming to use spyOn on the treatmentInstruction BehaviorSubject found in my service like so :
treatmentInstruction = new BehaviorSubject(this.myGlobalVar);
currentTreatmentInstruction = this.treatmentInstruction.asObservable();