Skip to content

Commit

Permalink
fixup! fix: Adds a fix to remove "Add a post" button when discussion …
Browse files Browse the repository at this point in the history
…is restricted
  • Loading branch information
farhaanbukhsh committed Oct 24, 2024
1 parent 2c021ec commit d59b355
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/discussions/data/hooks.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d59b355

Please sign in to comment.