@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
package/.eslintrc
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -17,6 +17,31 @@ myst:
|
|
|
17
17
|
|
|
18
18
|
<!-- towncrier release notes start -->
|
|
19
19
|
|
|
20
|
+
## 19.0.0-alpha.14 (2025-11-19)
|
|
21
|
+
|
|
22
|
+
### Breaking
|
|
23
|
+
|
|
24
|
+
- Add package `@plone/razzle`. It's a fork of `razzle`. @wesleybl [#7542](https://github.com/plone/volto/issues/7542)
|
|
25
|
+
- Fork `babel-razzle-preset` from Razzle. Update dependencies. @sneridagh [#7619](https://github.com/plone/volto/issues/7619)
|
|
26
|
+
- Removed Jest from build. @sneridagh [#7620](https://github.com/plone/volto/issues/7620)
|
|
27
|
+
|
|
28
|
+
### Feature
|
|
29
|
+
|
|
30
|
+
- Forked Razzle SCSS plugin, pin the version to one that does not flood the log with useless deprecation warnings. @sneridagh [#7188](https://github.com/plone/volto/issues/7188)
|
|
31
|
+
|
|
32
|
+
### Bugfix
|
|
33
|
+
|
|
34
|
+
- Replaced `{term}` with `{ref}` to link to headings. @pratyush07-hub [#fix-glossary-terms](https://github.com/plone/volto/issues/fix-glossary-terms)
|
|
35
|
+
|
|
36
|
+
### Internal
|
|
37
|
+
|
|
38
|
+
- Add Cypress test to cover deleting at end of Slate block when next block is empty. @aryan7081 [#7263](https://github.com/plone/volto/issues/7263)
|
|
39
|
+
|
|
40
|
+
### Documentation
|
|
41
|
+
|
|
42
|
+
- Added missing steps for `babel-preset-razzle` in the upgrade guide. @sneridagh
|
|
43
|
+
- Added missing upgrade steps for 19 projects. @sneridagh
|
|
44
|
+
|
|
20
45
|
## 19.0.0-alpha.13 (2025-11-12)
|
|
21
46
|
|
|
22
47
|
### Internal
|
package/babel.js
CHANGED
|
@@ -2,7 +2,7 @@ module.exports = function (api) {
|
|
|
2
2
|
api.cache(true);
|
|
3
3
|
const presets = [
|
|
4
4
|
[
|
|
5
|
-
'razzle/babel',
|
|
5
|
+
'@plone/razzle/babel',
|
|
6
6
|
{
|
|
7
7
|
'@babel/preset-react': { runtime: 'automatic' },
|
|
8
8
|
},
|
|
@@ -11,9 +11,7 @@ module.exports = function (api) {
|
|
|
11
11
|
const plugins = [
|
|
12
12
|
'lodash',
|
|
13
13
|
'@babel/plugin-proposal-export-default-from', // Stage 1
|
|
14
|
-
'@babel/plugin-syntax-export-namespace-from', // Stage 4
|
|
15
14
|
'@babel/plugin-proposal-throw-expressions', // Stage 2
|
|
16
|
-
'@babel/plugin-proposal-nullish-coalescing-operator', // Stage 4
|
|
17
15
|
[
|
|
18
16
|
'babel-plugin-root-import', // Required for the ~ imports to work
|
|
19
17
|
{
|
package/global-test-setup.js
CHANGED
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"version": "19.0.0-alpha.
|
|
12
|
+
"version": "19.0.0-alpha.14",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "git@github.com:plone/volto.git"
|
|
@@ -42,58 +42,6 @@
|
|
|
42
42
|
}
|
|
43
43
|
]
|
|
44
44
|
},
|
|
45
|
-
"jest": {
|
|
46
|
-
"transform": {
|
|
47
|
-
"^.+\\.js(x)?$": "babel-jest",
|
|
48
|
-
"^.+\\.ts(x)?$": "ts-jest",
|
|
49
|
-
"^.+\\.(png)$": "jest-file",
|
|
50
|
-
"^.+\\.(jpg)$": "jest-file",
|
|
51
|
-
"^.+\\.(svg)$": "./jest-svgsystem-transform.js"
|
|
52
|
-
},
|
|
53
|
-
"moduleNameMapper": {
|
|
54
|
-
"@plone/volto/package.json": "<rootDir>/package.json",
|
|
55
|
-
"@plone/volto/babel": "<rootDir>/babel.js",
|
|
56
|
-
"@plone/volto/(.*)$": "<rootDir>/src/$1",
|
|
57
|
-
"@plone/volto-slate/(.*)$": "<rootDir>/../volto-slate/src/$1",
|
|
58
|
-
"@plone/registry/addon-registry$": "<rootDir>/node_modules/@plone/registry/dist/addon-registry/addon-registry.js",
|
|
59
|
-
"@plone/registry/create-addons-loader$": "<rootDir>/node_modules/@plone/registry/dist/addon-registry/create-addons-loader.js",
|
|
60
|
-
"@plone/registry": "<rootDir>/../registry/src",
|
|
61
|
-
"@plone/registry/(.*)$": "<rootDir>/../registry/src/$1",
|
|
62
|
-
"@plone/volto": "<rootDir>/src/index.js",
|
|
63
|
-
"~/config": "<rootDir>/src/config",
|
|
64
|
-
"~/../locales/${lang}.json": "<rootDir>/locales/en.json",
|
|
65
|
-
"(.*)/locales/(.*)": "<rootDir>/locales/$2",
|
|
66
|
-
"load-volto-addons": "<rootDir>/jest-addons-loader.js",
|
|
67
|
-
"@package/(.*)$": "<rootDir>/src/$1",
|
|
68
|
-
"@root/config": "<rootDir>/jest-addons-loader.js",
|
|
69
|
-
"@root/(.*)$": "<rootDir>/src/$1",
|
|
70
|
-
"@voltoconfig": "<rootDir>/jest-addons-loader.js",
|
|
71
|
-
"\\.(css|less|scss|sass)$": "identity-obj-proxy"
|
|
72
|
-
},
|
|
73
|
-
"coverageThreshold": {
|
|
74
|
-
"global": {
|
|
75
|
-
"branches": 10,
|
|
76
|
-
"functions": 10,
|
|
77
|
-
"lines": 10,
|
|
78
|
-
"statements": 10
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
"setupFiles": [
|
|
82
|
-
"./test-setup-globals.js",
|
|
83
|
-
"./test-setup-config.jsx"
|
|
84
|
-
],
|
|
85
|
-
"globalSetup": "./global-test-setup.js",
|
|
86
|
-
"setupFilesAfterEnv": [
|
|
87
|
-
"<rootDir>/jest-setup-afterenv.js"
|
|
88
|
-
],
|
|
89
|
-
"globals": {
|
|
90
|
-
"__DEV__": true
|
|
91
|
-
},
|
|
92
|
-
"testMatch": [
|
|
93
|
-
"<rootDir>/__tests__/**/?(*.)(spec|test).{js,jsx,mjs,ts,tsx}",
|
|
94
|
-
"<rootDir>/../**/?(*.)(spec|test).{js,jsx,mjs,ts,tsx}"
|
|
95
|
-
]
|
|
96
|
-
},
|
|
97
45
|
"stylelint": {
|
|
98
46
|
"extends": [
|
|
99
47
|
"stylelint-config-idiomatic-order"
|
|
@@ -240,24 +188,19 @@
|
|
|
240
188
|
"url": "^0.11.3",
|
|
241
189
|
"use-deep-compare-effect": "1.8.1",
|
|
242
190
|
"uuid": "^8.3.2",
|
|
243
|
-
"@plone/components": "4.0.0-alpha.3",
|
|
244
191
|
"@plone/registry": "3.0.0-alpha.8",
|
|
245
|
-
"@plone/volto-slate": "19.0.0-alpha.
|
|
246
|
-
"@plone/scripts": "4.0.0-alpha.
|
|
192
|
+
"@plone/volto-slate": "19.0.0-alpha.8",
|
|
193
|
+
"@plone/scripts": "4.0.0-alpha.4",
|
|
194
|
+
"@plone/components": "4.0.0-alpha.4"
|
|
247
195
|
},
|
|
248
196
|
"devDependencies": {
|
|
249
|
-
"@babel/core": "^7.
|
|
250
|
-
"@babel/eslint-parser": "7.
|
|
251
|
-
"@babel/plugin-proposal-export-default-from": "7.
|
|
252
|
-
"@babel/plugin-proposal-
|
|
253
|
-
"@babel/
|
|
254
|
-
"@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6",
|
|
255
|
-
"@babel/plugin-proposal-throw-expressions": "7.18.6",
|
|
256
|
-
"@babel/plugin-syntax-export-namespace-from": "7.8.3",
|
|
257
|
-
"@babel/runtime": "7.20.6",
|
|
197
|
+
"@babel/core": "^7.28.5",
|
|
198
|
+
"@babel/eslint-parser": "^7.28.5",
|
|
199
|
+
"@babel/plugin-proposal-export-default-from": "^7.27.1",
|
|
200
|
+
"@babel/plugin-proposal-throw-expressions": "^7.27.1",
|
|
201
|
+
"@babel/runtime": "^7.28.4",
|
|
258
202
|
"@babel/types": "7.20.5",
|
|
259
203
|
"@fiverr/afterbuild-webpack-plugin": "^1.0.0",
|
|
260
|
-
"@jest/globals": "^29.7.0",
|
|
261
204
|
"@loadable/babel-plugin": "5.13.2",
|
|
262
205
|
"@loadable/webpack-plugin": "5.15.2",
|
|
263
206
|
"@sinonjs/fake-timers": "^6.0.1",
|
|
@@ -275,7 +218,6 @@
|
|
|
275
218
|
"@testing-library/react": "14.3.1",
|
|
276
219
|
"@testing-library/react-hooks": "8.0.1",
|
|
277
220
|
"@types/history": "^4.7.11",
|
|
278
|
-
"@types/jest": "^29.5.8",
|
|
279
221
|
"@types/loadable__component": "^5.13.9",
|
|
280
222
|
"@types/lodash": "^4.14.201",
|
|
281
223
|
"@types/node": "^24",
|
|
@@ -297,7 +239,6 @@
|
|
|
297
239
|
"babel-plugin-lodash": "3.3.4",
|
|
298
240
|
"babel-plugin-react-intl": "5.1.17",
|
|
299
241
|
"babel-plugin-root-import": "6.1.0",
|
|
300
|
-
"babel-preset-razzle": "4.2.18",
|
|
301
242
|
"bundlewatch": "0.3.3",
|
|
302
243
|
"circular-dependency-plugin": "5.2.2",
|
|
303
244
|
"css-loader": "5.2.7",
|
|
@@ -305,6 +246,7 @@
|
|
|
305
246
|
"cypress-axe": "1.7.0",
|
|
306
247
|
"cypress-file-upload": "5.0.8",
|
|
307
248
|
"deep-freeze": "0.0.1",
|
|
249
|
+
"deepmerge": "^4.2.2",
|
|
308
250
|
"eslint": "^8.57.0",
|
|
309
251
|
"eslint-config-prettier": "^9.1.2",
|
|
310
252
|
"eslint-config-react-app": "^7.0.1",
|
|
@@ -319,9 +261,6 @@
|
|
|
319
261
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
320
262
|
"html-webpack-plugin": "5.5.0",
|
|
321
263
|
"identity-obj-proxy": "3.0.0",
|
|
322
|
-
"jest": "26.6.3",
|
|
323
|
-
"jest-environment-jsdom": "^26",
|
|
324
|
-
"jest-file": "1.0.0",
|
|
325
264
|
"jiti": "^2.4.2",
|
|
326
265
|
"jsdom": "^16.7.0",
|
|
327
266
|
"jsonwebtoken": "9.0.0",
|
|
@@ -338,13 +277,14 @@
|
|
|
338
277
|
"postcss-overrides": "3.1.4",
|
|
339
278
|
"postcss-scss": "4.0.6",
|
|
340
279
|
"prettier": "3.2.5",
|
|
341
|
-
"razzle": "4.2.18",
|
|
342
280
|
"razzle-dev-utils": "4.2.18",
|
|
343
|
-
"razzle-plugin-scss": "4.2.18",
|
|
344
281
|
"react-docgen-typescript-plugin": "^1.0.5",
|
|
345
282
|
"react-error-overlay": "6.0.9",
|
|
346
283
|
"react-is": "^18.2.0",
|
|
347
284
|
"release-it": "^19.0.4",
|
|
285
|
+
"resolve-url-loader": "^3.1.2",
|
|
286
|
+
"sass": "1.32.0",
|
|
287
|
+
"sass-loader": "^10.0.3",
|
|
348
288
|
"semver": "^7.5.4",
|
|
349
289
|
"start-server-and-test": "1.14.0",
|
|
350
290
|
"storybook": "^8.0.4",
|
|
@@ -357,7 +297,6 @@
|
|
|
357
297
|
"svgo-loader": "3.0.3",
|
|
358
298
|
"terser-webpack-plugin": "5.3.6",
|
|
359
299
|
"tmp": "0.2.1",
|
|
360
|
-
"ts-jest": "^26.4.2",
|
|
361
300
|
"ts-loader": "9.4.4",
|
|
362
301
|
"typescript": "^5.7.3",
|
|
363
302
|
"use-trace-update": "1.3.2",
|
|
@@ -367,8 +306,10 @@
|
|
|
367
306
|
"webpack-bundle-analyzer": "4.10.1",
|
|
368
307
|
"webpack-dev-server": "4.11.1",
|
|
369
308
|
"webpack-node-externals": "3.0.0",
|
|
370
|
-
"@plone/types": "2.0.0-alpha.
|
|
371
|
-
"@plone/volto-coresandbox": "1.0.0"
|
|
309
|
+
"@plone/types": "2.0.0-alpha.11",
|
|
310
|
+
"@plone/volto-coresandbox": "1.0.0",
|
|
311
|
+
"@plone/razzle": "1.0.0-alpha.0",
|
|
312
|
+
"@plone/babel-preset-razzle": "^1.0.0-alpha.0"
|
|
372
313
|
},
|
|
373
314
|
"volta": {
|
|
374
315
|
"node": "20.9.0"
|
|
@@ -379,10 +320,9 @@
|
|
|
379
320
|
"start:coresandbox": "make build-deps && ADDONS=coresandbox razzle start",
|
|
380
321
|
"build": "make build-deps && razzle build --noninteractive",
|
|
381
322
|
"build:types": "tsc --project tsconfig.declarations.json",
|
|
382
|
-
"
|
|
323
|
+
"test": "vitest",
|
|
383
324
|
"coverage": "vitest run --coverage",
|
|
384
|
-
"test": "
|
|
385
|
-
"test:ci": "CI=true NODE_ICU_DATA=node_modules/full-icu razzle test",
|
|
325
|
+
"test:ci": "CI=true NODE_ICU_DATA=node_modules/full-icu vitest run",
|
|
386
326
|
"test:husky": "CI=true yarn test --bail --findRelatedTests",
|
|
387
327
|
"start:prod": "NODE_ENV=production node build/server.js",
|
|
388
328
|
"prettier": "prettier --single-quote --check '{src,cypress}/**/*.{js,jsx,ts,tsx}' --check '*.js'",
|
package/razzle.config.js
CHANGED
|
@@ -121,6 +121,7 @@ const defaultModify = ({
|
|
|
121
121
|
// Using the default provided (cssnano) by css-minimizer-webpack-plugin
|
|
122
122
|
// should be enough see:
|
|
123
123
|
// (https://github.com/clean-css/clean-css/discussions/1209)
|
|
124
|
+
// TODO: remove this before merging the Razzle fork into Volto 19
|
|
124
125
|
delete options.webpackOptions.terserPluginOptions?.sourceMap;
|
|
125
126
|
if (!dev) {
|
|
126
127
|
config.optimization = Object.assign({}, config.optimization, {
|
|
@@ -439,8 +440,7 @@ const defaultPlugins = [
|
|
|
439
440
|
{ object: require('./webpack-plugins/webpack-less-plugin')({ registry }) },
|
|
440
441
|
{ object: require('./webpack-plugins/webpack-svg-plugin') },
|
|
441
442
|
{ object: require('./webpack-plugins/webpack-bundle-analyze-plugin') },
|
|
442
|
-
{ object: require('./
|
|
443
|
-
'scss',
|
|
443
|
+
{ object: require('./webpack-plugins/webpack-scss-plugin') },
|
|
444
444
|
];
|
|
445
445
|
|
|
446
446
|
const plugins = addonExtenders.reduce(
|
|
@@ -8,11 +8,7 @@ import Actions from './Actions';
|
|
|
8
8
|
|
|
9
9
|
const mockStore = configureStore();
|
|
10
10
|
|
|
11
|
-
vi.mock('@plone/volto/components/manage/Contents'
|
|
12
|
-
return await import(
|
|
13
|
-
'@plone/volto/components/manage/Contents/__mocks__/index.vitest.tsx'
|
|
14
|
-
);
|
|
15
|
-
});
|
|
11
|
+
vi.mock('@plone/volto/components/manage/Contents');
|
|
16
12
|
|
|
17
13
|
describe('Actions', () => {
|
|
18
14
|
it('renders an actions component', () => {
|
|
@@ -7,11 +7,7 @@ import config from '@plone/volto/registry';
|
|
|
7
7
|
|
|
8
8
|
config.experimental = { addBlockButton: { enabled: false } };
|
|
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
|
-
});
|
|
10
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
15
11
|
|
|
16
12
|
beforeAll(async () => {
|
|
17
13
|
const { __setLoadables } = await import(
|
|
@@ -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
|
|
|
@@ -7,11 +7,7 @@ import Edit from './Edit';
|
|
|
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
|
-
});
|
|
10
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
15
11
|
|
|
16
12
|
beforeAll(async () => {
|
|
17
13
|
const { __setLoadables } = await import(
|
|
@@ -5,11 +5,7 @@ import { Provider } from 'react-intl-redux';
|
|
|
5
5
|
|
|
6
6
|
import ImageSidebar from './ImageSidebar';
|
|
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
|
|
|
@@ -6,11 +6,7 @@ import { Provider } from 'react-intl-redux';
|
|
|
6
6
|
import LeadImageSidebar from './LeadImageSidebar';
|
|
7
7
|
|
|
8
8
|
vi.mock('@plone/volto/components/manage/Widgets');
|
|
9
|
-
vi.mock('@plone/volto/components/manage/Widgets'
|
|
10
|
-
return await import(
|
|
11
|
-
'@plone/volto/components/manage/Widgets/__mocks__/index.vitest.tsx'
|
|
12
|
-
);
|
|
13
|
-
});
|
|
9
|
+
vi.mock('@plone/volto/components/manage/Widgets');
|
|
14
10
|
|
|
15
11
|
const mockStore = configureStore();
|
|
16
12
|
|
|
@@ -5,11 +5,7 @@ import { Provider } from 'react-intl-redux';
|
|
|
5
5
|
|
|
6
6
|
import MapsSidebar from './MapsSidebar';
|
|
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
|
|
|
@@ -6,12 +6,7 @@ import DateRangeFacet from './DateRangeFacet';
|
|
|
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 SelectFacet from './SelectFacet';
|
|
|
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'
|
|
@@ -5,11 +5,7 @@ import { Provider } from 'react-intl-redux';
|
|
|
5
5
|
|
|
6
6
|
import VideoSidebar from './VideoSidebar';
|
|
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
|
|
|
@@ -8,11 +8,7 @@ import { __test__ as Contents } from './Contents';
|
|
|
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
|
-
});
|
|
11
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
16
12
|
|
|
17
13
|
beforeAll(async () => {
|
|
18
14
|
const { __setLoadables } = await import(
|
|
@@ -7,11 +7,7 @@ import ContentsPropertiesModal from './ContentsPropertiesModal';
|
|
|
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('ContentsPropertiesModal', () => {
|
|
17
13
|
it('renders a contents properties modal component', () => {
|
|
@@ -7,11 +7,7 @@ import ContentsRenameModal from './ContentsRenameModal';
|
|
|
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('ContentsRenameModal', () => {
|
|
17
13
|
it('renders a contents rename modal component', () => {
|
|
@@ -7,11 +7,7 @@ import ContentsTagsModal from './ContentsTagsModal';
|
|
|
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('ContentsTagsModal', () => {
|
|
17
13
|
it('renders a contents tags modal component', () => {
|
|
@@ -7,11 +7,7 @@ import ContentsWorkflowModal from './ContentsWorkflowModal';
|
|
|
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('ContentsWorkflowModal', () => {
|
|
17
13
|
it('renders a contents workflow modal component', () => {
|
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Then, in the tests, we need to replace:
|
|
1
|
+
export const Contents = vi.fn(() => <div className="Contents" />);
|
|
3
2
|
|
|
4
|
-
vi.
|
|
5
|
-
return await import(
|
|
6
|
-
'@plone/volto/components/manage/Contents/__mocks__/index.vitest.tsx'
|
|
7
|
-
);
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
with the following:
|
|
11
|
-
|
|
12
|
-
vi.mock('@plone/volto/components/manage/Contents');
|
|
13
|
-
|
|
14
|
-
Finally, remove this comment.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
export const Contents = jest.fn(() => <div className="Contents" />);
|
|
18
|
-
|
|
19
|
-
export const ContentsRenameModal = jest.fn(() => (
|
|
3
|
+
export const ContentsRenameModal = vi.fn(() => (
|
|
20
4
|
<div className="ContentsRenameModal" />
|
|
21
5
|
));
|
|
@@ -10,11 +10,7 @@ import { MemoryRouter } from 'react-router';
|
|
|
10
10
|
const middlewares = [thunk];
|
|
11
11
|
const mockStore = configureMockStore(middlewares);
|
|
12
12
|
|
|
13
|
-
vi.mock('@plone/volto/components/manage/Widgets'
|
|
14
|
-
return await import(
|
|
15
|
-
'@plone/volto/components/manage/Widgets/__mocks__/index.vitest.tsx'
|
|
16
|
-
);
|
|
17
|
-
});
|
|
13
|
+
vi.mock('@plone/volto/components/manage/Widgets');
|
|
18
14
|
|
|
19
15
|
vi.mock('../../Toolbar/Toolbar', () => ({
|
|
20
16
|
default: vi.fn(() => <div id="Portal" />),
|
|
@@ -8,11 +8,7 @@ import ContentType from './ContentType';
|
|
|
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
|
vi.mock('../../Toolbar/Toolbar', () => ({
|
|
17
13
|
default: vi.fn(() => <div id="Portal" />),
|
|
18
14
|
}));
|
|
@@ -9,11 +9,7 @@ import AddRule from './AddRule';
|
|
|
9
9
|
const middlewares = [thunk];
|
|
10
10
|
const mockStore = configureMockStore(middlewares);
|
|
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="Toolbar" />),
|
|
@@ -13,11 +13,7 @@ vi.mock('../../Toolbar/Toolbar', () => ({
|
|
|
13
13
|
default: vi.fn(() => <div id="Portal" />),
|
|
14
14
|
}));
|
|
15
15
|
|
|
16
|
-
vi.mock('@plone/volto/components/manage/Form'
|
|
17
|
-
return await import(
|
|
18
|
-
'@plone/volto/components/manage/Form/__mocks__/index.vitest.tsx'
|
|
19
|
-
);
|
|
20
|
-
});
|
|
16
|
+
vi.mock('@plone/volto/components/manage/Form');
|
|
21
17
|
|
|
22
18
|
describe('EditRule', () => {
|
|
23
19
|
it('renders rules edit interface', () => {
|
|
@@ -7,11 +7,7 @@ import UndoControlpanel from './UndoControlpanel';
|
|
|
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
|
vi.mock('../../Toolbar/Toolbar', () => ({
|
|
16
12
|
default: vi.fn(() => <div id="Portal" />),
|
|
17
13
|
}));
|
|
@@ -12,12 +12,7 @@ vi.mock('../Toolbar/Toolbar', () => ({
|
|
|
12
12
|
default: vi.fn(() => <div id="Portal" />),
|
|
13
13
|
}));
|
|
14
14
|
|
|
15
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable'
|
|
16
|
-
return await import(
|
|
17
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
18
|
-
);
|
|
19
|
-
});
|
|
20
|
-
|
|
15
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
21
16
|
beforeAll(async () => {
|
|
22
17
|
const { __setLoadables } = await import(
|
|
23
18
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -4,12 +4,7 @@ import { Provider } from 'react-intl-redux';
|
|
|
4
4
|
import { waitFor, render, screen } from '@testing-library/react';
|
|
5
5
|
import DiffField from './DiffField';
|
|
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
|
-
|
|
7
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
13
8
|
beforeAll(async () => {
|
|
14
9
|
const { __setLoadables } = await import(
|
|
15
10
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -8,17 +8,8 @@ import Display from './Display';
|
|
|
8
8
|
|
|
9
9
|
const mockStore = configureStore();
|
|
10
10
|
|
|
11
|
-
vi.mock('@plone/volto/components/manage/Widgets'
|
|
12
|
-
|
|
13
|
-
'@plone/volto/components/manage/Widgets/__mocks__/index.vitest.tsx'
|
|
14
|
-
);
|
|
15
|
-
});
|
|
16
|
-
vi.mock('@plone/volto/helpers/Loadable/Loadable', async () => {
|
|
17
|
-
return await import(
|
|
18
|
-
'@plone/volto/helpers/Loadable/__mocks__/Loadable.vitest.jsx'
|
|
19
|
-
);
|
|
20
|
-
});
|
|
21
|
-
|
|
11
|
+
vi.mock('@plone/volto/components/manage/Widgets');
|
|
12
|
+
vi.mock('@plone/volto/helpers/Loadable/Loadable');
|
|
22
13
|
beforeAll(async () => {
|
|
23
14
|
const { __setLoadables } = await import(
|
|
24
15
|
'@plone/volto/helpers/Loadable/Loadable'
|
|
@@ -8,11 +8,7 @@ import { __test__ as Edit } from './Edit';
|
|
|
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
|
vi.mock('../Toolbar/Toolbar', () => ({
|
|
17
13
|
default: vi.fn(() => <div id="Portal" />),
|
|
18
14
|
}));
|