@plone/volto 18.32.4 → 18.33.1
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/CHANGELOG.md +43 -0
- package/locales/af/LC_MESSAGES/volto.po +12 -2
- package/locales/af.json +1 -1
- package/locales/ar/LC_MESSAGES/volto.po +12 -2
- package/locales/ar.json +1 -1
- package/locales/bg/LC_MESSAGES/volto.po +12 -2
- package/locales/bg.json +1 -1
- package/locales/bn/LC_MESSAGES/volto.po +12 -2
- package/locales/bn.json +1 -1
- package/locales/ca/LC_MESSAGES/volto.po +11 -1
- package/locales/ca.json +1 -1
- package/locales/cs/LC_MESSAGES/volto.po +12 -2
- package/locales/cs.json +1 -1
- package/locales/cy/LC_MESSAGES/volto.po +12 -2
- package/locales/cy.json +1 -1
- package/locales/da/LC_MESSAGES/volto.po +12 -2
- package/locales/da.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +11 -1
- package/locales/de.json +1 -1
- package/locales/el/LC_MESSAGES/volto.po +12 -2
- package/locales/el.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +12 -2
- package/locales/en.json +1 -1
- package/locales/en_AU/LC_MESSAGES/volto.po +12 -2
- package/locales/en_AU.json +1 -1
- package/locales/en_GB/LC_MESSAGES/volto.po +12 -2
- package/locales/en_GB.json +1 -1
- package/locales/eo/LC_MESSAGES/volto.po +12 -2
- package/locales/eo.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +24 -14
- package/locales/es.json +1 -1
- package/locales/et/LC_MESSAGES/volto.po +12 -2
- package/locales/et.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +23 -13
- package/locales/eu.json +1 -1
- package/locales/fa/LC_MESSAGES/volto.po +12 -2
- package/locales/fa.json +1 -1
- package/locales/fi/LC_MESSAGES/volto.po +11 -1
- package/locales/fi.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +11 -1
- package/locales/fr.json +1 -1
- package/locales/fu/LC_MESSAGES/volto.po +12 -2
- package/locales/fu.json +1 -1
- package/locales/gl/LC_MESSAGES/volto.po +1014 -1003
- package/locales/gl.json +1 -1
- package/locales/he/LC_MESSAGES/volto.po +12 -2
- package/locales/he.json +1 -1
- package/locales/hi/LC_MESSAGES/volto.po +11 -1
- package/locales/hi.json +1 -1
- package/locales/hr/LC_MESSAGES/volto.po +12 -2
- package/locales/hr.json +1 -1
- package/locales/hu/LC_MESSAGES/volto.po +12 -2
- package/locales/hu.json +1 -1
- package/locales/hy/LC_MESSAGES/volto.po +12 -2
- package/locales/hy.json +1 -1
- package/locales/id/LC_MESSAGES/volto.po +12 -2
- package/locales/id.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +14 -4
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +11 -1
- package/locales/ja.json +1 -1
- package/locales/ka/LC_MESSAGES/volto.po +12 -2
- package/locales/ka.json +1 -1
- package/locales/kn/LC_MESSAGES/volto.po +12 -2
- package/locales/kn.json +1 -1
- package/locales/ko/LC_MESSAGES/volto.po +12 -2
- package/locales/ko.json +1 -1
- package/locales/lt/LC_MESSAGES/volto.po +12 -2
- package/locales/lt.json +1 -1
- package/locales/lv/LC_MESSAGES/volto.po +12 -2
- package/locales/lv.json +1 -1
- package/locales/mi/LC_MESSAGES/volto.po +12 -2
- package/locales/mi.json +1 -1
- package/locales/mk/LC_MESSAGES/volto.po +12 -2
- package/locales/mk.json +1 -1
- package/locales/my/LC_MESSAGES/volto.po +12 -2
- package/locales/my.json +1 -1
- package/locales/nb_NO/LC_MESSAGES/volto.po +12 -2
- package/locales/nb_NO.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +26 -16
- package/locales/nl.json +1 -1
- package/locales/nn/LC_MESSAGES/volto.po +12 -2
- package/locales/nn.json +1 -1
- package/locales/pl/LC_MESSAGES/volto.po +12 -2
- package/locales/pl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +11 -1
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +11 -1
- package/locales/pt_BR.json +1 -1
- package/locales/rm/LC_MESSAGES/volto.po +12 -2
- package/locales/rm.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +11 -1
- package/locales/ro.json +1 -1
- package/locales/ru/LC_MESSAGES/volto.po +11 -1
- package/locales/ru.json +1 -1
- package/locales/sk/LC_MESSAGES/volto.po +12 -2
- package/locales/sk.json +1 -1
- package/locales/sl/LC_MESSAGES/volto.po +12 -2
- package/locales/sl.json +1 -1
- package/locales/sm/LC_MESSAGES/volto.po +12 -2
- package/locales/sm.json +1 -1
- package/locales/sq/LC_MESSAGES/volto.po +12 -2
- package/locales/sq.json +1 -1
- package/locales/sr/LC_MESSAGES/volto.po +12 -2
- package/locales/sr.json +1 -1
- package/locales/sr@cyrl/LC_MESSAGES/volto.po +12 -2
- package/locales/sr@cyrl.json +1 -1
- package/locales/sr@latn/LC_MESSAGES/volto.po +12 -2
- package/locales/sr@latn.json +1 -1
- package/locales/sv/LC_MESSAGES/volto.po +11 -1
- package/locales/sv.json +1 -1
- package/locales/ta/LC_MESSAGES/volto.po +11 -1
- package/locales/ta.json +1 -1
- package/locales/te/LC_MESSAGES/volto.po +12 -2
- package/locales/te.json +1 -1
- package/locales/th/LC_MESSAGES/volto.po +12 -2
- package/locales/th.json +1 -1
- package/locales/to/LC_MESSAGES/volto.po +12 -2
- package/locales/to.json +1 -1
- package/locales/tr/LC_MESSAGES/volto.po +37 -27
- package/locales/tr.json +1 -1
- package/locales/uk/LC_MESSAGES/volto.po +12 -2
- package/locales/uk.json +1 -1
- package/locales/vi/LC_MESSAGES/volto.po +12 -2
- package/locales/vi.json +1 -1
- package/locales/volto.pot +12 -2
- package/locales/zh_CN/LC_MESSAGES/volto.po +11 -1
- package/locales/zh_CN.json +1 -1
- package/locales/zh_Hant/LC_MESSAGES/volto.po +12 -2
- package/locales/zh_Hant.json +1 -1
- package/locales/zh_Hant_HK/LC_MESSAGES/volto.po +12 -2
- package/locales/zh_Hant_HK.json +1 -1
- package/package.json +13 -26
- package/razzle.config.js +20 -5
- package/src/components/manage/Add/Add.jsx +9 -6
- package/src/components/manage/Blocks/Title/Edit.jsx +5 -0
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx +4 -5
- package/src/components/manage/Controlpanels/Users/UsersControlpanel.test.jsx +57 -11
- package/src/components/manage/Multilingual/CompareLanguages.jsx +10 -10
- package/src/components/manage/Multilingual/CreateTranslation.jsx +8 -5
- package/src/components/manage/Multilingual/ManageTranslations.jsx +9 -7
- package/src/components/manage/Multilingual/TranslationObject.jsx +11 -8
- package/src/components/manage/Preferences/PersonalPreferences.jsx +8 -5
- package/src/components/manage/Sharing/Sharing.jsx +11 -3
- package/src/components/manage/Toolbar/Types.crash.test.jsx +46 -0
- package/src/components/manage/Toolbar/Types.jsx +9 -7
- package/src/components/manage/Widgets/FileWidget.jsx +7 -0
- package/src/components/manage/Widgets/RegistryImageWidget.jsx +1 -1
- package/src/components/theme/AlternateHrefLangs/AlternateHrefLangs.jsx +1 -0
- package/src/components/theme/AlternateHrefLangs/AlternateHrefLangs.test.jsx +30 -0
- package/src/components/theme/LanguageSelector/LanguageSelector.tsx +7 -5
- package/src/components/theme/MultilingualRedirector/MultilingualRedirector.jsx +12 -7
- package/src/express-middleware/devproxy.js +3 -1
- package/src/express-middleware/files.js +1 -0
- package/src/express-middleware/files.test.js +59 -0
- package/src/express-middleware/images.js +1 -0
- package/src/express-middleware/images.test.js +50 -0
- package/src/helpers/Blocks/Blocks.js +6 -6
- package/src/helpers/Utils/Utils.jsx +17 -0
- package/src/helpers/Utils/Utils.test.jsx +39 -0
- package/src/middleware/api.js +7 -3
- package/src/server.jsx +14 -12
- package/test-setup-globals-vitest.js +25 -0
- package/theme/themes/pastanaga/collections/form.overrides +1 -1
- package/theme/themes/pastanaga/elements/segment.variables +1 -1
- package/theme/themes/pastanaga/extras/widgets.less +17 -0
- package/types/components/manage/Toolbar/Types.crash.test.d.ts +1 -0
- package/types/helpers/Utils/Utils.d.ts +1 -0
- package/vitest.config.mjs +86 -40
|
@@ -3,6 +3,7 @@ import config from '@plone/volto/registry';
|
|
|
3
3
|
import {
|
|
4
4
|
applyConfig,
|
|
5
5
|
difference,
|
|
6
|
+
getErrorMessage,
|
|
6
7
|
getColor,
|
|
7
8
|
getInitials,
|
|
8
9
|
hasApiExpander,
|
|
@@ -246,6 +247,44 @@ describe('Utils tests', () => {
|
|
|
246
247
|
});
|
|
247
248
|
});
|
|
248
249
|
|
|
250
|
+
describe('getErrorMessage', () => {
|
|
251
|
+
it('returns nested backend error message', () => {
|
|
252
|
+
const error = {
|
|
253
|
+
response: {
|
|
254
|
+
body: {
|
|
255
|
+
error: {
|
|
256
|
+
message: 'Backend nested message',
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
expect(getErrorMessage(error)).toEqual('Backend nested message');
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
it('returns body message when present', () => {
|
|
266
|
+
const error = {
|
|
267
|
+
response: {
|
|
268
|
+
body: {
|
|
269
|
+
message: 'Backend body message',
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
expect(getErrorMessage(error)).toEqual('Backend body message');
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
it('returns generic error.message fallback', () => {
|
|
278
|
+
expect(getErrorMessage(new Error('Generic message'))).toEqual(
|
|
279
|
+
'Generic message',
|
|
280
|
+
);
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
it('returns stringified object as final fallback', () => {
|
|
284
|
+
expect(getErrorMessage({ foo: 'bar' })).toEqual('{"foo":"bar"}');
|
|
285
|
+
});
|
|
286
|
+
});
|
|
287
|
+
|
|
249
288
|
describe('safeWrapper', () => {
|
|
250
289
|
it('calls the function with config', () => {
|
|
251
290
|
expect(
|
package/src/middleware/api.js
CHANGED
|
@@ -251,9 +251,13 @@ const apiMiddlewareFactory =
|
|
|
251
251
|
const langFileName = toGettextLang(lang);
|
|
252
252
|
import(
|
|
253
253
|
/* @vite-ignore */ '@root/../locales/' + langFileName + '.json'
|
|
254
|
-
)
|
|
255
|
-
|
|
256
|
-
|
|
254
|
+
)
|
|
255
|
+
.then((locale) => {
|
|
256
|
+
dispatch(changeLanguage(lang, locale.default));
|
|
257
|
+
})
|
|
258
|
+
.catch(() => {
|
|
259
|
+
dispatch(changeLanguage(lang, {}));
|
|
260
|
+
});
|
|
257
261
|
}
|
|
258
262
|
}
|
|
259
263
|
|
package/src/server.jsx
CHANGED
|
@@ -8,7 +8,6 @@ import express from 'express';
|
|
|
8
8
|
import { renderToString } from 'react-dom/server';
|
|
9
9
|
import { createMemoryHistory } from 'history';
|
|
10
10
|
import { parse as parseUrl } from 'url';
|
|
11
|
-
import keys from 'lodash/keys';
|
|
12
11
|
import locale from 'locale';
|
|
13
12
|
import { detect } from 'detect-browser';
|
|
14
13
|
import path from 'path';
|
|
@@ -33,12 +32,8 @@ import {
|
|
|
33
32
|
import { changeLanguage } from '@plone/volto/actions/language/language';
|
|
34
33
|
|
|
35
34
|
import userSession from '@plone/volto/reducers/userSession/userSession';
|
|
36
|
-
|
|
37
|
-
import ErrorPage from '@plone/volto/error';
|
|
38
|
-
|
|
39
|
-
import languages from '@plone/volto/constants/Languages.cjs';
|
|
40
|
-
|
|
41
35
|
import configureStore from '@plone/volto/store';
|
|
36
|
+
import ErrorPage from '@plone/volto/error';
|
|
42
37
|
import { ReduxAsyncConnect, loadOnServer } from './helpers/AsyncConnect';
|
|
43
38
|
|
|
44
39
|
let locales = {};
|
|
@@ -46,11 +41,15 @@ let locales = {};
|
|
|
46
41
|
if (config.settings) {
|
|
47
42
|
config.settings.supportedLanguages.forEach((lang) => {
|
|
48
43
|
const langFileName = toGettextLang(lang);
|
|
49
|
-
import(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
import(/* @vite-ignore */ '@root/../locales/' + langFileName + '.json')
|
|
45
|
+
.then((locale) => {
|
|
46
|
+
locales = { ...locales, [toReactIntlLang(lang)]: locale.default };
|
|
47
|
+
})
|
|
48
|
+
.catch(() => {
|
|
49
|
+
debug('i18n')(
|
|
50
|
+
`Locale file for ${lang} not found, using empty messages.`,
|
|
51
|
+
);
|
|
52
|
+
});
|
|
54
53
|
});
|
|
55
54
|
}
|
|
56
55
|
|
|
@@ -58,7 +57,10 @@ function reactIntlErrorHandler(error) {
|
|
|
58
57
|
debug('i18n')(error);
|
|
59
58
|
}
|
|
60
59
|
|
|
61
|
-
const supported = new locale.Locales(
|
|
60
|
+
const supported = new locale.Locales(
|
|
61
|
+
config.settings.supportedLanguages,
|
|
62
|
+
config.settings.defaultLanguage,
|
|
63
|
+
);
|
|
62
64
|
|
|
63
65
|
const server = express()
|
|
64
66
|
.disable('x-powered-by')
|
|
@@ -44,3 +44,28 @@ vi.stubGlobal('sessionStorage', {
|
|
|
44
44
|
removeItem: vi.fn(),
|
|
45
45
|
clear: vi.fn(),
|
|
46
46
|
});
|
|
47
|
+
|
|
48
|
+
global.jest = {
|
|
49
|
+
fn: vi.fn.bind(vi),
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// Mock IntersectionObserver for Vitest
|
|
53
|
+
const IntersectionObserverMock = vi.fn((callback, options = {}) => {
|
|
54
|
+
const instance = {
|
|
55
|
+
thresholds: Array.isArray(options.threshold)
|
|
56
|
+
? options.threshold
|
|
57
|
+
: [options.threshold ?? 0],
|
|
58
|
+
root: options.root ?? null,
|
|
59
|
+
rootMargin: options.rootMargin ?? '',
|
|
60
|
+
observe: vi.fn(),
|
|
61
|
+
unobserve: vi.fn(),
|
|
62
|
+
disconnect: vi.fn(),
|
|
63
|
+
takeRecords: vi.fn(() => []),
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
return instance;
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
vi.stubGlobal('IntersectionObserver', IntersectionObserverMock);
|
|
70
|
+
global.IntersectionObserver = IntersectionObserverMock;
|
|
71
|
+
window.IntersectionObserver = IntersectionObserverMock;
|
|
@@ -280,6 +280,23 @@ body.babel-view .field.language-independent-field {
|
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
|
+
// FileWidget
|
|
284
|
+
.file-widget-dropzone {
|
|
285
|
+
.label-file-widget-input {
|
|
286
|
+
.visually-hidden {
|
|
287
|
+
position: absolute;
|
|
288
|
+
overflow: hidden;
|
|
289
|
+
width: 1px;
|
|
290
|
+
height: 1px;
|
|
291
|
+
padding: 0;
|
|
292
|
+
border: 0;
|
|
293
|
+
margin: -1px;
|
|
294
|
+
clip: rect(1px, 1px, 1px, 1px); /* IE-style CSS for compatibility */
|
|
295
|
+
white-space: nowrap;
|
|
296
|
+
word-wrap: normal;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
283
300
|
|
|
284
301
|
// ### FormFieldWrapper ###
|
|
285
302
|
.language-independent-field .wrapper > label {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -35,6 +35,7 @@ export function normalizeString(str: string): string;
|
|
|
35
35
|
*/
|
|
36
36
|
export function isInteractiveElement(element: node, interactiveElements?: string[]): boolean;
|
|
37
37
|
export function safeWrapper(func: Function): (config: any) => any;
|
|
38
|
+
export function getErrorMessage(error: object): string;
|
|
38
39
|
export function getInitials(title: any, limit: any): string;
|
|
39
40
|
export function getColor(name: any): any;
|
|
40
41
|
export function parseDateTime(locale: string, value: string, format: string, moment: any): any | string;
|
package/vitest.config.mjs
CHANGED
|
@@ -12,58 +12,103 @@ const __dirname = path.dirname(__filename);
|
|
|
12
12
|
|
|
13
13
|
const projectRoot = path.resolve(__dirname);
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
const sharedAliases = {
|
|
16
|
+
'@plone/volto': path.resolve(__dirname, 'src'),
|
|
17
|
+
'@plone/volto-slate': path.resolve(__dirname, '../volto-slate/src'),
|
|
18
|
+
'@root': path.resolve(__dirname, 'src'),
|
|
19
|
+
'@plone/components': path.resolve(__dirname, '../components/src'),
|
|
20
|
+
'promise-file-reader': require.resolve('promise-file-reader'),
|
|
21
|
+
'react-dropzone': require.resolve('react-dropzone'),
|
|
22
|
+
'prop-types': require.resolve('prop-types'),
|
|
23
|
+
'react-intl-redux': require.resolve('react-intl-redux'),
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// volto-slate specific aliases
|
|
27
|
+
const voltoSlateAliases = {
|
|
28
|
+
...sharedAliases,
|
|
29
|
+
'react-test-renderer': require.resolve('react-test-renderer'),
|
|
30
|
+
'redux': require.resolve('redux'),
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const sharedPlugins = [
|
|
34
|
+
react(),
|
|
35
|
+
svgLoader({
|
|
36
|
+
svgoConfig: {
|
|
37
|
+
plugins: [
|
|
38
|
+
{
|
|
39
|
+
name: 'preset-default',
|
|
40
|
+
params: {
|
|
41
|
+
overrides: {
|
|
42
|
+
convertPathData: false,
|
|
43
|
+
removeViewBox: false,
|
|
28
44
|
},
|
|
29
45
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}),
|
|
35
|
-
],
|
|
36
|
-
resolve: {
|
|
37
|
-
alias: {
|
|
38
|
-
'@plone/volto': path.resolve(__dirname, 'src'),
|
|
39
|
-
'@plone/volto-slate': path.resolve(__dirname, '../volto-slate/src'),
|
|
40
|
-
'@root': path.resolve(__dirname, 'src'),
|
|
41
|
-
'promise-file-reader': require.resolve('promise-file-reader'),
|
|
42
|
-
'react-dropzone': require.resolve('react-dropzone'),
|
|
43
|
-
'prop-types': require.resolve('prop-types'),
|
|
46
|
+
},
|
|
47
|
+
'removeTitle',
|
|
48
|
+
'removeUselessStrokeAndFill',
|
|
49
|
+
],
|
|
44
50
|
},
|
|
51
|
+
}),
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
export default defineConfig({
|
|
55
|
+
plugins: sharedPlugins,
|
|
56
|
+
resolve: {
|
|
57
|
+
alias: sharedAliases,
|
|
45
58
|
},
|
|
46
59
|
test: {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
projects: [
|
|
61
|
+
// Volto main project
|
|
62
|
+
{
|
|
63
|
+
test: {
|
|
64
|
+
name: 'volto',
|
|
65
|
+
root: '.',
|
|
66
|
+
isolate: true,
|
|
67
|
+
globals: true,
|
|
68
|
+
environment: 'jsdom',
|
|
69
|
+
setupFiles: [
|
|
70
|
+
`${projectRoot}/test-setup-globals-vitest.js`,
|
|
71
|
+
`${projectRoot}/test-setup-config.jsx`,
|
|
72
|
+
`${projectRoot}/jest-setup-afterenv.js`,
|
|
73
|
+
`${projectRoot}/jest-addons-loader.js`,
|
|
74
|
+
],
|
|
75
|
+
globalSetup: `${projectRoot}/global-test-setup.js`,
|
|
76
|
+
},
|
|
77
|
+
resolve: {
|
|
78
|
+
alias: sharedAliases,
|
|
79
|
+
},
|
|
80
|
+
plugins: sharedPlugins,
|
|
81
|
+
},
|
|
82
|
+
// volto-slate project
|
|
83
|
+
{
|
|
84
|
+
test: {
|
|
85
|
+
name: 'volto-slate',
|
|
86
|
+
root: '../volto-slate',
|
|
87
|
+
isolate: true,
|
|
88
|
+
globals: true,
|
|
89
|
+
environment: 'jsdom',
|
|
90
|
+
setupFiles: [
|
|
91
|
+
`${projectRoot}/test-setup-globals-vitest.js`,
|
|
92
|
+
`${projectRoot}/test-setup-config.jsx`,
|
|
93
|
+
`${projectRoot}/jest-setup-afterenv.js`,
|
|
94
|
+
`${projectRoot}/jest-addons-loader.js`,
|
|
95
|
+
],
|
|
96
|
+
globalSetup: `${projectRoot}/global-test-setup.js`,
|
|
97
|
+
},
|
|
98
|
+
resolve: {
|
|
99
|
+
alias: voltoSlateAliases,
|
|
100
|
+
},
|
|
101
|
+
plugins: sharedPlugins,
|
|
102
|
+
},
|
|
59
103
|
],
|
|
60
|
-
|
|
104
|
+
snapshotFormat: { printBasicPrototype: false },
|
|
61
105
|
coverage: {
|
|
62
106
|
provider: 'v8',
|
|
63
107
|
reporter: ['text', 'json', 'html'],
|
|
64
108
|
include: [
|
|
65
109
|
'src/**/*.{test,spec}.{js,ts,jsx,tsx}',
|
|
66
110
|
'__test__/**/*.{test,spec}.{js,ts,jsx,tsx}',
|
|
111
|
+
'../volto-slate/src/**/*.{test,spec}.{js,ts,jsx,tsx}',
|
|
67
112
|
],
|
|
68
113
|
exclude: [
|
|
69
114
|
'node_modules/**',
|
|
@@ -75,3 +120,4 @@ export default defineConfig({
|
|
|
75
120
|
css: true,
|
|
76
121
|
},
|
|
77
122
|
});
|
|
123
|
+
|