@plone/volto 19.0.0-alpha.13 → 19.0.0-alpha.14
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.
- package/.eslintrc +0 -1
- package/CHANGELOG.md +25 -0
- package/babel.js +1 -3
- package/global-test-setup.js +1 -2
- package/package.json +19 -79
- package/razzle.config.js +2 -2
- package/src/components/manage/Actions/Actions.test.jsx +1 -5
- package/src/components/manage/Blocks/Block/BlocksForm.test.jsx +1 -5
- package/src/components/manage/Blocks/Block/Settings.test.jsx +1 -5
- package/src/components/manage/Blocks/HTML/Edit.test.jsx +1 -5
- package/src/components/manage/Blocks/Image/ImageSidebar.test.jsx +1 -5
- package/src/components/manage/Blocks/LeadImage/LeadImageSidebar.test.jsx +1 -5
- package/src/components/manage/Blocks/Maps/MapsSidebar.test.jsx +1 -5
- package/src/components/manage/Blocks/Search/components/DateRangeFacet.test.jsx +1 -6
- package/src/components/manage/Blocks/Search/components/SelectFacet.test.jsx +1 -6
- package/src/components/manage/Blocks/Video/VideoSidebar.test.jsx +1 -5
- package/src/components/manage/Contents/Contents.test.jsx +1 -5
- package/src/components/manage/Contents/ContentsPropertiesModal.test.jsx +1 -5
- package/src/components/manage/Contents/ContentsRenameModal.test.jsx +1 -5
- package/src/components/manage/Contents/ContentsTagsModal.test.jsx +1 -5
- package/src/components/manage/Contents/ContentsWorkflowModal.test.jsx +1 -5
- package/src/components/manage/Contents/__mocks__/index.tsx +2 -18
- package/src/components/manage/Controlpanels/Aliases.test.jsx +1 -5
- package/src/components/manage/Controlpanels/ContentType.test.jsx +1 -5
- package/src/components/manage/Controlpanels/Rules/AddRule.test.jsx +1 -5
- package/src/components/manage/Controlpanels/Rules/EditRule.test.jsx +1 -5
- package/src/components/manage/Controlpanels/UndoControlpanel.test.jsx +1 -5
- package/src/components/manage/Diff/Diff.test.jsx +1 -6
- package/src/components/manage/Diff/DiffField.test.jsx +1 -6
- package/src/components/manage/Display/Display.test.jsx +2 -11
- package/src/components/manage/Edit/Edit.test.jsx +1 -5
- package/src/components/manage/Form/BlockDataForm.test.jsx +1 -5
- package/src/components/manage/Form/Form.test.jsx +1 -5
- package/src/components/manage/Form/InlineForm.test.jsx +1 -5
- package/src/components/manage/Form/ModalForm.test.jsx +1 -5
- package/src/components/manage/Form/__mocks__/index.tsx +9 -27
- package/src/components/manage/Preferences/ChangePassword.test.jsx +1 -5
- package/src/components/manage/Preferences/PersonalPreferences.test.jsx +1 -17
- package/src/components/manage/Widgets/ArrayWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/CheckboxGroupWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/DatetimeWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/ObjectListWidget.test.jsx +1 -11
- package/src/components/manage/Widgets/ObjectWidget.test.jsx +1 -5
- package/src/components/manage/Widgets/RadioGroupWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/SchemaWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/SchemaWidgetFieldset.test.jsx +1 -6
- package/src/components/manage/Widgets/SelectAutoComplete.test.jsx +1 -6
- package/src/components/manage/Widgets/SelectWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/TimeWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/TokenWidget.test.jsx +1 -6
- package/src/components/manage/Widgets/VocabularyTermsWidget.test.jsx +1 -11
- package/src/components/manage/Widgets/__mocks__/index.tsx +33 -51
- package/src/components/manage/Workflow/Workflow.test.jsx +2 -11
- package/src/components/theme/Comments/CommentEditModal.test.jsx +1 -5
- package/src/components/theme/Comments/Comments.test.jsx +1 -11
- package/src/components/theme/ContactForm/ContactForm.test.jsx +1 -5
- package/src/components/theme/PasswordReset/RequestPasswordReset.test.jsx +1 -5
- package/src/components/theme/Register/Register.test.jsx +1 -5
- package/src/components/theme/View/EventDatesInfo.test.jsx +1 -6
- package/src/components/theme/View/EventView.test.jsx +1 -6
- package/src/helpers/Loadable/__mocks__/Loadable.jsx +7 -22
- package/test-addons-loader.js +3 -0
- package/test-setup-globals.js +30 -2
- package/tsconfig.declarations.json +1 -1
- package/tsconfig.json +1 -1
- package/types/components/manage/Contents/__mocks__/index.d.ts +2 -2
- package/types/components/manage/Form/__mocks__/index.d.ts +8 -8
- package/types/components/manage/Widgets/__mocks__/index.d.ts +33 -33
- package/types/helpers/Loadable/__mocks__/Loadable.d.ts +2 -2
- package/vitest.config.mjs +4 -4
- package/webpack-plugins/webpack-scss-plugin.js +170 -0
- package/jest-addons-loader.js +0 -3
- package/jest-extender-plugin.js +0 -39
- package/jest-setup-afterenv.js +0 -2
- package/jest-svgsystem-transform.js +0 -10
- package/patches/patchit.sh +0 -2
- package/patches/razzle-jest.patch +0 -10
- package/src/components/manage/Contents/__mocks__/index.vitest.tsx +0 -5
- package/src/components/manage/Form/__mocks__/index.vitest.tsx +0 -73
- package/src/components/manage/Widgets/__mocks__/index.vitest.tsx +0 -41
- package/src/helpers/Loadable/__mocks__/Loadable.vitest.jsx +0 -39
- package/test-setup-globals-vitest.js +0 -46
|
@@ -5,11 +5,7 @@ import configureStore from 'redux-mock-store';
|
|
|
5
5
|
import config from '@plone/volto/registry';
|
|
6
6
|
import { Provider } from 'react-intl-redux';
|
|
7
7
|
|
|
8
|
-
vi.mock('@plone/volto/components/manage/Form'
|
|
9
|
-
return await import(
|
|
10
|
-
'@plone/volto/components/manage/Form/__mocks__/index.vitest.tsx'
|
|
11
|
-
);
|
|
12
|
-
});
|
|
8
|
+
vi.mock('@plone/volto/components/manage/Form');
|
|
13
9
|
|
|
14
10
|
const mockStore = configureStore();
|
|
15
11
|
|
|
@@ -9,11 +9,7 @@ const mockStore = configureStore();
|
|
|
9
9
|
const errorMessage =
|
|
10
10
|
"[{'message': 'The specified email is not valid.', 'field': 'contact_email', 'error': 'ValidationError'}";
|
|
11
11
|
|
|
12
|
-
vi.mock('@plone/volto/components/manage/Form'
|
|
13
|
-
return await import(
|
|
14
|
-
'@plone/volto/components/manage/Form/__mocks__/index.vitest.tsx'
|
|
15
|
-
);
|
|
16
|
-
});
|
|
12
|
+
vi.mock('@plone/volto/components/manage/Form');
|
|
17
13
|
|
|
18
14
|
describe('Form', () => {
|
|
19
15
|
it('renders a form component', () => {
|
|
@@ -6,11 +6,7 @@ import config from '@plone/volto/registry';
|
|
|
6
6
|
|
|
7
7
|
import InlineForm from './InlineForm';
|
|
8
8
|
|
|
9
|
-
vi.mock('@plone/volto/components/manage/Form'
|
|
10
|
-
return await import(
|
|
11
|
-
'@plone/volto/components/manage/Form/__mocks__/index.vitest.tsx'
|
|
12
|
-
);
|
|
13
|
-
});
|
|
9
|
+
vi.mock('@plone/volto/components/manage/Form');
|
|
14
10
|
|
|
15
11
|
const mockStore = configureStore();
|
|
16
12
|
|
|
@@ -8,11 +8,7 @@ import ModalForm from './ModalForm';
|
|
|
8
8
|
|
|
9
9
|
const mockStore = configureStore();
|
|
10
10
|
|
|
11
|
-
vi.mock('@plone/volto/components/manage/Form'
|
|
12
|
-
return await import(
|
|
13
|
-
'@plone/volto/components/manage/Form/__mocks__/index.vitest.tsx'
|
|
14
|
-
);
|
|
15
|
-
});
|
|
11
|
+
vi.mock('@plone/volto/components/manage/Form');
|
|
16
12
|
|
|
17
13
|
describe('ModalForm', () => {
|
|
18
14
|
it('renders a modal form component', () => {
|
|
@@ -1,25 +1,7 @@
|
|
|
1
|
-
/* TODO: When the Volto Team removes Jest configuration support from Volto core, update this file with the Vitest version of the mock.
|
|
2
|
-
Then, in the tests, we need to replace:
|
|
3
|
-
|
|
4
|
-
vi.mock('@plone/volto/components/manage/Form', async () => {
|
|
5
|
-
return await import(
|
|
6
|
-
'@plone/volto/components/manage/Form/__mocks__/index.vitest.tsx'
|
|
7
|
-
);
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
with the following:
|
|
12
|
-
|
|
13
|
-
vi.mock('@plone/volto/components/manage/Form');
|
|
14
|
-
|
|
15
|
-
Finally, remove this comment.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
1
|
import type { JSONSchema } from '@plone/types';
|
|
19
2
|
import type { Ref } from 'react';
|
|
20
|
-
|
|
3
|
+
import { forwardRef } from 'react';
|
|
21
4
|
|
|
22
|
-
// Field descriptions can contain react elements and those are not JSON stringifiable
|
|
23
5
|
const cleanupSchema = (schema: JSONSchema | null): JSONSchema | null => {
|
|
24
6
|
if (!schema || !schema.properties) return schema;
|
|
25
7
|
return {
|
|
@@ -40,38 +22,38 @@ const cleanupSchema = (schema: JSONSchema | null): JSONSchema | null => {
|
|
|
40
22
|
};
|
|
41
23
|
};
|
|
42
24
|
|
|
43
|
-
export const Field =
|
|
25
|
+
export const Field = vi.fn((props) => (
|
|
44
26
|
<div className="Field" id={props.id}>
|
|
45
27
|
{props.title}
|
|
46
28
|
</div>
|
|
47
29
|
));
|
|
48
30
|
|
|
49
|
-
export const InlineForm =
|
|
31
|
+
export const InlineForm = vi.fn((props) => (
|
|
50
32
|
<div
|
|
51
33
|
id="InlineForm"
|
|
52
34
|
data-schema={JSON.stringify(cleanupSchema(props.schema), null, 2)}
|
|
53
35
|
/>
|
|
54
36
|
));
|
|
55
37
|
|
|
56
|
-
export const ModalForm =
|
|
38
|
+
export const ModalForm = vi.fn((props) => (
|
|
57
39
|
<div
|
|
58
40
|
id="ModalForm"
|
|
59
41
|
data-schema={JSON.stringify(cleanupSchema(props.schema), null, 2)}
|
|
60
42
|
/>
|
|
61
43
|
));
|
|
62
44
|
|
|
63
|
-
export const UndoToolbar =
|
|
45
|
+
export const UndoToolbar = vi.fn(() => <div id="UndoToolbar" />);
|
|
64
46
|
|
|
65
|
-
export const BlocksToolbar =
|
|
47
|
+
export const BlocksToolbar = vi.fn(() => <div id="BlocksToolbar" />);
|
|
66
48
|
|
|
67
|
-
export const BlockDataForm =
|
|
49
|
+
export const BlockDataForm = vi.fn((props) => (
|
|
68
50
|
<div
|
|
69
51
|
id="BlockDataForm"
|
|
70
52
|
data-schema={JSON.stringify(cleanupSchema(props.schema), null, 2)}
|
|
71
53
|
/>
|
|
72
54
|
));
|
|
73
55
|
|
|
74
|
-
export const BlocksForm =
|
|
56
|
+
export const BlocksForm = vi.fn((props) => (
|
|
75
57
|
<div
|
|
76
58
|
id="BlocksForm"
|
|
77
59
|
data-schema={JSON.stringify(cleanupSchema(props.schema), null, 2)}
|
|
@@ -88,4 +70,4 @@ const MockForm = forwardRef(
|
|
|
88
70
|
),
|
|
89
71
|
);
|
|
90
72
|
|
|
91
|
-
export const Form =
|
|
73
|
+
export const Form = vi.fn((props) => <MockForm {...props} />);
|
|
@@ -9,11 +9,7 @@ import ChangePassword from './ChangePassword';
|
|
|
9
9
|
|
|
10
10
|
const mockStore = configureStore();
|
|
11
11
|
|
|
12
|
-
vi.mock('@plone/volto/components/manage/Form'
|
|
13
|
-
return await import(
|
|
14
|
-
'@plone/volto/components/manage/Form/__mocks__/index.vitest.tsx'
|
|
15
|
-
);
|
|
16
|
-
});
|
|
12
|
+
vi.mock('@plone/volto/components/manage/Form');
|
|
17
13
|
|
|
18
14
|
vi.mock('../Toolbar/Toolbar', () => ({
|
|
19
15
|
default: vi.fn(() => <div id="Portal" />),
|
|
@@ -12,23 +12,7 @@ vi.mock('../Toolbar/Toolbar', () => ({
|
|
|
12
12
|
default: vi.fn(() => <div id="Portal" />),
|
|
13
13
|
}));
|
|
14
14
|
|
|
15
|
-
vi.mock('@plone/volto/components/manage/Form'
|
|
16
|
-
return await import(
|
|
17
|
-
'@plone/volto/components/manage/Form/__mocks__/index.vitest.tsx'
|
|
18
|
-
);
|
|
19
|
-
});
|
|
20
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable', async () => {
|
|
21
|
-
return await import(
|
|
22
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
23
|
-
);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
beforeAll(async () => {
|
|
27
|
-
const { __setLoadables } = await import(
|
|
28
|
-
'@plone/volto/helpers/Loadable/Loadable'
|
|
29
|
-
);
|
|
30
|
-
await __setLoadables();
|
|
31
|
-
});
|
|
15
|
+
vi.mock('@plone/volto/components/manage/Form');
|
|
32
16
|
|
|
33
17
|
describe('PersonalPreferences', () => {
|
|
34
18
|
it('renders a personal preferences component', () => {
|
|
@@ -8,12 +8,7 @@ import ArrayWidget from './ArrayWidget';
|
|
|
8
8
|
|
|
9
9
|
const mockStore = configureStore();
|
|
10
10
|
|
|
11
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable'
|
|
12
|
-
return await import(
|
|
13
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
14
|
-
);
|
|
15
|
-
});
|
|
16
|
-
|
|
11
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
17
12
|
// Mock react-sortable-hoc to prevent the container error
|
|
18
13
|
vi.mock('react-sortable-hoc', () => ({
|
|
19
14
|
...vi.importActual('react-sortable-hoc'),
|
|
@@ -7,12 +7,7 @@ import CheckboxGroupWidget from './CheckboxGroupWidget';
|
|
|
7
7
|
|
|
8
8
|
const mockStore = configureStore();
|
|
9
9
|
|
|
10
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable'
|
|
11
|
-
return await import(
|
|
12
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
13
|
-
);
|
|
14
|
-
});
|
|
15
|
-
|
|
10
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
16
11
|
beforeAll(async () => {
|
|
17
12
|
const { __setLoadables } = await import(
|
|
18
13
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -6,12 +6,7 @@ import { waitFor, render, screen } from '@testing-library/react';
|
|
|
6
6
|
|
|
7
7
|
const mockStore = configureStore();
|
|
8
8
|
|
|
9
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable'
|
|
10
|
-
return await import(
|
|
11
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
12
|
-
);
|
|
13
|
-
});
|
|
14
|
-
|
|
9
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
15
10
|
beforeAll(async () => {
|
|
16
11
|
const { __setLoadables } = await import(
|
|
17
12
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -4,17 +4,7 @@ import { render } from '@testing-library/react';
|
|
|
4
4
|
import configureStore from 'redux-mock-store';
|
|
5
5
|
import ObjectListWidget from './ObjectListWidget';
|
|
6
6
|
|
|
7
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable'
|
|
8
|
-
return await import(
|
|
9
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
10
|
-
);
|
|
11
|
-
});
|
|
12
|
-
vi.mock('@plone/volto/components/manage/Form', async () => {
|
|
13
|
-
return await import(
|
|
14
|
-
'@plone/volto/components/manage/Form/__mocks__/index.vitest.tsx'
|
|
15
|
-
);
|
|
16
|
-
});
|
|
17
|
-
|
|
7
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
18
8
|
beforeAll(async () => {
|
|
19
9
|
const { __setLoadables } = await import(
|
|
20
10
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -5,11 +5,7 @@ import { Provider } from 'react-intl-redux';
|
|
|
5
5
|
import { render, fireEvent } from '@testing-library/react';
|
|
6
6
|
import ObjectWidget from './ObjectWidget';
|
|
7
7
|
|
|
8
|
-
vi.mock('@plone/volto/components/manage/Form'
|
|
9
|
-
return await import(
|
|
10
|
-
'@plone/volto/components/manage/Form/__mocks__/index.vitest.tsx'
|
|
11
|
-
);
|
|
12
|
-
});
|
|
8
|
+
vi.mock('@plone/volto/components/manage/Form');
|
|
13
9
|
|
|
14
10
|
const mockStore = configureStore();
|
|
15
11
|
|
|
@@ -7,12 +7,7 @@ import RadioGroupWidget from './RadioGroupWidget';
|
|
|
7
7
|
|
|
8
8
|
const mockStore = configureStore();
|
|
9
9
|
|
|
10
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable'
|
|
11
|
-
return await import(
|
|
12
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
13
|
-
);
|
|
14
|
-
});
|
|
15
|
-
|
|
10
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
16
11
|
beforeAll(async () => {
|
|
17
12
|
const { __setLoadables } = await import(
|
|
18
13
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -5,12 +5,7 @@ import { Provider } from 'react-intl-redux';
|
|
|
5
5
|
import { waitFor } from '@testing-library/react';
|
|
6
6
|
import RecurrenceWidget from './RecurrenceWidget';
|
|
7
7
|
|
|
8
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable'
|
|
9
|
-
return await import(
|
|
10
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
11
|
-
);
|
|
12
|
-
});
|
|
13
|
-
|
|
8
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
14
9
|
beforeAll(async () => {
|
|
15
10
|
const { __setLoadables } = await import(
|
|
16
11
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -5,12 +5,7 @@ import { Provider } from 'react-intl-redux';
|
|
|
5
5
|
|
|
6
6
|
import SchemaWidget from './SchemaWidget';
|
|
7
7
|
|
|
8
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable'
|
|
9
|
-
return await import(
|
|
10
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
11
|
-
);
|
|
12
|
-
});
|
|
13
|
-
|
|
8
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
14
9
|
beforeAll(async () => {
|
|
15
10
|
const { __setLoadables } = await import(
|
|
16
11
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -3,12 +3,7 @@ import { DragDropContext, Droppable } from 'react-beautiful-dnd';
|
|
|
3
3
|
import { render } from '@testing-library/react';
|
|
4
4
|
import SchemaWidgetFieldsetComponent from './SchemaWidgetFieldset';
|
|
5
5
|
|
|
6
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable'
|
|
7
|
-
return await import(
|
|
8
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
9
|
-
);
|
|
10
|
-
});
|
|
11
|
-
|
|
6
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
12
7
|
beforeAll(async () => {
|
|
13
8
|
const { __setLoadables } = await import(
|
|
14
9
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -6,12 +6,7 @@ import SelectAutoComplete from './SelectAutoComplete';
|
|
|
6
6
|
|
|
7
7
|
const mockStore = configureStore();
|
|
8
8
|
|
|
9
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable'
|
|
10
|
-
return await import(
|
|
11
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
12
|
-
);
|
|
13
|
-
});
|
|
14
|
-
|
|
9
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
15
10
|
beforeAll(async () => {
|
|
16
11
|
const { __setLoadables } = await import(
|
|
17
12
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -6,12 +6,7 @@ import SelectWidget from './SelectWidget';
|
|
|
6
6
|
|
|
7
7
|
const mockStore = configureStore();
|
|
8
8
|
|
|
9
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable'
|
|
10
|
-
return await import(
|
|
11
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
12
|
-
);
|
|
13
|
-
});
|
|
14
|
-
|
|
9
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
15
10
|
beforeAll(async () => {
|
|
16
11
|
const { __setLoadables } = await import(
|
|
17
12
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -6,12 +6,7 @@ import { waitFor, render, screen } from '@testing-library/react';
|
|
|
6
6
|
|
|
7
7
|
const mockStore = configureStore();
|
|
8
8
|
|
|
9
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable'
|
|
10
|
-
return await import(
|
|
11
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
12
|
-
);
|
|
13
|
-
});
|
|
14
|
-
|
|
9
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
15
10
|
beforeAll(async () => {
|
|
16
11
|
const { __setLoadables } = await import(
|
|
17
12
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -7,12 +7,7 @@ import TokenWidget from './TokenWidget';
|
|
|
7
7
|
|
|
8
8
|
const mockStore = configureStore();
|
|
9
9
|
|
|
10
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable'
|
|
11
|
-
return await import(
|
|
12
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
13
|
-
);
|
|
14
|
-
});
|
|
15
|
-
|
|
10
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
16
11
|
beforeAll(async () => {
|
|
17
12
|
const { __setLoadables } = await import(
|
|
18
13
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -4,17 +4,7 @@ import configureStore from 'redux-mock-store';
|
|
|
4
4
|
import { Provider } from 'react-intl-redux';
|
|
5
5
|
import VocabularyTermsWidget from './VocabularyTermsWidget';
|
|
6
6
|
|
|
7
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable'
|
|
8
|
-
return await import(
|
|
9
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
10
|
-
);
|
|
11
|
-
});
|
|
12
|
-
vi.mock('@plone/volto/components/manage/Form', async () => {
|
|
13
|
-
return await import(
|
|
14
|
-
'@plone/volto/components/manage/Form/__mocks__/index.vitest.tsx'
|
|
15
|
-
);
|
|
16
|
-
});
|
|
17
|
-
|
|
7
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
18
8
|
beforeAll(async () => {
|
|
19
9
|
const { __setLoadables } = await import(
|
|
20
10
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -1,59 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
vi.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
vi.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
19
|
-
export const
|
|
20
|
-
export const
|
|
21
|
-
export const
|
|
22
|
-
export const
|
|
23
|
-
export const PasswordWidget = jest.fn(() => <div id="PasswordWidget" />);
|
|
24
|
-
export const QueryWidget = jest.fn(() => <div id="QueryWidget" />);
|
|
25
|
-
export const QuerySortOnWidget = jest.fn(() => <div id="QuerySortOnWidget" />);
|
|
26
|
-
export const QuerystringWidget = jest.fn(() => <div id="QuerystringWidget" />);
|
|
27
|
-
export const SchemaWidget = jest.fn(() => <div id="SchemaWidget" />);
|
|
28
|
-
export const SelectWidget = jest.fn(() => <div id="SelectWidget" />);
|
|
29
|
-
export const TextareaWidget = jest.fn(() => <div id="TextareaWidget" />);
|
|
30
|
-
export const TextWidget = jest.fn(() => <div id="TextWidget" />);
|
|
31
|
-
export const TokenWidget = jest.fn(() => <div id="TokenWidget" />);
|
|
32
|
-
export const WysiwygWidget = jest.fn(() => <div id="WysiwygWidget" />);
|
|
33
|
-
export const UrlWidget = jest.fn(() => <div id="UrlWidget" />);
|
|
34
|
-
export const InternalUrlWidget = jest.fn(() => <div id="InternalUrlWidget" />);
|
|
35
|
-
export const EmailWidget = jest.fn(() => <div id="EmailWidget" />);
|
|
36
|
-
export const NumberWidget = jest.fn(() => <div id="NumberWidget" />);
|
|
37
|
-
export const ImageSizeWidget = jest.fn(() => <div id="ImageSizeWidget" />);
|
|
38
|
-
export const RegistryImageWidget = jest.fn(() => (
|
|
1
|
+
export const AlignWidget = vi.fn(() => <div id="AlignWidget" />);
|
|
2
|
+
export const ButtonsWidget = vi.fn(() => <div id="ButtonsWidget" />);
|
|
3
|
+
export const ArrayWidget = vi.fn(() => <div id="ArrayWidget" />);
|
|
4
|
+
export const CheckboxWidget = vi.fn(() => <div id="CheckboxWidget" />);
|
|
5
|
+
export const FileWidget = vi.fn(() => <div id="FileWidget" />);
|
|
6
|
+
export const IdWidget = vi.fn(() => <div id="IdWidget" />);
|
|
7
|
+
export const PasswordWidget = vi.fn(() => <div id="PasswordWidget" />);
|
|
8
|
+
export const QueryWidget = vi.fn(() => <div id="QueryWidget" />);
|
|
9
|
+
export const QuerySortOnWidget = vi.fn(() => <div id="QuerySortOnWidget" />);
|
|
10
|
+
export const QuerystringWidget = vi.fn(() => <div id="QuerystringWidget" />);
|
|
11
|
+
export const SchemaWidget = vi.fn(() => <div id="SchemaWidget" />);
|
|
12
|
+
export const SelectWidget = vi.fn(() => <div id="SelectWidget" />);
|
|
13
|
+
export const TextareaWidget = vi.fn(() => <div id="TextareaWidget" />);
|
|
14
|
+
export const TextWidget = vi.fn(() => <div id="TextWidget" />);
|
|
15
|
+
export const TokenWidget = vi.fn(() => <div id="TokenWidget" />);
|
|
16
|
+
export const WysiwygWidget = vi.fn(() => <div id="WysiwygWidget" />);
|
|
17
|
+
export const UrlWidget = vi.fn(() => <div id="UrlWidget" />);
|
|
18
|
+
export const InternalUrlWidget = vi.fn(() => <div id="InternalUrlWidget" />);
|
|
19
|
+
export const EmailWidget = vi.fn(() => <div id="EmailWidget" />);
|
|
20
|
+
export const NumberWidget = vi.fn(() => <div id="NumberWidget" />);
|
|
21
|
+
export const ImageSizeWidget = vi.fn(() => <div id="ImageSizeWidget" />);
|
|
22
|
+
export const RegistryImageWidget = vi.fn(() => (
|
|
39
23
|
<div id="RegistryImageWidget" />
|
|
40
24
|
));
|
|
41
|
-
export const ReferenceWidget =
|
|
42
|
-
export const ObjectBrowserWidget =
|
|
25
|
+
export const ReferenceWidget = vi.fn(() => <div id="ReferenceWidget" />);
|
|
26
|
+
export const ObjectBrowserWidget = vi.fn(() => (
|
|
43
27
|
<div id="ObjectBrowserWidget" />
|
|
44
28
|
));
|
|
45
|
-
export const ObjectWidget =
|
|
46
|
-
export const ObjectListWidget =
|
|
47
|
-
export const VocabularyTermsWidget =
|
|
29
|
+
export const ObjectWidget = vi.fn(() => <div id="ObjectWidget" />);
|
|
30
|
+
export const ObjectListWidget = vi.fn(() => <div id="ObjectListWidget" />);
|
|
31
|
+
export const VocabularyTermsWidget = vi.fn(() => (
|
|
48
32
|
<div id="VocabularyTermsWidget" />
|
|
49
33
|
));
|
|
50
|
-
export const SelectMetadataWidget =
|
|
34
|
+
export const SelectMetadataWidget = vi.fn(() => (
|
|
51
35
|
<div id="SelectMetadataWidget" />
|
|
52
36
|
));
|
|
53
|
-
export const SelectAutoComplete =
|
|
54
|
-
|
|
55
|
-
));
|
|
56
|
-
export const
|
|
57
|
-
export const
|
|
58
|
-
export const RecurrenceWidget = jest.fn(() => <div id="RecurrenceWidget" />);
|
|
59
|
-
export const FormFieldWrapper = jest.fn(() => <div id="FormFieldWrapper" />);
|
|
37
|
+
export const SelectAutoComplete = vi.fn(() => <div id="SelectAutoComplete" />);
|
|
38
|
+
export const ColorPickerWidget = vi.fn(() => <div id="ColorPickerWidget" />);
|
|
39
|
+
export const DatetimeWidget = vi.fn(() => <div id="DatetimeWidget" />);
|
|
40
|
+
export const RecurrenceWidget = vi.fn(() => <div id="RecurrenceWidget" />);
|
|
41
|
+
export const FormFieldWrapper = vi.fn(() => <div id="FormFieldWrapper" />);
|
|
@@ -7,17 +7,8 @@ import Workflow from './Workflow';
|
|
|
7
7
|
|
|
8
8
|
const mockStore = configureStore();
|
|
9
9
|
|
|
10
|
-
vi.mock('@plone/volto/components/manage/Widgets'
|
|
11
|
-
|
|
12
|
-
'@plone/volto/components/manage/Widgets/__mocks__/index.vitest.tsx'
|
|
13
|
-
);
|
|
14
|
-
});
|
|
15
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable', async () => {
|
|
16
|
-
return await import(
|
|
17
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
18
|
-
);
|
|
19
|
-
});
|
|
20
|
-
|
|
10
|
+
vi.mock('@plone/volto/components/manage/Widgets');
|
|
11
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
21
12
|
beforeAll(async () => {
|
|
22
13
|
const { __setLoadables } = await import(
|
|
23
14
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -7,11 +7,7 @@ import CommentEditModal from './CommentEditModal';
|
|
|
7
7
|
|
|
8
8
|
const mockStore = configureStore();
|
|
9
9
|
|
|
10
|
-
vi.mock('@plone/volto/components/manage/Form'
|
|
11
|
-
return await import(
|
|
12
|
-
'@plone/volto/components/manage/Form/__mocks__/index.vitest.tsx'
|
|
13
|
-
);
|
|
14
|
-
});
|
|
10
|
+
vi.mock('@plone/volto/components/manage/Form');
|
|
15
11
|
|
|
16
12
|
describe('CommentEditModal', () => {
|
|
17
13
|
it('renders a comment edit modal component', () => {
|
|
@@ -19,17 +19,7 @@ vi.mock('moment', () => ({
|
|
|
19
19
|
})),
|
|
20
20
|
}));
|
|
21
21
|
|
|
22
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable'
|
|
23
|
-
return await import(
|
|
24
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
25
|
-
);
|
|
26
|
-
});
|
|
27
|
-
vi.mock('@plone/volto/components/manage/Form', async () => {
|
|
28
|
-
return await import(
|
|
29
|
-
'@plone/volto/components/manage/Form/__mocks__/index.vitest.tsx'
|
|
30
|
-
);
|
|
31
|
-
});
|
|
32
|
-
|
|
22
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
33
23
|
beforeAll(async () => {
|
|
34
24
|
const { __setLoadables } = await import(
|
|
35
25
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -9,11 +9,7 @@ vi.mock('../../manage/Toolbar/Toolbar', () => ({
|
|
|
9
9
|
default: vi.fn(() => <div id="Portal" />),
|
|
10
10
|
}));
|
|
11
11
|
|
|
12
|
-
vi.mock('@plone/volto/components/manage/Form'
|
|
13
|
-
return await import(
|
|
14
|
-
'@plone/volto/components/manage/Form/__mocks__/index.vitest.tsx'
|
|
15
|
-
);
|
|
16
|
-
});
|
|
12
|
+
vi.mock('@plone/volto/components/manage/Form');
|
|
17
13
|
|
|
18
14
|
const mockStore = configureStore();
|
|
19
15
|
describe('Contact form', () => {
|
|
@@ -6,11 +6,7 @@ import { MemoryRouter } from 'react-router-dom';
|
|
|
6
6
|
|
|
7
7
|
import RequestPasswordReset from './RequestPasswordReset';
|
|
8
8
|
|
|
9
|
-
vi.mock('@plone/volto/components/manage/Form'
|
|
10
|
-
return await import(
|
|
11
|
-
'@plone/volto/components/manage/Form/__mocks__/index.vitest.tsx'
|
|
12
|
-
);
|
|
13
|
-
});
|
|
9
|
+
vi.mock('@plone/volto/components/manage/Form');
|
|
14
10
|
|
|
15
11
|
const mockStore = configureStore();
|
|
16
12
|
|
|
@@ -6,11 +6,7 @@ import { MemoryRouter } from 'react-router-dom';
|
|
|
6
6
|
|
|
7
7
|
import Register from './Register';
|
|
8
8
|
|
|
9
|
-
vi.mock('@plone/volto/components/manage/Form'
|
|
10
|
-
return await import(
|
|
11
|
-
'@plone/volto/components/manage/Form/__mocks__/index.vitest.tsx'
|
|
12
|
-
);
|
|
13
|
-
});
|
|
9
|
+
vi.mock('@plone/volto/components/manage/Form');
|
|
14
10
|
|
|
15
11
|
const mockStore = configureStore();
|
|
16
12
|
|
|
@@ -5,12 +5,7 @@ import { When } from './EventDatesInfo';
|
|
|
5
5
|
import configureStore from 'redux-mock-store';
|
|
6
6
|
const mockStore = configureStore();
|
|
7
7
|
|
|
8
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable'
|
|
9
|
-
return await import(
|
|
10
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
11
|
-
);
|
|
12
|
-
});
|
|
13
|
-
|
|
8
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
14
9
|
beforeAll(async () => {
|
|
15
10
|
const { __setLoadables } = await import(
|
|
16
11
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -14,12 +14,7 @@ const store = mockStore({
|
|
|
14
14
|
},
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable'
|
|
18
|
-
return await import(
|
|
19
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
20
|
-
);
|
|
21
|
-
});
|
|
22
|
-
|
|
17
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
23
18
|
beforeAll(async () => {
|
|
24
19
|
const { __setLoadables } = await import(
|
|
25
20
|
'@plone/volto/helpers/Loadable/Loadable'
|