0
Fork 0
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:
Simon Backx 2022-08-12 14:17:35 +02:00
parent 75510aac5e
commit de30741fce

View file

@ -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);
});
});