Skip to content

Commit

Permalink
Test Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jain-naman-sf committed Nov 1, 2023
1 parent 592a5a6 commit 95495d9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/js/components/apiErrors.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ describe('<Errors />', () => {
const errors = [
{ id: 'err1', message: '<html><div>This is Error</div></html>' },
];
const { findByText } = render(
const { getByText } = render(
<Errors errors={errors} doRemoveError={doRemoveError} />,
);
return { findByText };
return { getByText };
};

test('calls window.location.reload on link click', () => {
Expand All @@ -35,9 +35,11 @@ describe('<Errors />', () => {
expect(window.location.reload).toHaveBeenCalledTimes(1);
});
test('for raw html error', () => {
const { findByText } = setupforRawHTML();
const { getByText } = setupforRawHTML();

findByText('Something went wrong. Please try again later.');
expect(
getByText('Something went wrong. Please try again later.'),
).toBeVisible();
});

test('calls doRemoveError on close click', () => {
Expand Down

0 comments on commit 95495d9

Please sign in to comment.