Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ config.reporters = [...(config.reporters || []), ["jest-console-group-reporter",
}]];

module.exports = config;

module.exports.transformIgnorePatterns = [
'/node_modules/(?!(@edx|@edunext|@openedx))',
];
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"files": [
{
"path": "dist/*.js",
"maxSize": "1450kB"
"maxSize": "1536kB"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is very random xD

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

witchcraft hahah, basically we are adding a new component that means that the result will be heavier that why we have to increase the limit, the number is just the conversion that means 1.5MB

}
],
"normalizeFilenames": "^.+?(\\..+?)\\.\\w+$"
Expand Down
10 changes: 9 additions & 1 deletion src/courseware/course/sequence/Sequence.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -206,7 +207,14 @@ const Sequence = ({
isEnabledOutlineSidebar={isEnabledOutlineSidebar}
renderUnitNavigation={renderUnitNavigation}
/>
{unitHasLoaded && renderUnitNavigation(false)}
{unitHasLoaded && (
<>
<div className="nelp-container">
<LikeDislikeUnit courseId={courseId} unitId={unitId} />
</div>
{renderUnitNavigation(false)}
</>
)}
</div>
</div>
<NotificationsDiscussionsSidebarSlot courseId={courseId} />
Expand Down
4 changes: 2 additions & 2 deletions src/courseware/course/sequence/Sequence.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down
3 changes: 3 additions & 0 deletions src/setupTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down