Skip to content

Commit b31ad58

Browse files
Merge branch 'master' into feat/librariesv2-backup-page
2 parents d7c627c + 8b6a350 commit b31ad58

75 files changed

Lines changed: 1679 additions & 444 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package-lock.json

Lines changed: 61 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.3",
4646
"@edx/browserslist-config": "1.5.0",
4747
"@edx/frontend-component-footer": "^14.9.0",
48-
"@edx/frontend-component-header": "^6.2.0",
48+
"@edx/frontend-component-header": "^8.0.0",
4949
"@edx/frontend-enterprise-hotjar": "^7.2.0",
5050
"@edx/frontend-platform": "^8.4.0",
5151
"@edx/openedx-atlas": "^0.7.0",
@@ -65,7 +65,7 @@
6565
"@redux-devtools/extension": "^3.3.0",
6666
"@reduxjs/toolkit": "1.9.7",
6767
"@tanstack/react-query": "5.90.2",
68-
"@tinymce/tinymce-react": "^3.14.0",
68+
"@tinymce/tinymce-react": "^6.0.0",
6969
"classnames": "2.5.1",
7070
"codemirror": "^6.0.0",
7171
"email-validator": "2.0.4",

src/__mocks__/clipboardSection.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export default {
2+
content: {
3+
id: 67,
4+
userId: 3,
5+
created: '2024-01-16T13:09:11.540615Z',
6+
purpose: 'clipboard',
7+
status: 'ready',
8+
blockType: 'chapter',
9+
blockTypeDisplay: 'Section',
10+
olxUrl: 'http://localhost:18010/api/content-staging/v1/staged-content/67/olx',
11+
displayName: 'Chapter 1',
12+
},
13+
sourceUsageKey: 'block-v1:edX+DemoX+Demo_Course+type@chapter+block@chapter_0270f6de40fc',
14+
sourceContextTitle: 'Demonstration Course',
15+
sourceEditUrl: 'http://localhost:18010/container/block-v1:edX+DemoX+Demo_Course+type@chapter+block@chapter_0270f6de40fc',
16+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export { default as clipboardUnit } from './clipboardUnit';
22
export { default as clipboardSubsection } from './clipboardSubsection';
33
export { default as clipboardXBlock } from './clipboardXBlock';
4+
export { default as clipboardSection } from './clipboardSection';

src/certificates/certificate-signatories/signatory/SignatoryForm.test.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,17 @@ describe('Signatory Component', () => {
7676

7777
it('opens image upload modal on button click', async () => {
7878
const user = userEvent.setup();
79-
const { getByRole, queryByRole } = renderSignatory(defaultProps);
79+
const { getByRole, queryByTestId } = renderSignatory(defaultProps);
8080
const replaceButton = getByRole(
8181
'button',
8282
{ name: messages.uploadImageButton.defaultMessage.replace('{uploadText}', messages.uploadModalReplace.defaultMessage) },
8383
);
8484

85-
expect(queryByRole('presentation')).not.toBeInTheDocument();
85+
expect(queryByTestId('dropzone-container')).not.toBeInTheDocument();
8686

8787
await user.click(replaceButton);
8888

89-
expect(getByRole('presentation')).toBeInTheDocument();
89+
expect(queryByTestId('dropzone-container')).toBeInTheDocument();
9090
});
9191

9292
it('shows confirm modal on delete icon click', async () => {

src/container-comparison/CompareContainersWidget.test.tsx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ describe('CompareContainersWidget', () => {
3131
expect((await screen.findAllByText('subsection block 2')).length).toEqual(1);
3232
expect((await screen.findAllByText('subsection block 11')).length).toEqual(1);
3333
expect((await screen.findAllByText('subsection block 22')).length).toEqual(1);
34+
expect(screen.queryByText(
35+
/the only change is to text block which has been edited in this course\. accepting will not remove local edits\./i,
36+
)).not.toBeInTheDocument();
3437
});
3538

3639
test('renders loading spinner when data is pending', async () => {
@@ -90,4 +93,36 @@ describe('CompareContainersWidget', () => {
9093
expect(await screen.findByRole('button', { name: 'subsection block 00' })).toBeInTheDocument();
9194
expect(await screen.findByRole('button', { name: 'subsection block 0' })).toBeInTheDocument();
9295
});
96+
97+
test('should show alert if the only change is a single text component with local overrides', async () => {
98+
const url = getLibraryContainerApiUrl(mockGetContainerMetadata.sectionId);
99+
axiosMock.onGet(url).reply(200, { publishedDisplayName: 'Test Title' });
100+
render(<CompareContainersWidget
101+
upstreamBlockId={mockGetContainerMetadata.sectionId}
102+
downstreamBlockId={mockGetCourseContainerChildren.sectionShowsAlertSingleText}
103+
/>);
104+
105+
expect((await screen.findAllByText('Test Title')).length).toEqual(2);
106+
107+
expect(screen.getByText(
108+
/the only change is to text block which has been edited in this course\. accepting will not remove local edits\./i,
109+
)).toBeInTheDocument();
110+
expect(screen.getByText(/Html block 11/i)).toBeInTheDocument();
111+
});
112+
113+
test('should show alert if the only changes is multiple text components with local overrides', async () => {
114+
const url = getLibraryContainerApiUrl(mockGetContainerMetadata.sectionId);
115+
axiosMock.onGet(url).reply(200, { publishedDisplayName: 'Test Title' });
116+
render(<CompareContainersWidget
117+
upstreamBlockId={mockGetContainerMetadata.sectionId}
118+
downstreamBlockId={mockGetCourseContainerChildren.sectionShowsAlertMultipleText}
119+
/>);
120+
121+
expect((await screen.findAllByText('Test Title')).length).toEqual(2);
122+
123+
expect(screen.getByText(
124+
/the only change is to which have been edited in this course\. accepting will not remove local edits\./i,
125+
)).toBeInTheDocument();
126+
expect(screen.getByText(/2 text blocks/i)).toBeInTheDocument();
127+
});
93128
});

0 commit comments

Comments
 (0)