From d59b3550765984333de1b39ae19629c604d3b928 Mon Sep 17 00:00:00 2001 From: Farhaan Bukhsh Date: Fri, 25 Oct 2024 02:42:00 +0530 Subject: [PATCH] fixup! fix: Adds a fix to remove "Add a post" button when discussion is restricted --- src/discussions/data/hooks.test.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/discussions/data/hooks.test.jsx b/src/discussions/data/hooks.test.jsx index ca58ebe82..e5648ce7e 100644 --- a/src/discussions/data/hooks.test.jsx +++ b/src/discussions/data/hooks.test.jsx @@ -19,11 +19,11 @@ const courseConfigApiUrl = getCourseConfigApiUrl(); let store; let axiosMock; -const generateApiResponse = (isPostingEnabled, isCourseAdmin = false) => ({ +const generateApiResponse = (isPostingEnabled, hasModerationPrivileges = false) => ({ isPostingEnabled, - hasModerationPrivileges: false, + hasModerationPrivileges, isGroupTa: false, - isCourseAdmin, + isCourseAdmin: false, isCourseStaff: false, isUserAdmin: false, }); @@ -160,7 +160,7 @@ describe('Hooks', () => { expect(queryByText('false')).toBeInTheDocument(); }); - test('when posting is not disabled and Role is not Learner return true', async () => { + test('when posting is disabled and Role is not Learner return true', async () => { axiosMock.onGet(`${courseConfigApiUrl}${courseId}/`) .reply(200, generateApiResponse(false, true)); await executeThunk(fetchCourseConfig(courseId), store.dispatch, store.getState);