Skip to content

Commit

Permalink
fixup! Add tests to ensure the received warnings only show when expec…
Browse files Browse the repository at this point in the history
…ted.
  • Loading branch information
dr-bizz committed Nov 18, 2024
1 parent f848062 commit 2e8a4bf
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -465,12 +465,13 @@ describe('PledgeModal', () => {
userEvent.click(getByRole('combobox', { name: 'Status' }));
userEvent.click(getByRole('option', { name: 'Received' }));

const warning = queryByTestId('received-warnings');
if (expectToFindWarnings) {
// eslint-disable-next-line jest/no-conditional-expect
expect(queryByTestId('received-warnings')).toBeInTheDocument();
expect(warning).toBeInTheDocument();
} else {
// eslint-disable-next-line jest/no-conditional-expect
expect(queryByTestId('received-warnings')).not.toBeInTheDocument();
expect(warning).not.toBeInTheDocument();
}
});
});
Expand Down

0 comments on commit 2e8a4bf

Please sign in to comment.