diff --git a/src/discussions/posts/PostsView.jsx b/src/discussions/posts/PostsView.jsx index ae7f42a3..fe050bcc 100644 --- a/src/discussions/posts/PostsView.jsx +++ b/src/discussions/posts/PostsView.jsx @@ -37,7 +37,7 @@ function CategoryPostsList({ category }) { const groupedCategory = useSelector(selectCurrentCategoryGrouping)(category); // If grouping at subsection is enabled, only apply it when browsing discussions in context in the learning MFE. const topicIds = useSelector(selectTopicsUnderCategory)(enableInContextSidebar ? groupedCategory : category); - const posts = useSelector(selectTopicThreads(topicIds)); + const posts = useSelector(enableInContextSidebar ? selectAllThreads : selectTopicThreads(topicIds)); return ; } diff --git a/src/discussions/posts/PostsView.test.jsx b/src/discussions/posts/PostsView.test.jsx index e8e3b5fa..bd734436 100644 --- a/src/discussions/posts/PostsView.test.jsx +++ b/src/discussions/posts/PostsView.test.jsx @@ -191,7 +191,7 @@ describe('PostsView', () => { .toHaveLength(topicThreadCount); // When grouping is enabled, topic 1 will be shown, but not otherwise. expect(screen.queryAllByText(/this is thread-\d+ in topic some-topic-1/i)) - .toHaveLength(grouping ? topicThreadCount : 0); + .toHaveLength(grouping ? topicThreadCount : 2); }, ); });