@eeacms/volto-eea-website-theme 1.22.0 → 1.23.0
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 +29 -1
- package/DEVELOP.md +6 -7
- package/README.md +20 -20
- package/RELEASE.md +14 -14
- package/jest-addon.config.js +3 -0
- package/package.json +3 -3
- package/src/config.js +27 -15
- package/src/customizations/@plone/volto-slate/editor/extensions/normalizeExternalData.js +9 -0
- package/src/customizations/volto/components/manage/Blocks/Image/Edit.test.jsx +312 -0
- package/src/customizations/volto/components/manage/Form/Form.test.jsx +1124 -0
- package/src/customizations/volto/components/manage/Widgets/ObjectBrowserWidget.test.jsx +193 -0
- package/src/customizations/volto/components/theme/Comments/Comments.test.jsx +407 -0
- package/src/customizations/volto/components/theme/Header/Header.test.jsx +326 -0
- package/src/index.js +90 -15
- package/src/index.test.js +343 -0
- package/src/customizations/@eeacms/volto-tabs-block/components/templates/default/schema.js +0 -109
- package/src/customizations/@eeacms/volto-tabs-block/components/templates/horizontal-responsive/schema.js +0 -109
package/CHANGELOG.md
CHANGED
@@ -4,7 +4,35 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
4
4
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
6
6
|
|
7
|
-
### [1.
|
7
|
+
### [1.23.0](https://github.com/eea/volto-eea-website-theme/compare/1.22.1...1.23.0) - 2 November 2023
|
8
|
+
|
9
|
+
#### :rocket: New Features
|
10
|
+
|
11
|
+
- feat(header): updated environmental information systems websites #251860 [David Ichim - [`647a818`](https://github.com/eea/volto-eea-website-theme/commit/647a818cefc9b24464e282e1ff31b9bc56a01d55)]
|
12
|
+
|
13
|
+
#### :bug: Bug Fixes
|
14
|
+
|
15
|
+
- fix: customize normalizeExternalData until the #5347 is merged in volto core - refs #259857 [dobri1408 - [`19c88a9`](https://github.com/eea/volto-eea-website-theme/commit/19c88a9910646f166e6317a86c6b0ad759b1bd12)]
|
16
|
+
|
17
|
+
#### :house: Internal changes
|
18
|
+
|
19
|
+
- chore: husky, lint-staged use fixed versions [valentinab25 - [`6d15088`](https://github.com/eea/volto-eea-website-theme/commit/6d150886c5aeb2ca0b569270486e60f7cc274e2c)]
|
20
|
+
- chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`20c0323`](https://github.com/eea/volto-eea-website-theme/commit/20c032380b33c0077c869a05136f93e2fb68e5d4)]
|
21
|
+
|
22
|
+
#### :hammer_and_wrench: Others
|
23
|
+
|
24
|
+
- bump package version preparing for release [David Ichim - [`cb88e7c`](https://github.com/eea/volto-eea-website-theme/commit/cb88e7c64bb5ac307504e80203ef03dde9420922)]
|
25
|
+
- Moved function to top and added jsdoc [David Ichim - [`2fe74e3`](https://github.com/eea/volto-eea-website-theme/commit/2fe74e332c51caf6f2571b19a75c74174925a3e4)]
|
26
|
+
- Tab variations only if we have variation support [David Ichim - [`f086102`](https://github.com/eea/volto-eea-website-theme/commit/f086102fce8ef103e5d18907a58c1b84f9b7f4e8)]
|
27
|
+
- * test: add unit tests - refs #254313 [ana-oprea - [`a14ecb4`](https://github.com/eea/volto-eea-website-theme/commit/a14ecb4f1b40fad88787041658a126a4a2bb69f9)]
|
28
|
+
### [1.22.1](https://github.com/eea/volto-eea-website-theme/compare/1.22.0...1.22.1) - 29 September 2023
|
29
|
+
|
30
|
+
#### :house: Documentation changes
|
31
|
+
|
32
|
+
- docs: Update README and DEVELOP [Alin Voinea - [`d0a8655`](https://github.com/eea/volto-eea-website-theme/commit/d0a86555904b43cdc477bc745989b819ab0e86b4)]
|
33
|
+
- docs: Update README and add demo gifs [Alin Voinea - [`ad00749`](https://github.com/eea/volto-eea-website-theme/commit/ad007497c063e0c46d444df9ecb54858add23682)]
|
34
|
+
|
35
|
+
### [1.22.0](https://github.com/eea/volto-eea-website-theme/compare/1.21.0...1.22.0) - 27 September 2023
|
8
36
|
|
9
37
|
#### :rocket: New Features
|
10
38
|
|
package/DEVELOP.md
CHANGED
@@ -16,12 +16,14 @@
|
|
16
16
|
|
17
17
|
1. Go to http://localhost:3000
|
18
18
|
|
19
|
-
1.
|
19
|
+
1. Initialize git hooks
|
20
20
|
|
21
21
|
```Bash
|
22
|
-
|
22
|
+
yarn prepare
|
23
23
|
```
|
24
24
|
|
25
|
+
1. Happy hacking!
|
26
|
+
|
25
27
|
### Or add @eeacms/volto-eea-website-theme to your Volto project
|
26
28
|
|
27
29
|
Before starting make sure your development environment is properly set. See [Volto Developer Documentation](https://docs.voltocms.com/getting-started/install/)
|
@@ -48,18 +50,15 @@ Before starting make sure your development environment is properly set. See [Vol
|
|
48
50
|
|
49
51
|
1. Install
|
50
52
|
|
51
|
-
|
53
|
+
make develop
|
52
54
|
yarn
|
53
55
|
|
54
56
|
1. Start backend
|
55
57
|
|
56
|
-
docker pull plone
|
57
|
-
docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" plone
|
58
|
+
docker run --pull always -it --rm --name plone -p 8080:8080 -e SITE=Plone plone/plone-backend
|
58
59
|
|
59
60
|
...wait for backend to setup and start - `Ready to handle requests`:
|
60
61
|
|
61
|
-
docker logs -f plone
|
62
|
-
|
63
62
|
...you can also check http://localhost:8080/Plone
|
64
63
|
|
65
64
|
1. Start frontend
|
package/README.md
CHANGED
@@ -20,6 +20,11 @@ EEA Website [Volto](https://github.com/plone/volto) Theme
|
|
20
20
|
|
21
21
|
- https://www.eea.europa.eu
|
22
22
|
|
23
|
+
## Docusaurus and Storybook
|
24
|
+
|
25
|
+
See [Docusaurus](https://eea.github.io/).
|
26
|
+
See [Storybook](https://eea.github.io/eea-storybook/).
|
27
|
+
|
23
28
|
## Getting started
|
24
29
|
|
25
30
|
### Try volto-eea-website-theme with Docker
|
@@ -41,25 +46,25 @@ Go to http://localhost:3000
|
|
41
46
|
|
42
47
|
1. Start Volto frontend
|
43
48
|
|
44
|
-
|
49
|
+
* If you already have a volto project, just update `package.json`:
|
45
50
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
51
|
+
```JSON
|
52
|
+
"addons": [
|
53
|
+
"@eeacms/volto-eea-website-theme"
|
54
|
+
],
|
50
55
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
56
|
+
"dependencies": {
|
57
|
+
"@eeacms/volto-eea-website-theme": "*"
|
58
|
+
}
|
59
|
+
```
|
55
60
|
|
56
|
-
|
61
|
+
* If not, create one:
|
57
62
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
+
```
|
64
|
+
npm install -g yo @plone/generator-volto
|
65
|
+
yo @plone/volto my-volto-project --canary --addon @eeacms/volto-eea-website-theme
|
66
|
+
cd my-volto-project
|
67
|
+
```
|
63
68
|
|
64
69
|
1. Install new add-ons and restart Volto:
|
65
70
|
|
@@ -80,11 +85,6 @@ See [RELEASE.md](https://github.com/eea/volto-eea-website-theme/blob/master/RELE
|
|
80
85
|
|
81
86
|
See [DEVELOP.md](https://github.com/eea/volto-eea-website-theme/blob/master/DEVELOP.md).
|
82
87
|
|
83
|
-
## Docusaurus and Storybook
|
84
|
-
|
85
|
-
See [Docusaurus](https://eea.github.io/).
|
86
|
-
See [Storybook](https://eea.github.io/eea-storybook/).
|
87
|
-
|
88
88
|
## Copyright and license
|
89
89
|
|
90
90
|
The Initial Owner of the Original Code is European Environment Agency (EEA).
|
package/RELEASE.md
CHANGED
@@ -20,9 +20,9 @@ You need to first install the [release-it](https://github.com/release-it/release
|
|
20
20
|
```
|
21
21
|
npm install -g release-it
|
22
22
|
```
|
23
|
-
|
23
|
+
|
24
24
|
Release-it uses the configuration written in the [`.release-it.json`](./.release-it.json) file located in the root of the repository.
|
25
|
-
|
25
|
+
|
26
26
|
Release-it is a tool that automates 4 important steps in the release process:
|
27
27
|
|
28
28
|
1. Version increase in `package.json` ( increased from the current version in `package.json`)
|
@@ -30,45 +30,45 @@ Release-it is a tool that automates 4 important steps in the release process:
|
|
30
30
|
3. GitHub release on the commit with the changelog and package.json modification on the develop branch
|
31
31
|
4. NPM release ( by default it's disabled, but can be enabled in the configuration file )
|
32
32
|
|
33
|
-
To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
|
33
|
+
To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
|
34
34
|
|
35
35
|
```
|
36
36
|
export GITHUB_TOKEN=XXX-XXXXXXXXXXXXXXXXXXXXXX
|
37
37
|
```
|
38
|
-
|
38
|
+
|
39
39
|
To configure npm, you can use the `npm login` command or use a configuration file with a TOKEN :
|
40
|
-
|
40
|
+
|
41
41
|
```
|
42
42
|
echo "//registry.npmjs.org/:_authToken=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" > .npmrc
|
43
43
|
```
|
44
44
|
|
45
45
|
#### Using release-it tool
|
46
|
-
|
46
|
+
|
47
47
|
There are 3 yarn scripts that can be run to do the release
|
48
48
|
|
49
49
|
##### yarn release-beta
|
50
50
|
|
51
|
-
Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
|
51
|
+
Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
|
52
52
|
|
53
53
|
```
|
54
|
-
? Select increment (next version):
|
55
|
-
❯ prepatch (0.1.1-beta.0)
|
56
|
-
preminor (0.2.0-beta.0)
|
57
|
-
premajor (1.0.0-beta.0)
|
58
|
-
Other, please specify...
|
54
|
+
? Select increment (next version):
|
55
|
+
❯ prepatch (0.1.1-beta.0)
|
56
|
+
preminor (0.2.0-beta.0)
|
57
|
+
premajor (1.0.0-beta.0)
|
58
|
+
Other, please specify...
|
59
59
|
```
|
60
60
|
|
61
61
|
##### yarn release-major-beta
|
62
62
|
|
63
63
|
Same as `yarn release-beta`, but with premajor version pre-selected.
|
64
|
-
|
64
|
+
|
65
65
|
##### yarn release
|
66
66
|
|
67
67
|
Generic command, does not automatically add the `beta` to version, but you can still manually write it if you choose Other.
|
68
68
|
|
69
69
|
#### Important notes
|
70
70
|
|
71
|
-
> Do not use release-it tool on master branch, the commit on CHANGELOG.md file and the version increase in the package.json file can't be done without a PULL REQUEST.
|
71
|
+
> Do not use release-it tool on master branch, the commit on CHANGELOG.md file and the version increase in the package.json file can't be done without a PULL REQUEST.
|
72
72
|
|
73
73
|
> Do not keep Pull Requests from develop to master branches open when you are doing beta releases from the develop branch. As long as a PR to master is open, an automatic script will run on every commit and will update both the version and the changelog to a production-ready state - ( MAJOR.MINOR.PATCH mandatory format for version).
|
74
74
|
|
package/jest-addon.config.js
CHANGED
@@ -25,6 +25,9 @@ module.exports = {
|
|
25
25
|
'^.+\\.(jpg)$': 'jest-file',
|
26
26
|
'^.+\\.(svg)$': './node_modules/@plone/volto/jest-svgsystem-transform.js',
|
27
27
|
},
|
28
|
+
transformIgnorePatterns: [
|
29
|
+
'node_modules/(?!@eeacms)/volto-eea-design-system/ui',
|
30
|
+
],
|
28
31
|
coverageThreshold: {
|
29
32
|
global: {
|
30
33
|
branches: 0,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@eeacms/volto-eea-website-theme",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.23.0",
|
4
4
|
"description": "@eeacms/volto-eea-website-theme: Volto add-on",
|
5
5
|
"main": "src/index.js",
|
6
6
|
"author": "European Environment Agency: IDM2 A-Team",
|
@@ -31,8 +31,8 @@
|
|
31
31
|
"@cypress/code-coverage": "^3.10.0",
|
32
32
|
"@plone/scripts": "*",
|
33
33
|
"babel-plugin-transform-class-properties": "^6.24.1",
|
34
|
-
"husky": "
|
35
|
-
"lint-staged": "
|
34
|
+
"husky": "^8.0.3",
|
35
|
+
"lint-staged": "^14.0.1",
|
36
36
|
"md5": "^2.3.0",
|
37
37
|
"postcss-less": "6.0.0"
|
38
38
|
},
|
package/src/config.js
CHANGED
@@ -194,36 +194,48 @@ export const headerOpts = {
|
|
194
194
|
title: 'Environmental information systems',
|
195
195
|
links: [
|
196
196
|
{
|
197
|
-
title: '
|
198
|
-
href: 'https://
|
197
|
+
title: 'European Environment Agency website',
|
198
|
+
href: 'https://www.eea.europa.eu',
|
199
199
|
},
|
200
200
|
{
|
201
|
-
title: '
|
202
|
-
href: 'https://
|
201
|
+
title: 'WISE marine - Marine information system for Europe',
|
202
|
+
href: 'https://water.europa.eu/marine',
|
203
203
|
},
|
204
204
|
{
|
205
|
-
title: '
|
206
|
-
href: 'https://
|
205
|
+
title: 'WISE freshwater - Freshwater information system for Europe',
|
206
|
+
href: 'https://water.europa.eu/freshwater',
|
207
207
|
},
|
208
208
|
{
|
209
|
-
title: '
|
210
|
-
href: 'https://
|
209
|
+
title: 'BISE - Biodiversity information system for Europe',
|
210
|
+
href: 'https://biodiversity.europa.eu',
|
211
211
|
},
|
212
212
|
{
|
213
|
-
title: 'Forest
|
213
|
+
title: 'FISE - Forest information system for Europe',
|
214
214
|
href: 'https://forest.eea.europa.eu/',
|
215
215
|
},
|
216
216
|
{
|
217
|
-
title: '
|
218
|
-
href: 'https://
|
217
|
+
title: 'European Climate and health observatory',
|
218
|
+
href: 'https://climate-adapt.eea.europa.eu/en/observatory',
|
219
219
|
},
|
220
220
|
{
|
221
|
-
title: '
|
222
|
-
href: 'https://
|
221
|
+
title: 'ClimateADAPT',
|
222
|
+
href: 'https://climate-adapt.eea.europa.eu/',
|
223
223
|
},
|
224
224
|
{
|
225
|
-
title: '
|
226
|
-
href: 'https://
|
225
|
+
title: 'European Industrial Emissions Portal',
|
226
|
+
href: 'https://industry.eea.europa.eu',
|
227
|
+
},
|
228
|
+
{
|
229
|
+
title: 'Climate and energy in the EU',
|
230
|
+
href: 'https://climate-energy.eea.europa.eu',
|
231
|
+
},
|
232
|
+
{
|
233
|
+
title: 'Copernicus Land Monitoring Service',
|
234
|
+
href: 'https://land.copernicus.eu/en',
|
235
|
+
},
|
236
|
+
{
|
237
|
+
title: 'Copernicus InSitu',
|
238
|
+
href: 'https://insitu.copernicus.eu',
|
227
239
|
},
|
228
240
|
],
|
229
241
|
},
|
@@ -0,0 +1,9 @@
|
|
1
|
+
// To be removed when https://github.com/plone/volto/pull/5347 is merged and released in Volto 16.x
|
2
|
+
import { normalizeExternalData as normalize } from '@plone/volto-slate/utils';
|
3
|
+
|
4
|
+
export function normalizeExternalData(editor) {
|
5
|
+
editor.normalizeExternalData = (fragment) => {
|
6
|
+
return normalize(editor, fragment);
|
7
|
+
};
|
8
|
+
return editor;
|
9
|
+
}
|
@@ -0,0 +1,312 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { render } from '@testing-library/react';
|
3
|
+
import { Provider } from 'react-intl-redux';
|
4
|
+
import configureMockStore from 'redux-mock-store';
|
5
|
+
import Edit from './Edit';
|
6
|
+
import config from '@plone/volto/registry';
|
7
|
+
import '@testing-library/jest-dom/extend-expect';
|
8
|
+
|
9
|
+
const mockStore = configureMockStore();
|
10
|
+
const { settings } = config;
|
11
|
+
|
12
|
+
let store;
|
13
|
+
|
14
|
+
config.blocks.blocksConfig = {
|
15
|
+
image: {
|
16
|
+
id: 'image',
|
17
|
+
title: 'Image',
|
18
|
+
group: 'media',
|
19
|
+
extensions: {},
|
20
|
+
variations: [],
|
21
|
+
restricted: false,
|
22
|
+
mostUsed: true,
|
23
|
+
sidebarTab: 1,
|
24
|
+
security: {
|
25
|
+
addPermission: [],
|
26
|
+
view: [],
|
27
|
+
},
|
28
|
+
},
|
29
|
+
};
|
30
|
+
const blockId = '1234';
|
31
|
+
|
32
|
+
describe('Edit', () => {
|
33
|
+
beforeEach(() => {
|
34
|
+
store = mockStore({
|
35
|
+
content: {
|
36
|
+
create: {},
|
37
|
+
data: {},
|
38
|
+
subrequests: {
|
39
|
+
[blockId]: {},
|
40
|
+
},
|
41
|
+
},
|
42
|
+
intl: {
|
43
|
+
locale: 'en',
|
44
|
+
messages: {},
|
45
|
+
},
|
46
|
+
});
|
47
|
+
});
|
48
|
+
|
49
|
+
it('should render without errors', () => {
|
50
|
+
const { container } = render(
|
51
|
+
<Provider store={store}>
|
52
|
+
<Edit
|
53
|
+
data={{
|
54
|
+
url: 'http://localhost:8080/Plone/image',
|
55
|
+
'@type': 'image',
|
56
|
+
align: 'full',
|
57
|
+
}}
|
58
|
+
selected={false}
|
59
|
+
block={blockId}
|
60
|
+
content={{}}
|
61
|
+
request={{
|
62
|
+
loading: false,
|
63
|
+
loaded: false,
|
64
|
+
}}
|
65
|
+
pathname="/news"
|
66
|
+
onChangeBlock={() => {}}
|
67
|
+
onSelectBlock={() => {}}
|
68
|
+
onDeleteBlock={() => {}}
|
69
|
+
createContent={() => {}}
|
70
|
+
onFocusPreviousBlock={() => {}}
|
71
|
+
onFocusNextBlock={() => {}}
|
72
|
+
handleKeyDown={() => {}}
|
73
|
+
index={1}
|
74
|
+
openObjectBrowser={() => {}}
|
75
|
+
/>
|
76
|
+
</Provider>,
|
77
|
+
);
|
78
|
+
|
79
|
+
settings.internalApiPath = 'http://localhost:8080/Plone';
|
80
|
+
|
81
|
+
expect(container.querySelector('.block.image.align')).toBeInTheDocument();
|
82
|
+
expect(
|
83
|
+
container.querySelector('.image-block-container'),
|
84
|
+
).toBeInTheDocument();
|
85
|
+
expect(container.querySelector('.copyright-wrapper')).toBeInTheDocument();
|
86
|
+
});
|
87
|
+
|
88
|
+
it('should render without errors', () => {
|
89
|
+
const { container } = render(
|
90
|
+
<Provider store={store}>
|
91
|
+
<Edit
|
92
|
+
data={{
|
93
|
+
url: 'http://localhost:8080/Plone/image',
|
94
|
+
'@type': 'image',
|
95
|
+
size: 'l',
|
96
|
+
copyright: 'Copyright',
|
97
|
+
}}
|
98
|
+
selected={false}
|
99
|
+
block={blockId}
|
100
|
+
content={{}}
|
101
|
+
request={{
|
102
|
+
loading: false,
|
103
|
+
loaded: false,
|
104
|
+
}}
|
105
|
+
pathname="/news"
|
106
|
+
onChangeBlock={() => {}}
|
107
|
+
onSelectBlock={() => {}}
|
108
|
+
onDeleteBlock={() => {}}
|
109
|
+
createContent={() => {}}
|
110
|
+
onFocusPreviousBlock={() => {}}
|
111
|
+
onFocusNextBlock={() => {}}
|
112
|
+
handleKeyDown={() => {}}
|
113
|
+
index={1}
|
114
|
+
openObjectBrowser={() => {}}
|
115
|
+
/>
|
116
|
+
</Provider>,
|
117
|
+
);
|
118
|
+
|
119
|
+
settings.internalApiPath = 'http://localhost:8080/Plone';
|
120
|
+
|
121
|
+
expect(container.querySelector('.block.image.align')).toBeInTheDocument();
|
122
|
+
expect(
|
123
|
+
container.querySelector('.image-block-container'),
|
124
|
+
).toBeInTheDocument();
|
125
|
+
expect(container.querySelector('.copyright-wrapper')).toBeInTheDocument();
|
126
|
+
});
|
127
|
+
|
128
|
+
it('should render without errors', () => {
|
129
|
+
const { container } = render(
|
130
|
+
<Provider store={store}>
|
131
|
+
<Edit
|
132
|
+
data={{
|
133
|
+
url: 'http://localhost:8080/Plone/image',
|
134
|
+
'@type': 'image',
|
135
|
+
size: 'm',
|
136
|
+
}}
|
137
|
+
selected={false}
|
138
|
+
block={blockId}
|
139
|
+
content={{}}
|
140
|
+
request={{
|
141
|
+
loading: false,
|
142
|
+
loaded: false,
|
143
|
+
}}
|
144
|
+
pathname="/news"
|
145
|
+
onChangeBlock={() => {}}
|
146
|
+
onSelectBlock={() => {}}
|
147
|
+
onDeleteBlock={() => {}}
|
148
|
+
createContent={() => {}}
|
149
|
+
onFocusPreviousBlock={() => {}}
|
150
|
+
onFocusNextBlock={() => {}}
|
151
|
+
handleKeyDown={() => {}}
|
152
|
+
index={1}
|
153
|
+
openObjectBrowser={() => {}}
|
154
|
+
/>
|
155
|
+
</Provider>,
|
156
|
+
);
|
157
|
+
|
158
|
+
settings.internalApiPath = 'http://localhost:8080/Plone';
|
159
|
+
|
160
|
+
expect(container.querySelector('.block.image.align')).toBeInTheDocument();
|
161
|
+
expect(
|
162
|
+
container.querySelector('.image-block-container'),
|
163
|
+
).toBeInTheDocument();
|
164
|
+
expect(container.querySelector('.copyright-wrapper')).toBeInTheDocument();
|
165
|
+
});
|
166
|
+
|
167
|
+
it('should render without errors', () => {
|
168
|
+
const { container } = render(
|
169
|
+
<Provider store={store}>
|
170
|
+
<Edit
|
171
|
+
data={{
|
172
|
+
url: 'http://localhost:8080/Plone/image',
|
173
|
+
'@type': 'image',
|
174
|
+
size: 's',
|
175
|
+
}}
|
176
|
+
selected={false}
|
177
|
+
block={blockId}
|
178
|
+
content={{}}
|
179
|
+
request={{
|
180
|
+
loading: false,
|
181
|
+
loaded: false,
|
182
|
+
}}
|
183
|
+
pathname="/news"
|
184
|
+
onChangeBlock={() => {}}
|
185
|
+
onSelectBlock={() => {}}
|
186
|
+
onDeleteBlock={() => {}}
|
187
|
+
createContent={() => {}}
|
188
|
+
onFocusPreviousBlock={() => {}}
|
189
|
+
onFocusNextBlock={() => {}}
|
190
|
+
handleKeyDown={() => {}}
|
191
|
+
index={1}
|
192
|
+
openObjectBrowser={() => {}}
|
193
|
+
/>
|
194
|
+
</Provider>,
|
195
|
+
);
|
196
|
+
|
197
|
+
settings.internalApiPath = 'http://localhost:8080/Plone';
|
198
|
+
|
199
|
+
expect(container.querySelector('.block.image.align')).toBeInTheDocument();
|
200
|
+
expect(
|
201
|
+
container.querySelector('.image-block-container'),
|
202
|
+
).toBeInTheDocument();
|
203
|
+
expect(container.querySelector('.copyright-wrapper')).toBeInTheDocument();
|
204
|
+
});
|
205
|
+
|
206
|
+
it('should render without errors', () => {
|
207
|
+
const { container } = render(
|
208
|
+
<Provider store={store}>
|
209
|
+
<Edit
|
210
|
+
data={{
|
211
|
+
url: 'http://localhost:8080/Plone/image',
|
212
|
+
'@type': 'image',
|
213
|
+
}}
|
214
|
+
selected={false}
|
215
|
+
block={blockId}
|
216
|
+
content={{}}
|
217
|
+
request={{
|
218
|
+
loading: false,
|
219
|
+
loaded: false,
|
220
|
+
}}
|
221
|
+
pathname="/news"
|
222
|
+
onChangeBlock={() => {}}
|
223
|
+
onSelectBlock={() => {}}
|
224
|
+
onDeleteBlock={() => {}}
|
225
|
+
createContent={() => {}}
|
226
|
+
onFocusPreviousBlock={() => {}}
|
227
|
+
onFocusNextBlock={() => {}}
|
228
|
+
handleKeyDown={() => {}}
|
229
|
+
index={1}
|
230
|
+
openObjectBrowser={() => {}}
|
231
|
+
/>
|
232
|
+
</Provider>,
|
233
|
+
);
|
234
|
+
|
235
|
+
settings.internalApiPath = 'http://localhost:8080/Plone';
|
236
|
+
|
237
|
+
expect(container.querySelector('.block.image.align')).toBeInTheDocument();
|
238
|
+
expect(
|
239
|
+
container.querySelector('.image-block-container'),
|
240
|
+
).toBeInTheDocument();
|
241
|
+
expect(container.querySelector('.copyright-wrapper')).toBeInTheDocument();
|
242
|
+
});
|
243
|
+
|
244
|
+
it('should render without errors', () => {
|
245
|
+
const { container } = render(
|
246
|
+
<Provider store={store}>
|
247
|
+
<Edit
|
248
|
+
data={{
|
249
|
+
url: 'http://localhost:80801/Plone/image',
|
250
|
+
'@type': 'image',
|
251
|
+
}}
|
252
|
+
selected={false}
|
253
|
+
block={blockId}
|
254
|
+
content={{}}
|
255
|
+
request={{
|
256
|
+
loading: false,
|
257
|
+
loaded: false,
|
258
|
+
}}
|
259
|
+
pathname="/news"
|
260
|
+
onChangeBlock={() => {}}
|
261
|
+
onSelectBlock={() => {}}
|
262
|
+
onDeleteBlock={() => {}}
|
263
|
+
createContent={() => {}}
|
264
|
+
onFocusPreviousBlock={() => {}}
|
265
|
+
onFocusNextBlock={() => {}}
|
266
|
+
handleKeyDown={() => {}}
|
267
|
+
index={1}
|
268
|
+
openObjectBrowser={() => {}}
|
269
|
+
/>
|
270
|
+
</Provider>,
|
271
|
+
);
|
272
|
+
|
273
|
+
settings.internalApiPath = 'http://localhost:8080/Plone';
|
274
|
+
|
275
|
+
expect(container.querySelector('.block.image.align')).toBeInTheDocument();
|
276
|
+
expect(
|
277
|
+
container.querySelector('.image-block-container'),
|
278
|
+
).toBeInTheDocument();
|
279
|
+
expect(container.querySelector('.copyright-wrapper')).toBeInTheDocument();
|
280
|
+
});
|
281
|
+
|
282
|
+
it('should render without errors', () => {
|
283
|
+
render(
|
284
|
+
<Provider store={store}>
|
285
|
+
<Edit
|
286
|
+
data={{
|
287
|
+
url: undefined,
|
288
|
+
'@type': 'image',
|
289
|
+
}}
|
290
|
+
selected={false}
|
291
|
+
block={blockId}
|
292
|
+
content={{}}
|
293
|
+
request={{
|
294
|
+
loading: false,
|
295
|
+
loaded: false,
|
296
|
+
}}
|
297
|
+
editable={true}
|
298
|
+
pathname="/news"
|
299
|
+
onChangeBlock={() => {}}
|
300
|
+
onSelectBlock={() => {}}
|
301
|
+
onDeleteBlock={() => {}}
|
302
|
+
createContent={() => {}}
|
303
|
+
onFocusPreviousBlock={() => {}}
|
304
|
+
onFocusNextBlock={() => {}}
|
305
|
+
handleKeyDown={() => {}}
|
306
|
+
index={1}
|
307
|
+
openObjectBrowser={() => {}}
|
308
|
+
/>
|
309
|
+
</Provider>,
|
310
|
+
);
|
311
|
+
});
|
312
|
+
});
|