diff --git a/src/course-outline/status-bar/StatusBar.test.jsx b/src/course-outline/status-bar/StatusBar.test.jsx
index c57613ae04..a7ba97cbb5 100644
--- a/src/course-outline/status-bar/StatusBar.test.jsx
+++ b/src/course-outline/status-bar/StatusBar.test.jsx
@@ -3,7 +3,6 @@ import { render, fireEvent } from '@testing-library/react';
import { IntlProvider } from '@edx/frontend-platform/i18n';
import { AppProvider } from '@edx/frontend-platform/react';
import { initializeMockApp } from '@edx/frontend-platform';
-import { getConfig, setConfig } from '@edx/frontend-platform/config';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import StatusBar from './StatusBar';
@@ -17,6 +16,7 @@ const courseId = 'course-v1:123';
const isLoading = false;
const openEnableHighlightsModalMock = jest.fn();
const handleVideoSharingOptionChange = jest.fn();
+const mockTaggingFeaturesEnabled = jest.fn();
jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
@@ -27,7 +27,12 @@ jest.mock('react-router-dom', () => ({
jest.mock('../../generic/data/api', () => ({
...jest.requireActual('../../generic/data/api'),
- getTagsCount: jest.fn().mockResolvedValue({ 'course-v1:123': 17 }),
+ getTagsCount: () => ({ 'course-v1:123': 17 }),
+}));
+
+jest.mock('../../generic/data/apiHooks', () => ({
+ ...jest.requireActual('../../generic/data/apiHooks'),
+ useTaggingFeaturesEnabled: () => mockTaggingFeaturesEnabled(),
}));
jest.mock('../../help-urls/hooks', () => ({
@@ -82,6 +87,8 @@ describe('
', () => {
},
});
store = initializeStore();
+ queryClient.clear();
+ mockTaggingFeaturesEnabled.mockReturnValue(true);
});
it('renders StatusBar component correctly', () => {
@@ -145,20 +152,14 @@ describe('
', () => {
expect(queryByTestId('video-sharing-wrapper')).not.toBeInTheDocument();
});
- it('renders the tag count if the waffle flag is enabled', async () => {
- setConfig({
- ...getConfig(),
- ENABLE_TAGGING_TAXONOMY_PAGES: 'true',
- });
+ it('renders the tag count', async () => {
const { findByText } = renderComponent();
expect(await findByText('17')).toBeInTheDocument();
});
- it('doesnt renders the tag count if the waffle flag is disabled', () => {
- setConfig({
- ...getConfig(),
- ENABLE_TAGGING_TAXONOMY_PAGES: 'false',
- });
+
+ it('does not render the tag count if the waffle flag is disabled', () => {
+ mockTaggingFeaturesEnabled.mockReturnValue(false);
const { queryByText } = renderComponent();
expect(queryByText('17')).not.toBeInTheDocument();
diff --git a/src/course-rerun/CourseRerun.test.jsx b/src/course-rerun/CourseRerun.test.jsx
index 9c403b368b..85d9073044 100644
--- a/src/course-rerun/CourseRerun.test.jsx
+++ b/src/course-rerun/CourseRerun.test.jsx
@@ -3,6 +3,7 @@ import { useSelector } from 'react-redux';
import { MemoryRouter } from 'react-router-dom';
import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
import { initializeMockApp } from '@edx/frontend-platform';
+import { QueryClientProvider, QueryClient } from '@tanstack/react-query';
import { IntlProvider, injectIntl } from '@edx/frontend-platform/i18n';
import { AppProvider } from '@edx/frontend-platform/react';
import {
@@ -33,12 +34,16 @@ jest.mock('react-router-dom', () => ({
}),
}));
+const queryClient = new QueryClient();
+
const RootWrapper = () => (
-
-
-
+
+
+
+
+
);
diff --git a/src/course-unit/CourseUnit.jsx b/src/course-unit/CourseUnit.jsx
index f82d80dd98..4eeca5ecd4 100644
--- a/src/course-unit/CourseUnit.jsx
+++ b/src/course-unit/CourseUnit.jsx
@@ -31,6 +31,7 @@ import PublishControls from './sidebar/PublishControls';
import LocationInfo from './sidebar/LocationInfo';
import TagsSidebarControls from '../content-tags-drawer/tags-sidebar-controls';
import { PasteNotificationAlert } from './clipboard';
+import { useTaggingFeaturesEnabled } from '../generic/data/apiHooks';
const CourseUnit = ({ courseId }) => {
const { blockId } = useParams();
@@ -65,6 +66,8 @@ const CourseUnit = ({ courseId }) => {
const initialXBlocksData = useMemo(() => courseVerticalChildren.children ?? [], [courseVerticalChildren.children]);
const [unitXBlocks, setUnitXBlocks] = useState(initialXBlocksData);
+ const taxonomiesEnabled = useTaggingFeaturesEnabled();
+
useEffect(() => {
document.title = getPageHeadTitle('', unitTitle);
}, [unitTitle]);
@@ -200,9 +203,11 @@ const CourseUnit = ({ courseId }) => {
-
-
-
+ {taxonomiesEnabled && (
+
+
+
+ )}
diff --git a/src/generic/data/api.js b/src/generic/data/api.js
index 83fd561ff3..77b23d0631 100644
--- a/src/generic/data/api.js
+++ b/src/generic/data/api.js
@@ -10,6 +10,7 @@ export const getCourseRerunUrl = (courseId) => new URL(`/api/contentstore/v1/cou
export const getOrganizationsUrl = () => new URL('organizations', getApiBaseUrl()).href;
export const getClipboardUrl = () => `${getApiBaseUrl()}/api/content-staging/v1/clipboard/`;
export const getTagsCountApiUrl = (contentPattern) => new URL(`api/content_tagging/v1/object_tag_counts/${contentPattern}/?count_implicit`, getApiBaseUrl()).href;
+export const getStudioHomeApiUrl = () => new URL('api/contentstore/v1/home', getApiBaseUrl()).href;
/**
* Get's organizations data. Returns list of organization names.
@@ -83,3 +84,12 @@ export async function getTagsCount(contentPattern) {
}
return null;
}
+
+/**
+ * Get's studio home data.
+ * @returns {Promise