From b29f5d7c3478e7ff801cc648b7c8cb0672bc195c Mon Sep 17 00:00:00 2001 From: Awais Ansari <79941147+awais-ansari@users.noreply.github.com> Date: Mon, 15 Aug 2022 15:09:53 +0500 Subject: [PATCH] Move clickable username behind the discussions.enable_learners_tab_in_discussions_mfe (#247) * fix: move clickable user name behind the discussions.enable_learners_tab_in_discussions_mfe flag * test: fix fail test cases for clickable username --- src/discussions/comments/comment/Reply.jsx | 5 ++++- src/discussions/common/AuthorLabel.jsx | 5 ++++- src/discussions/posts/post/PostLink.test.jsx | 13 ++++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/discussions/comments/comment/Reply.jsx b/src/discussions/comments/comment/Reply.jsx index a5a589cc..20efc806 100644 --- a/src/discussions/comments/comment/Reply.jsx +++ b/src/discussions/comments/comment/Reply.jsx @@ -75,7 +75,10 @@ function Reply({ }} /> -
+
); - return linkToProfile && author + return linkToProfile && author && learnersTabEnabled ? ( { }, }); store = initializeStore(); + axiosMock = new MockAdapter(getAuthenticatedHttpClient()); + axiosMock.onGet(`${courseConfigApiUrl}${courseId}/`).reply(200, { + learners_tab_enabled: true, + }); + await executeThunk(fetchCourseConfig(courseId), store.dispatch, store.getState); }); it.each([ true, false, - ])('is a clickable link %s', (leanerTab) => { + ])('is a clickable link %s', async (leanerTab) => { renderComponent(mockPost, leanerTab); if (leanerTab) {