@plone/volto 18.12.0 → 18.12.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 CHANGED
@@ -17,6 +17,17 @@ myst:
17
17
 
18
18
  <!-- towncrier release notes start -->
19
19
 
20
+ ## 18.12.1 (2025-04-15)
21
+
22
+ ### Bugfix
23
+
24
+ - Fixed broken tests in add-ons in Volto 18.12.0. @Abhishek-17h [#6989](https://github.com/plone/volto/issues/6989)
25
+
26
+ ### Internal
27
+
28
+ - Removes make commands in root of repository whose packages no longer exist. @wesleybl [#6975](https://github.com/plone/volto/issues/6975)
29
+ - Use `Image` from `@plone/volto/components/theme/Image/Image` instead of `semantic-ui-react` in `ContentsUploadModal`. @wesleybl [#6982](https://github.com/plone/volto/issues/6982)
30
+
20
31
  ## 18.12.0 (2025-04-12)
21
32
 
22
33
  ### Feature
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  }
10
10
  ],
11
11
  "license": "MIT",
12
- "version": "18.12.0",
12
+ "version": "18.12.1",
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "git@github.com:plone/volto.git"
@@ -363,7 +363,7 @@
363
363
  "webpack-dev-server": "4.11.1",
364
364
  "webpack-node-externals": "3.0.0",
365
365
  "why": "0.6.2",
366
- "@plone/types": "1.3.2",
366
+ "@plone/types": "1.3.3",
367
367
  "@plone/volto-coresandbox": "1.0.0"
368
368
  },
369
369
  "volta": {
@@ -6,7 +6,6 @@ import {
6
6
  Dimmer,
7
7
  Header,
8
8
  Icon,
9
- Image,
10
9
  Modal,
11
10
  Table,
12
11
  Segment,
@@ -24,6 +23,7 @@ import FormattedRelativeDate from '@plone/volto/components/theme/FormattedDate/F
24
23
  import { createContent } from '@plone/volto/actions/content/content';
25
24
  import { validateFileUploadSize } from '@plone/volto/helpers/FormValidation/FormValidation';
26
25
  import { usePrevious } from '@plone/volto/helpers/Utils/usePrevious';
26
+ import Image from '@plone/volto/components/theme/Image/Image';
27
27
 
28
28
  const Dropzone = loadable(() => import('react-dropzone'));
29
29
 
@@ -259,7 +259,11 @@ const ContentsUploadModal = (props) => {
259
259
  <Table.Cell>{filesize(file.size, { round: 0 })}</Table.Cell>
260
260
  <Table.Cell>
261
261
  {file.type.split('/')[0] === 'image' && (
262
- <Image src={file.preview} height={60} />
262
+ <Image
263
+ src={file.preview}
264
+ height={60}
265
+ className="ui image"
266
+ />
263
267
  )}
264
268
  </Table.Cell>
265
269
  <Table.Cell>
@@ -1,4 +1,3 @@
1
- import { vi } from 'vitest';
2
1
  export const Contents = vi.fn(() => <div className="Contents" />);
3
2
 
4
3
  export const ContentsRenameModal = vi.fn(() => (
@@ -6,8 +6,6 @@ import { waitFor, render, screen } from '@testing-library/react';
6
6
 
7
7
  import Diff from './Diff';
8
8
 
9
- import { vi, beforeAll } from 'vitest';
10
-
11
9
  const mockStore = configureStore();
12
10
 
13
11
  vi.mock('../Toolbar/Toolbar', () => ({
@@ -1,6 +1,5 @@
1
1
  import type { JSONSchema } from '@plone/types';
2
2
  import type { Ref } from 'react';
3
- import { vi } from 'vitest';
4
3
  import { forwardRef } from 'react';
5
4
 
6
5
  const cleanupSchema = (schema: JSONSchema | null): JSONSchema | null => {
@@ -1,5 +1,3 @@
1
- import { vi } from 'vitest';
2
-
3
1
  export const AlignWidget = vi.fn(() => <div id="AlignWidget" />);
4
2
  export const ButtonsWidget = vi.fn(() => <div id="ButtonsWidget" />);
5
3
  export const ArrayWidget = vi.fn(() => <div id="ArrayWidget" />);
@@ -3,8 +3,6 @@ import renderer from 'react-test-renderer';
3
3
  import config from '@plone/volto/registry';
4
4
  import AppExtras from './AppExtras';
5
5
 
6
- import { vi } from 'vitest';
7
-
8
6
  beforeAll(() => {
9
7
  config.settings.appExtras = [
10
8
  {
@@ -1,6 +1,5 @@
1
1
  import config from '@plone/volto/registry';
2
2
  import Api from './Api';
3
- import { vi } from 'vitest';
4
3
 
5
4
  vi.mock('superagent', () => ({
6
5
  default: {
@@ -1,12 +1,6 @@
1
1
  // import superagent from 'superagent';
2
2
  import config from '@plone/volto/registry';
3
3
  import Api from './Api';
4
- import { vi } from 'vitest';
5
-
6
- // jest.mock('react-cookie', () => ({
7
- // load: jest.fn(() => 'token'),
8
- // }));
9
- //
10
4
 
11
5
  vi.mock('superagent', () => ({
12
6
  default: {
@@ -1,4 +1,3 @@
1
- import { describe, it, expect, vi, beforeEach } from 'vitest';
2
1
  import Cookies from 'universal-cookie';
3
2
  import jwt from 'jsonwebtoken';
4
3
  import jwtDecode from 'jwt-decode';
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import config from '@plone/volto/registry';
3
- import { vi } from 'vitest';
4
3
  const loadables = config.settings.loadables;
5
4
 
6
5
  let mockAllLoadables = Object.create(null);
@@ -0,0 +1,46 @@
1
+ import '@testing-library/jest-dom';
2
+ import { expect, describe, it, vi } from 'vitest';
3
+
4
+ global.describe = describe;
5
+ global.it = it;
6
+ global.expect = expect;
7
+ global.vi = vi;
8
+
9
+ global.__CLIENT__ = true;
10
+ global.__DEVELOPMENT__ = false;
11
+ global.__SERVER__ = false;
12
+ global.__TEST__ = true;
13
+
14
+ window.matchMedia =
15
+ window.matchMedia ||
16
+ function (query) {
17
+ return {
18
+ matches: query === '(min-width: 1024px)',
19
+ addListener: function () {},
20
+ removeListener: function () {},
21
+ };
22
+ };
23
+
24
+ vi.stubGlobal(
25
+ 'fetch',
26
+ vi.fn(() =>
27
+ Promise.resolve({
28
+ json: () => Promise.resolve({}),
29
+ text: () => Promise.resolve(''),
30
+ }),
31
+ ),
32
+ );
33
+
34
+ vi.stubGlobal('localStorage', {
35
+ getItem: vi.fn(),
36
+ setItem: vi.fn(),
37
+ removeItem: vi.fn(),
38
+ clear: vi.fn(),
39
+ });
40
+
41
+ vi.stubGlobal('sessionStorage', {
42
+ getItem: vi.fn(),
43
+ setItem: vi.fn(),
44
+ removeItem: vi.fn(),
45
+ clear: vi.fn(),
46
+ });
@@ -1,46 +1,12 @@
1
- import '@testing-library/jest-dom';
2
- import { expect, describe, it, vi } from 'vitest';
3
-
4
- global.describe = describe;
5
- global.it = it;
6
- global.expect = expect;
7
- global.vi = vi;
8
-
9
1
  global.__CLIENT__ = true;
10
2
  global.__DEVELOPMENT__ = false;
11
- global.__SERVER__ = false;
12
- global.__TEST__ = true;
13
3
 
14
4
  window.matchMedia =
15
5
  window.matchMedia ||
16
- function (query) {
6
+ function () {
17
7
  return {
18
- matches: query === '(min-width: 1024px)',
8
+ matches: false,
19
9
  addListener: function () {},
20
10
  removeListener: function () {},
21
11
  };
22
12
  };
23
-
24
- vi.stubGlobal(
25
- 'fetch',
26
- vi.fn(() =>
27
- Promise.resolve({
28
- json: () => Promise.resolve({}),
29
- text: () => Promise.resolve(''),
30
- }),
31
- ),
32
- );
33
-
34
- vi.stubGlobal('localStorage', {
35
- getItem: vi.fn(),
36
- setItem: vi.fn(),
37
- removeItem: vi.fn(),
38
- clear: vi.fn(),
39
- });
40
-
41
- vi.stubGlobal('sessionStorage', {
42
- getItem: vi.fn(),
43
- setItem: vi.fn(),
44
- removeItem: vi.fn(),
45
- clear: vi.fn(),
46
- });
@@ -10,6 +10,7 @@
10
10
  "jsx": "react-jsx",
11
11
  "preserveSymlinks": true,
12
12
  "downlevelIteration": true,
13
+ "types": ["vitest/globals"],
13
14
  "paths": {
14
15
  "@plone/volto/*": ["./src/*"],
15
16
  "react": ["./node_modules/@types/react"],
package/vitest.config.ts CHANGED
@@ -36,7 +36,7 @@ export default defineConfig({
36
36
  globals: true,
37
37
  environment: 'jsdom',
38
38
  setupFiles: [
39
- './test-setup-globals.js',
39
+ './test-setup-globals-vitest.js',
40
40
  './test-setup-config.jsx',
41
41
  './jest-setup-afterenv.js',
42
42
  './jest-addons-loader.js',