mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Added unlike spy
This commit is contained in:
parent
75510aac5e
commit
de30741fce
1 changed files with 3 additions and 0 deletions
|
@ -302,6 +302,7 @@ describe('Likes', () => {
|
|||
});
|
||||
|
||||
const likeSpy = jest.spyOn(api.comments, 'like');
|
||||
const unlikeSpy = jest.spyOn(api.comments, 'unlike');
|
||||
|
||||
const comment = await within(iframeDocument).findByTestId('comment-component');
|
||||
|
||||
|
@ -332,6 +333,8 @@ describe('Likes', () => {
|
|||
await userEvent.click(likeButton);
|
||||
expect(likeButton.lastChild.textContent).toEqual('5');
|
||||
expect(icon.className.baseVal).not.toContain('fill');
|
||||
|
||||
expect(unlikeSpy).toBeCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue