I'm learning to write test cases using jasmine for my angular application,stuck in a particular scenario I have a function inside a component that calls other private function/methods the function is as below
public rPage() {
this.setData(); // private method
this.setPage(); // private method
}
I wrote the test case to test it as below
it('should call setData from RPage', () => {
//@ts-ignore
const spy = spyOn(component, 'setData');
component.rPage();
fixture.detectChanges();
expect(spy).toHaveBeenCalled();
});
but when i run ng test the test case fails and says 'Expected spy setData to have been called. what changes should I implement to pass the test case
