Skip to content

Commit

Permalink
added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PavloButynets committed Nov 27, 2024
1 parent 638f0f0 commit 1a08b7b
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,22 @@ describe('UserAvatar Component', () => {
expect(onlineStatus).not.toBeInTheDocument();
});

it('should trigger onClick callback when clicked', () => {
const handleClick = vi.fn();

render(
<UserAvatar
variant="avatar"
firstName={firstName}
lastName={lastName}
onClick={handleClick}
/>
);

const avatarElement = document.querySelector('.s2s-avatar');
avatarElement.click();

expect(handleClick).toHaveBeenCalledTimes(1);
});

});

0 comments on commit 1a08b7b

Please sign in to comment.