Skip to content

Commit

Permalink
removed conditionals from tests and applied non-null assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
recondesigns committed Mar 3, 2024
1 parent 709f835 commit 95f4a3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/Cards/ResourceCard/__tests__/ResourceCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('ResourceCard', () => {

expect(handleVoteMock).not.toHaveBeenCalled();

UpvoteButton && fireEvent.click(UpvoteButton);
fireEvent.click(UpvoteButton!);

expect(handleVoteMock).toHaveBeenCalledTimes(1);
expect(handleVoteMock).toHaveBeenCalledWith(
Expand All @@ -34,7 +34,7 @@ describe('ResourceCard', () => {

expect(handleVoteMock).not.toHaveBeenCalled();

DownvoteButton && fireEvent.click(DownvoteButton);
fireEvent.click(DownvoteButton!);

expect(handleVoteMock).toHaveBeenCalledTimes(1);
expect(handleVoteMock).toHaveBeenCalledWith(
Expand Down

0 comments on commit 95f4a3f

Please sign in to comment.