diff --git a/jest.config.js b/jest.config.js index 72fe697b39..7a6ec92278 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/src/courseware/course/sequence/Sequence.test.jsx b/src/courseware/course/sequence/Sequence.test.jsx index 8bd7e5d6c0..fdf2986550 100644 --- a/src/courseware/course/sequence/Sequence.test.jsx +++ b/src/courseware/course/sequence/Sequence.test.jsx @@ -105,7 +105,7 @@ describe('Sequence', () => { await 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); @@ -159,7 +159,7 @@ describe('Sequence', () => { render(, { wrapWithRouter: true }); expect(await 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 e1bfdc79b6..e79a1b4132 100755 --- a/src/setupTest.js +++ b/src/setupTest.js @@ -191,6 +191,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);