diff --git a/jest.config.js b/jest.config.js index fad2f74fdf..b50d6af4f5 100644 --- a/jest.config.js +++ b/jest.config.js @@ -41,3 +41,7 @@ config.reporters = [...(config.reporters || []), ["jest-console-group-reporter", }]]; module.exports = config; + +module.exports.transformIgnorePatterns = [ + '/node_modules/(?!(@edx|@edunext|@openedx))', +]; diff --git a/package.json b/package.json index 04c794a693..cb91e322f5 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "files": [ { "path": "dist/*.js", - "maxSize": "1450kB" + "maxSize": "1536kB" } ], "normalizeFilenames": "^.+?(\\..+?)\\.\\w+$" diff --git a/src/courseware/course/sequence/Sequence.jsx b/src/courseware/course/sequence/Sequence.jsx index 6c56b21918..bdd506b826 100644 --- a/src/courseware/course/sequence/Sequence.jsx +++ b/src/courseware/course/sequence/Sequence.jsx @@ -9,6 +9,7 @@ import { import { useIntl } from '@edx/frontend-platform/i18n'; import { useSelector } from 'react-redux'; import SequenceExamWrapper from '@edx/frontend-lib-special-exams'; +import { LikeDislikeUnit } from '@edunext/frontend-essentials'; import PageLoading from '@src/generic/PageLoading'; import { useModel } from '@src/generic/model-store'; @@ -206,7 +207,14 @@ const Sequence = ({ isEnabledOutlineSidebar={isEnabledOutlineSidebar} renderUnitNavigation={renderUnitNavigation} /> - {unitHasLoaded && renderUnitNavigation(false)} + {unitHasLoaded && ( + <> +
+ +
+ {renderUnitNavigation(false)} + + )} diff --git a/src/courseware/course/sequence/Sequence.test.jsx b/src/courseware/course/sequence/Sequence.test.jsx index 5473e24c30..d61255d8f6 100644 --- a/src/courseware/course/sequence/Sequence.test.jsx +++ b/src/courseware/course/sequence/Sequence.test.jsx @@ -106,7 +106,7 @@ describe('Sequence', () => { waitFor(() => { expect(screen.queryByText('Loading locked content messaging...')).toBeInTheDocument(); // `Previous`, `Prerequisite` and `Close Tray` buttons. - expect(screen.getAllByRole('button').length).toEqual(3); + expect(screen.getAllByRole('button').length).toEqual(5); // two more buttons like and dislike // `Next` button. expect(screen.getAllByRole('link').length).toEqual(1); @@ -162,7 +162,7 @@ describe('Sequence', () => { waitFor(() => { expect(screen.findByText('Loading learning sequence...')).toBeInTheDocument(); // `Previous`, `Prerequisite` and `Close Tray` buttons. - expect(screen.getAllByRole('button')).toHaveLength(3); + expect(screen.getAllByRole('button')).toHaveLength(5); // two more buttons like and dislike // Renders `Next` button. expect(screen.getAllByRole('link')).toHaveLength(1); diff --git a/src/setupTest.js b/src/setupTest.js index 63da82abcb..030d86d249 100755 --- a/src/setupTest.js +++ b/src/setupTest.js @@ -201,6 +201,9 @@ export async function initializeTestStore(options = {}, overrideStore = true) { const proctoredExamApiUrl = `${getConfig().LMS_BASE_URL}/api/edx_proctoring/v1/proctored_exam/attempt/course_id/${courseMetadata.id}/content_id/${sequenceMetadata.item_id}?is_learning_mfe=true`; axiosMock.onGet(proctoredExamApiUrl).reply(200, { exam: {}, active_attempt: {} }); }); + // frontend essentials configuration, this will return an status 404 on every like-dislike request + const likeDislikeUrlPattern = new RegExp(`${getConfig().COURSE_EXPERIENCE_API_URL}/like/units/.*/`); + axiosMock.onGet(likeDislikeUrlPattern).reply(404, {}); logUnhandledRequests(axiosMock);