richie-education 2.25.0-b2.dev97 → 2.25.0-b2.dev98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. package/jest/setup.ts +7 -0
  2. package/js/components/ContractFrame/AbstractContractFrame.spec.tsx +0 -6
  3. package/js/components/DjangoCMSTemplate/index.spec.tsx +2 -2
  4. package/js/components/Modal/index.spec.tsx +0 -6
  5. package/js/components/PurchaseButton/index.spec.tsx +0 -7
  6. package/js/components/SaleTunnel/index.spec.tsx +0 -7
  7. package/js/components/SignContractButton/index.omniscientOrders.spec.tsx +0 -6
  8. package/js/components/SignContractButton/index.spec.tsx +0 -6
  9. package/js/pages/DashboardContracts/index.spec.tsx +0 -7
  10. package/js/pages/DashboardOrderLayout/index.spec.tsx +0 -6
  11. package/js/pages/TeacherDashboardContractsLayout/TeacherDashboardContracts/index.spec.tsx +0 -6
  12. package/js/pages/TeacherDashboardContractsLayout/components/ContractActionsBar/index.spec.tsx +0 -6
  13. package/js/pages/TeacherDashboardContractsLayout/components/SignOrganizationContractButton/index.spec.tsx +0 -6
  14. package/js/widgets/Dashboard/components/DashboardItem/Contract/index.spec.tsx +0 -4
  15. package/js/widgets/Dashboard/components/DashboardItem/Enrollment/ProductCertificateFooter/index.spec.tsx +0 -7
  16. package/js/widgets/Dashboard/components/DashboardItem/Order/DashboardItemOrder.spec.tsx +0 -6
  17. package/js/widgets/Dashboard/components/DashboardItem/Order/DashboardItemOrderContract.spec.tsx +0 -6
  18. package/js/widgets/Dashboard/components/DashboardItem/Order/DashboardItemOrderContract.useUnionResource.cache.spec.tsx +0 -6
  19. package/js/widgets/Search/components/SearchFilterGroup/index.spec.tsx +0 -5
  20. package/js/widgets/Search/components/SearchFilterGroupModal/index.spec.tsx +0 -5
  21. package/js/widgets/SyllabusCourseRunsList/components/CourseProductItem/index.spec.tsx +0 -7
  22. package/package.json +1 -1
package/jest/setup.ts CHANGED
@@ -24,6 +24,13 @@ RESET_MODULE_EXCEPTIONS.forEach((moduleName) => {
24
24
  });
25
25
  });
26
26
 
27
+ beforeAll(() => {
28
+ // As dialog is rendered through a Portal, we have to add the DOM element in which the dialog will be rendered.
29
+ const modalExclude = document.createElement('div');
30
+ modalExclude.setAttribute('id', 'modal-exclude');
31
+ document.body.appendChild(modalExclude);
32
+ });
33
+
27
34
  afterEach(() => {
28
35
  FactoryConfig.resetUniqueStore();
29
36
  });
@@ -42,12 +42,6 @@ describe('<AbstractContractFrame />', () => {
42
42
  );
43
43
  };
44
44
 
45
- beforeAll(() => {
46
- const modalExclude = document.createElement('div');
47
- modalExclude.setAttribute('id', 'modal-exclude');
48
- document.body.appendChild(modalExclude);
49
- });
50
-
51
45
  beforeEach(() => {
52
46
  // SessionProvider api calls
53
47
  fetchMock.get('https://joanie.endpoint/api/v1.0/addresses/', []);
@@ -27,7 +27,7 @@ describe('DjangoCMSTemplate', () => {
27
27
 
28
28
  expect(initMock).not.toHaveBeenCalled();
29
29
  render(<Wrapper />);
30
- const expected = `<div><template class="cms-plugin cms-plugin-start plugin"></template>Hello world<template class="cms-plugin cms-plugin-end plugin"></template></div>`;
30
+ const expected = `<div id=\"modal-exclude\"></div><div><template class="cms-plugin cms-plugin-start plugin"></template>Hello world<template class="cms-plugin cms-plugin-end plugin"></template></div>`;
31
31
  expect(document.body.innerHTML).toEqual(expected);
32
32
  await waitFor(() => expect(initMock).toHaveBeenCalled());
33
33
  });
@@ -40,7 +40,7 @@ describe('DjangoCMSTemplate', () => {
40
40
  };
41
41
 
42
42
  render(<Wrapper />);
43
- const expected = `<div>Hello world</div>`;
43
+ const expected = `<div id=\"modal-exclude\"></div><div>Hello world</div>`;
44
44
  expect(document.body.innerHTML).toEqual(expected);
45
45
  });
46
46
  });
@@ -3,12 +3,6 @@ import { IntlProvider } from 'react-intl';
3
3
  import { Modal } from '.';
4
4
 
5
5
  describe('<Modal />', () => {
6
- beforeEach(() => {
7
- const modalExclude = document.createElement('div');
8
- modalExclude.setAttribute('id', 'modal-exclude');
9
- document.body.appendChild(modalExclude);
10
- });
11
-
12
6
  it('merges custom classNames of type string with the default classes', () => {
13
7
  render(
14
8
  <IntlProvider locale="en">
@@ -28,13 +28,6 @@ jest.mock('utils/context', () => ({
28
28
  }));
29
29
 
30
30
  describe('PurchaseButton', () => {
31
- beforeAll(() => {
32
- // As dialog is rendered through a Portal, we have to add the DOM element in which the dialog will be rendered.
33
- const modalExclude = document.createElement('div');
34
- modalExclude.setAttribute('id', 'modal-exclude');
35
- document.body.appendChild(modalExclude);
36
- });
37
-
38
31
  afterEach(() => {
39
32
  fetchMock.restore();
40
33
  });
@@ -36,13 +36,6 @@ jest.mock('utils/context', () => ({
36
36
  }));
37
37
 
38
38
  describe('SaleTunnel', () => {
39
- beforeAll(() => {
40
- // As dialog is rendered through a Portal, we have to add the DOM element in which the dialog will be rendered.
41
- const modalExclude = document.createElement('div');
42
- modalExclude.setAttribute('id', 'modal-exclude');
43
- document.body.appendChild(modalExclude);
44
- });
45
-
46
39
  afterEach(() => {
47
40
  fetchMock.restore();
48
41
  });
@@ -40,12 +40,6 @@ describe('<SignContractButton/>', () => {
40
40
  );
41
41
  };
42
42
 
43
- beforeAll(() => {
44
- const modalExclude = document.createElement('div');
45
- modalExclude.setAttribute('id', 'modal-exclude');
46
- document.body.appendChild(modalExclude);
47
- });
48
-
49
43
  beforeEach(() => {
50
44
  // JoanieSession api omniscient calls
51
45
  fetchMock.get('https://joanie.endpoint/api/v1.0/addresses/', []);
@@ -39,12 +39,6 @@ interface FromContractTestData {
39
39
  }
40
40
 
41
41
  describe('<SignContractButton/>', () => {
42
- beforeAll(() => {
43
- const modalExclude = document.createElement('div');
44
- modalExclude.setAttribute('id', 'modal-exclude');
45
- document.body.appendChild(modalExclude);
46
- });
47
-
48
42
  describe.each<FromOrderTestData | FromContractTestData>([
49
43
  {
50
44
  testCase: TestCase.FROM_ORDER_WITH_CONTRACT,
@@ -53,13 +53,6 @@ describe('<DashboardContract/>', () => {
53
53
  </QueryClientProvider>
54
54
  );
55
55
 
56
- beforeAll(() => {
57
- // As dialog is rendered through a Portal, we have to add the DOM element in which the dialog will be rendered.
58
- const modalExclude = document.createElement('div');
59
- modalExclude.setAttribute('id', 'modal-exclude');
60
- document.body.appendChild(modalExclude);
61
- });
62
-
63
56
  beforeEach(() => {
64
57
  fetchMock.get('https://joanie.endpoint/api/v1.0/addresses/', []);
65
58
  fetchMock.get('https://joanie.endpoint/api/v1.0/credit-cards/', []);
@@ -33,12 +33,6 @@ describe('<DashboardOrderLayout />', () => {
33
33
  );
34
34
  };
35
35
 
36
- beforeAll(() => {
37
- const modalExclude = document.createElement('div');
38
- modalExclude.setAttribute('id', 'modal-exclude');
39
- document.body.appendChild(modalExclude);
40
- });
41
-
42
36
  beforeEach(() => {
43
37
  fetchMock.get('https://joanie.endpoint/api/v1.0/addresses/', []);
44
38
  fetchMock.get('https://joanie.endpoint/api/v1.0/credit-cards/', []);
@@ -53,12 +53,6 @@ const Wrapper = ({ path, initialEntry }: { path: string; initialEntry: string })
53
53
  };
54
54
 
55
55
  describe('pages/TeacherDashboardContracts', () => {
56
- beforeAll(() => {
57
- const modalExclude = document.createElement('div');
58
- modalExclude.setAttribute('id', 'modal-exclude');
59
- document.body.appendChild(modalExclude);
60
- });
61
-
62
56
  beforeEach(() => {
63
57
  // Joanie providers calls
64
58
  fetchMock.get('https://joanie.test/api/v1.0/orders/', []);
@@ -58,12 +58,6 @@ describe('TeacherDashboardContractsLayout/ContractActionsBar', () => {
58
58
  );
59
59
  };
60
60
 
61
- beforeAll(() => {
62
- const modalExclude = document.createElement('div');
63
- modalExclude.setAttribute('id', 'modal-exclude');
64
- document.body.appendChild(modalExclude);
65
- });
66
-
67
61
  beforeEach(() => {
68
62
  // useTeacherContractsToSign mocked values
69
63
  mockCanSignContracts = true;
@@ -29,12 +29,6 @@ describe('TeacherDashboardContractsLayout/SignOrganizationContractButton', () =>
29
29
  );
30
30
  };
31
31
 
32
- beforeAll(() => {
33
- const modalExclude = document.createElement('div');
34
- modalExclude.setAttribute('id', 'modal-exclude');
35
- document.body.appendChild(modalExclude);
36
- });
37
-
38
32
  afterEach(() => {
39
33
  fetchMock.restore();
40
34
  });
@@ -50,10 +50,6 @@ describe.each([
50
50
  beforeAll(() => {
51
51
  // eslint-disable-next-line compat/compat
52
52
  URL.createObjectURL = jest.fn();
53
-
54
- const modalExclude = document.createElement('div');
55
- modalExclude.setAttribute('id', 'modal-exclude');
56
- document.body.appendChild(modalExclude);
57
53
  });
58
54
 
59
55
  beforeEach(() => {
@@ -67,13 +67,6 @@ describe('<ProductCertificateFooter/>', () => {
67
67
  let product: CertificateProduct;
68
68
  let course: CourseLight;
69
69
 
70
- beforeAll(() => {
71
- // As dialog is rendered through a Portal, we have to add the DOM element in which the dialog will be rendered.
72
- const modalExclude = document.createElement('div');
73
- modalExclude.setAttribute('id', 'modal-exclude');
74
- document.body.appendChild(modalExclude);
75
- });
76
-
77
70
  beforeEach(() => {
78
71
  fetchMock.get('https://joanie.endpoint.test/api/v1.0/addresses/', []);
79
72
  fetchMock.get('https://joanie.endpoint.test/api/v1.0/credit-cards/', []);
@@ -83,12 +83,6 @@ describe('<DashboardItemOrder/>', () => {
83
83
  );
84
84
  };
85
85
 
86
- beforeAll(() => {
87
- const modalExclude = document.createElement('div');
88
- modalExclude.setAttribute('id', 'modal-exclude');
89
- document.body.appendChild(modalExclude);
90
- });
91
-
92
86
  beforeEach(() => {
93
87
  fetchMock.get('https://joanie.endpoint/api/v1.0/addresses/', []);
94
88
  fetchMock.get('https://joanie.endpoint/api/v1.0/credit-cards/', []);
@@ -55,12 +55,6 @@ describe('<DashboardItemOrder/> Contract', () => {
55
55
  );
56
56
  };
57
57
 
58
- beforeAll(() => {
59
- const modalExclude = document.createElement('div');
60
- modalExclude.setAttribute('id', 'modal-exclude');
61
- document.body.appendChild(modalExclude);
62
- });
63
-
64
58
  beforeEach(() => {
65
59
  fetchMock.get('https://joanie.endpoint/api/v1.0/addresses/', []);
66
60
  fetchMock.get('https://joanie.endpoint/api/v1.0/credit-cards/', []);
@@ -47,12 +47,6 @@ describe('<DashboardItemOrder/> Contract', () => {
47
47
  );
48
48
  };
49
49
 
50
- beforeAll(() => {
51
- const modalExclude = document.createElement('div');
52
- modalExclude.setAttribute('id', 'modal-exclude');
53
- document.body.appendChild(modalExclude);
54
- });
55
-
56
50
  beforeEach(() => {
57
51
  jest.useFakeTimers();
58
52
  jest.clearAllTimers();
@@ -53,11 +53,6 @@ describe('widgets/Search/components/SearchFilterGroup', () => {
53
53
  };
54
54
 
55
55
  beforeEach(jest.resetAllMocks);
56
- beforeEach(() => {
57
- const modalExclude = document.createElement('div');
58
- modalExclude.setAttribute('id', 'modal-exclude');
59
- document.body.appendChild(modalExclude);
60
- });
61
56
 
62
57
  it('renders the name of the filter with the values as SearchFilters', () => {
63
58
  render(
@@ -63,11 +63,6 @@ describe('<SearchFilterGroupModal />', () => {
63
63
 
64
64
  beforeEach(() => fetchMock.restore());
65
65
  beforeEach(jest.resetAllMocks);
66
- beforeEach(() => {
67
- const modalExclude = document.createElement('div');
68
- modalExclude.setAttribute('id', 'modal-exclude');
69
- document.body.appendChild(modalExclude);
70
- });
71
66
 
72
67
  it('renders a button with a modal to search values for a given filter', async () => {
73
68
  {
@@ -71,13 +71,6 @@ describe('CourseProductItem', () => {
71
71
  style: 'currency',
72
72
  }).format(price);
73
73
 
74
- beforeAll(() => {
75
- // As dialog is rendered through a Portal, we have to add the DOM element in which the dialog will be rendered.
76
- const modalExclude = document.createElement('div');
77
- modalExclude.setAttribute('id', 'modal-exclude');
78
- document.body.appendChild(modalExclude);
79
- });
80
-
81
74
  beforeEach(() => {
82
75
  // JoanieSessionProvider requests
83
76
  fetchMock.get('https://joanie.test/api/v1.0/addresses/', []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "richie-education",
3
- "version": "2.25.0-b2.dev97",
3
+ "version": "2.25.0-b2.dev98",
4
4
  "description": "A CMS to build learning portals for Open Education",
5
5
  "main": "sandbox/manage.py",
6
6
  "scripts": {