diff --git a/src/course-unit/CourseUnit.jsx b/src/course-unit/CourseUnit.jsx
index 9fc02d73ea..431d729ab1 100644
--- a/src/course-unit/CourseUnit.jsx
+++ b/src/course-unit/CourseUnit.jsx
@@ -123,9 +123,9 @@ const CourseUnit = ({ courseId }) => {
-
-
+
+
diff --git a/src/course-unit/CourseUnit.test.jsx b/src/course-unit/CourseUnit.test.jsx
index d197e75e69..6aeccc9cb8 100644
--- a/src/course-unit/CourseUnit.test.jsx
+++ b/src/course-unit/CourseUnit.test.jsx
@@ -44,6 +44,7 @@ import deleteModalMessages from '../generic/delete-modal/messages';
import courseXBlockMessages from './course-xblock/messages';
import addComponentMessages from './add-component/messages';
import { PUBLISH_TYPES, UNIT_VISIBILITY_STATES } from './constants';
+import { getContentTaxonomyTagsApiUrl, getContentTaxonomyTagsCountApiUrl } from '../content-tags-drawer/data/api';
let axiosMock;
let store;
@@ -59,6 +60,31 @@ jest.mock('react-router-dom', () => ({
useNavigate: () => mockedUsedNavigate,
}));
+jest.mock('@tanstack/react-query', () => ({
+ useQuery: jest.fn(({ queryKey }) => {
+ if (queryKey[0] === 'contentTaxonomyTags') {
+ return {
+ data: {
+ taxonomies: [],
+ },
+ isSuccess: true,
+ };
+ } if (queryKey[0] === 'contentTaxonomyTagsCount') {
+ return {
+ data: 17,
+ isSuccess: true,
+ };
+ }
+ return {
+ data: {},
+ isSuccess: true,
+ };
+ }),
+ useQueryClient: jest.fn(() => ({
+ setQueryData: jest.fn(),
+ })),
+}));
+
const RootWrapper = () => (
@@ -92,6 +118,12 @@ describe('', () => {
.onGet(getCourseVerticalChildrenApiUrl(blockId))
.reply(200, courseVerticalChildrenMock);
await executeThunk(fetchCourseVerticalChildrenData(blockId), store.dispatch);
+ axiosMock
+ .onGet(getContentTaxonomyTagsApiUrl(blockId))
+ .reply(200, {});
+ axiosMock
+ .onGet(getContentTaxonomyTagsCountApiUrl(blockId))
+ .reply(200, 17);
});
it('render CourseUnit component correctly', async () => {
diff --git a/src/course-unit/course-sequence/sequence-navigation/SequenceNavigationTabs.jsx b/src/course-unit/course-sequence/sequence-navigation/SequenceNavigationTabs.jsx
index e0e79048dd..7565a8c0d1 100644
--- a/src/course-unit/course-sequence/sequence-navigation/SequenceNavigationTabs.jsx
+++ b/src/course-unit/course-sequence/sequence-navigation/SequenceNavigationTabs.jsx
@@ -1,6 +1,6 @@
import { useDispatch, useSelector } from 'react-redux';
import PropTypes from 'prop-types';
-import { Link, useNavigate } from 'react-router-dom';
+import { useNavigate } from 'react-router-dom';
import { Button } from '@openedx/paragon';
import { Plus as PlusIcon } from '@openedx/paragon/icons';
import { useIntl } from '@edx/frontend-platform/i18n';
diff --git a/src/course-unit/sidebar/index.jsx b/src/course-unit/sidebar/index.jsx
index 177ded961d..6d5bb25ca1 100644
--- a/src/course-unit/sidebar/index.jsx
+++ b/src/course-unit/sidebar/index.jsx
@@ -136,11 +136,11 @@ const Sidebar = ({ variant, blockId, ...props }) => {
Sidebar.propTypes = {
blockId: PropTypes.string,
+ variant: PropTypes.string.isRequired,
};
Sidebar.defaultProps = {
blockId: null,
- variant: PropTypes.string.isRequired,
};
export default Sidebar;