I have this task of implementing tests for some components implemented by someone else. I try to not make changes on their code, but I find it hard because they made all the methods private, also they make an HTTP request and subscribe to it inside the method which give me a trouble figuring out what the best test scenario will be. Here is an example:
private getProfile() {
this.http
.get('go/profile/get', {withCredentials: true})
.subscribe((profile: Profile) => {
this.user.profile = profile;
this.updateLineMsgs();
});
}
So to sum up:
Can I test a private method or am I obliged to change its scope?
What is the best test scenario for such case?