Skip to content

Commit

Permalink
Update follow-back.test.js
Browse files Browse the repository at this point in the history
Update follow-back.test.js with fixing unfollow methods tests

resolves #100
  • Loading branch information
farhan7reza7 authored Feb 2, 2024
1 parent be181cb commit 2ff474e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/follow-back.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ describe('Follow Back Module', () => {
await followBack(user, token).unfollowNotFollowingBack(
'diff-ymd-package',
);
expect(axios.delete).toHaveBeenCalledTimes(0); // Assuming one user unfollowed
expect(axios.delete).not.toHaveBeenCalled(); // Axios delete should not be called
expect(axios.delete).toHaveBeenCalledTimes(0); // Assuming no user unfollowed
//expect(console.log).toHaveBeenCalledWith('Unfollowed: diff-ymd-package');
expect(console.log).toHaveBeenCalledWith('Sorry, diff-ymd-package is not in not-following-back users');

});
});

Expand All @@ -146,7 +150,9 @@ describe('Follow Back Module', () => {
axios.delete.mockResolvedValueOnce({ status: 204 }); // Mock the successful deletion

await followBack(user, token).unfollowAllNotFollowingBack();
expect(axios.delete).not.toHaveBeenCalled(); // Axios delete should not be called
expect(axios.delete).toHaveBeenCalledTimes(0); // Assuming there are one user to unfollow
expect(console.log).toHaveBeenCalledWith('Finished not following back users!');
});
});
});

0 comments on commit 2ff474e

Please sign in to comment.