From cab616309cf7758aa3721b698b447740a2991bb5 Mon Sep 17 00:00:00 2001 From: Farhaan Bukhsh Date: Sun, 15 Dec 2024 20:03:19 +0530 Subject: [PATCH] fixup! feat: Adding human readable 403 error access restricted --- src/course-outline/page-alerts/PageAlerts.test.jsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/course-outline/page-alerts/PageAlerts.test.jsx b/src/course-outline/page-alerts/PageAlerts.test.jsx index 6d646f7cb4..9dab8aa913 100644 --- a/src/course-outline/page-alerts/PageAlerts.test.jsx +++ b/src/course-outline/page-alerts/PageAlerts.test.jsx @@ -218,4 +218,15 @@ describe('', () => { 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(); + }); });