Skip to content

Commit

Permalink
fixup! feat: Adding human readable 403 error access restricted
Browse files Browse the repository at this point in the history
  • Loading branch information
farhaanbukhsh committed Dec 15, 2024
1 parent 3c103c9 commit cab6163
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/course-outline/page-alerts/PageAlerts.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,15 @@ describe('<PageAlerts />', () => {
expect(queryByText('some error')).toBeInTheDocument();
expect(queryByText('some unknown error')).toBeInTheDocument();
});

it('renders forbidden api error alerts', async () => {
const { queryByText } = renderComponent({
...pageAlertsData,
errors: {
outlineIndexApi: { data: 'some error', status: 403, type: API_ERROR_TYPES.serverError },
},
});
expect(queryByText(messages.forbiddenAlert.defaultMessage)).toBeInTheDocument();
expect(queryByText(messages.forbiddenAlertBody.defaultMessage)).toBeInTheDocument();
});
});

0 comments on commit cab6163

Please sign in to comment.