@eeacms/volto-tableau 8.1.5 → 9.0.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 +12 -18
- package/DEVELOP.md +19 -17
- package/Dockerfile +10 -1
- package/Jenkinsfile +42 -39
- package/Makefile +1 -1
- package/README.md +33 -19
- package/cypress/e2e/block-basics.cy.js +9 -7
- package/cypress/e2e/block-tableau.cy.js +12 -5
- package/cypress/support/commands.js +7 -3
- package/docker-compose.yml +1 -1
- package/jest-addon.config.js +16 -4
- package/package.json +1 -1
- package/src/Blocks/EmbedTableauVisualization/Edit.test.jsx +10 -5
- package/src/Blocks/EmbedTableauVisualization/View.test.jsx +1 -1
- package/src/Blocks/TableauBlock/View.test.jsx +1 -1
- package/src/Tableau/Tableau.test.jsx +1 -1
- package/src/Views/VisualizationView.test.jsx +1 -1
- package/src/Widgets/VisualizationViewWidget.test.jsx +1 -1
- package/src/Widgets/VisualizationWidget.test.jsx +9 -4
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@ 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
|
+
### [9.0.0](https://github.com/eea/volto-tableau/compare/8.1.5...9.0.0) - 25 March 2026
|
|
8
|
+
|
|
9
|
+
#### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
- feat: Volto 18 support - refs #287700 [Alin Voinea - [`9b3e664`](https://github.com/eea/volto-tableau/commit/9b3e664c40418e950816242f95f306399dc527c4)]
|
|
12
|
+
|
|
13
|
+
#### :house: Internal changes
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
#### :hammer_and_wrench: Others
|
|
17
|
+
|
|
18
|
+
- tests: Fix Sonar Qube tags - refs #297339 [Alin Voinea - [`cfbd646`](https://github.com/eea/volto-tableau/commit/cfbd646a9c09cb90f6ffa6a886822e7a4759ba4d)]
|
|
7
19
|
### [8.1.5](https://github.com/eea/volto-tableau/compare/8.1.4...8.1.5) - 4 August 2025
|
|
8
20
|
|
|
9
21
|
#### :hammer_and_wrench: Others
|
|
@@ -83,7 +95,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
83
95
|
|
|
84
96
|
#### :hammer_and_wrench: Others
|
|
85
97
|
|
|
86
|
-
- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`22eeee9`](https://github.com/eea/volto-tableau/commit/22eeee93cfa8516261bb037a4bffef654af7a179)]
|
|
87
98
|
- Revert "Add fullwidth property" [Miu Razvan - [`ea36e3c`](https://github.com/eea/volto-tableau/commit/ea36e3c4be0ff20999a5ea7ced69cc77f287ced5)]
|
|
88
99
|
- Add fullwidth property [Miu Razvan - [`8d21ed0`](https://github.com/eea/volto-tableau/commit/8d21ed0b219f94d18998155a77acf2a0c50c9338)]
|
|
89
100
|
### [8.0.3](https://github.com/eea/volto-tableau/compare/8.0.2...8.0.3) - 14 June 2024
|
|
@@ -215,14 +226,12 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
215
226
|
- test [Dobricean Ioan Dorian - [`48505ca`](https://github.com/eea/volto-tableau/commit/48505caef84d12091035fdd79cf64067e7f819e2)]
|
|
216
227
|
- split the view and edit [Dobricean Ioan Dorian - [`7227bb1`](https://github.com/eea/volto-tableau/commit/7227bb1fb70e5d895f15872ed6533e089be99836)]
|
|
217
228
|
- update embed tableau so it can work with serialized data [Dobricean Ioan Dorian - [`59d958c`](https://github.com/eea/volto-tableau/commit/59d958c7a1a5055ea62e04abcbf34ee93f52e23a)]
|
|
218
|
-
- test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`c452d70`](https://github.com/eea/volto-tableau/commit/c452d704819fb485e3cd3b39c2501361d20e8559)]
|
|
219
229
|
### [6.0.6](https://github.com/eea/volto-tableau/compare/6.0.5...6.0.6) - 17 November 2023
|
|
220
230
|
|
|
221
231
|
#### :hammer_and_wrench: Others
|
|
222
232
|
|
|
223
233
|
- tests: add cypress for tableau [nileshgulia1 - [`6eca683`](https://github.com/eea/volto-tableau/commit/6eca6834b85cdab4ed82367fee32fdbbb35b0f5e)]
|
|
224
234
|
- tests: update unit tests [nileshgulia1 - [`96cae09`](https://github.com/eea/volto-tableau/commit/96cae09eab2e737f032c97eb401a3efa88e68ec6)]
|
|
225
|
-
- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`c7e81cb`](https://github.com/eea/volto-tableau/commit/c7e81cb0768f755dd4107a4998253d9bccc33809)]
|
|
226
235
|
- comment test [Miu Razvan - [`a459525`](https://github.com/eea/volto-tableau/commit/a459525fdccf8ee61651d4cb2e04eb253e841c61)]
|
|
227
236
|
### [6.0.5](https://github.com/eea/volto-tableau/compare/6.0.4...6.0.5) - 15 November 2023
|
|
228
237
|
|
|
@@ -249,7 +258,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
249
258
|
|
|
250
259
|
#### :house: Internal changes
|
|
251
260
|
|
|
252
|
-
- chore: [JENKINS] Refactor automated testing [valentinab25 - [`903b90a`](https://github.com/eea/volto-tableau/commit/903b90a2df0abc183aa68d99a89bb688de3a0c73)]
|
|
253
261
|
|
|
254
262
|
#### :hammer_and_wrench: Others
|
|
255
263
|
|
|
@@ -259,9 +267,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
259
267
|
- tests: increase coverage [kreafox - [`ecb9262`](https://github.com/eea/volto-tableau/commit/ecb92625a44365faf4c39f0ff3f02ccc4ca21656)]
|
|
260
268
|
- Fix tableau height [kreafox - [`6194c24`](https://github.com/eea/volto-tableau/commit/6194c2405e2bd93aba9865caed76292cd55193d3)]
|
|
261
269
|
- Show share & download button on widget view [kreafox - [`a66e253`](https://github.com/eea/volto-tableau/commit/a66e2537d08dc7129e249c28e1daa27246c88815)]
|
|
262
|
-
- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`9d2189d`](https://github.com/eea/volto-tableau/commit/9d2189d4edb13dd449d75cd6dd9052bbed67304d)]
|
|
263
|
-
- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`f2fa3f9`](https://github.com/eea/volto-tableau/commit/f2fa3f9ccabab918586179ac16ead44e2eba8498)]
|
|
264
|
-
- test: [JENKINS] Improve cypress time [valentinab25 - [`5748183`](https://github.com/eea/volto-tableau/commit/5748183c27dae18a4ebbc067d659cbc24cad8f71)]
|
|
265
270
|
- use toolbar from volto-embed [Miu Razvan - [`1a232a1`](https://github.com/eea/volto-tableau/commit/1a232a15f2bbe05da75307800590d0a0a1c4996b)]
|
|
266
271
|
## [6.0.0](https://github.com/eea/volto-tableau/compare/5.0.2...6.0.0) - 30 October 2023
|
|
267
272
|
|
|
@@ -319,7 +324,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
319
324
|
- test: change volto version in Jenkinsfile [ana-oprea - [`347aceb`](https://github.com/eea/volto-tableau/commit/347aceb07d152fddeebbf3a7e7a6ac9c55dc21ba)]
|
|
320
325
|
- test: increase cypress timeout [ana-oprea - [`bdf4408`](https://github.com/eea/volto-tableau/commit/bdf44083cd84c96b4914d3f8a3bb17c5187f191c)]
|
|
321
326
|
- test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`caff974`](https://github.com/eea/volto-tableau/commit/caff9742a703b224133a8dd2a969629e70c9fd33)]
|
|
322
|
-
- test: Fix eslint and yarn i18n [Alin Voinea - [`b8be7fb`](https://github.com/eea/volto-tableau/commit/b8be7fb9ab10faed0a1be8ce7e3d4e7c78ebe020)]
|
|
323
327
|
- i18n: Add en [Alin Voinea - [`c5e20dd`](https://github.com/eea/volto-tableau/commit/c5e20ddea25c830ac80665ee9a71e557e8cd117d)]
|
|
324
328
|
- test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`2116ff9`](https://github.com/eea/volto-tableau/commit/2116ff95c6454e813bdca44e6c3aa81fa0a916b8)]
|
|
325
329
|
## [5.0.0](https://github.com/eea/volto-tableau/compare/4.1.1...5.0.0) - 25 July 2023
|
|
@@ -331,21 +335,17 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
331
335
|
#### :hammer_and_wrench: Others
|
|
332
336
|
|
|
333
337
|
- Release 5.0.0 [Alin Voinea - [`97c98e9`](https://github.com/eea/volto-tableau/commit/97c98e98b1295a4ad45756326dc20cd59517515f)]
|
|
334
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`2acb3a5`](https://github.com/eea/volto-tableau/commit/2acb3a5490f62ce0a95ebbd03c32874ac3a42603)]
|
|
335
338
|
### [4.1.1](https://github.com/eea/volto-tableau/compare/4.1.0...4.1.1) - 21 July 2023
|
|
336
339
|
|
|
337
340
|
#### :hammer_and_wrench: Others
|
|
338
341
|
|
|
339
342
|
- Add VisualizationViewWidget [Tiberiu Ichim - [`fa881cb`](https://github.com/eea/volto-tableau/commit/fa881cbc3643a46697fb16d1c86ada1d4121a46a)]
|
|
340
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`cbcbad2`](https://github.com/eea/volto-tableau/commit/cbcbad26f7aa3683122199c8d5cbd142903df93b)]
|
|
341
|
-
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`51abe6d`](https://github.com/eea/volto-tableau/commit/51abe6d4db80825fe2e396e04c7003c6ad79b480)]
|
|
342
343
|
### [4.1.0](https://github.com/eea/volto-tableau/compare/4.0.0...4.1.0) - 15 June 2023
|
|
343
344
|
|
|
344
345
|
## [4.0.0](https://github.com/eea/volto-tableau/compare/3.0.8...4.0.0) - 13 June 2023
|
|
345
346
|
|
|
346
347
|
#### :house: Internal changes
|
|
347
348
|
|
|
348
|
-
- chore: [JENKINS] Remove alpha testing version [valentinab25 - [`e33bb21`](https://github.com/eea/volto-tableau/commit/e33bb21eb429c33e3a15d771487a1c9af8ccb0d5)]
|
|
349
349
|
|
|
350
350
|
#### :hammer_and_wrench: Others
|
|
351
351
|
|
|
@@ -377,7 +377,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
377
377
|
|
|
378
378
|
#### :hammer_and_wrench: Others
|
|
379
379
|
|
|
380
|
-
- Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`f5deccd`](https://github.com/eea/volto-tableau/commit/f5deccd84372752908b300c5cfd78134818e5ce4)]
|
|
381
380
|
### [3.0.6](https://github.com/eea/volto-tableau/compare/3.0.5...3.0.6) - 30 January 2023
|
|
382
381
|
|
|
383
382
|
### [3.0.5](https://github.com/eea/volto-tableau/compare/3.0.4...3.0.5) - 26 January 2023
|
|
@@ -449,7 +448,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
449
448
|
- Update commands.js [Nilesh - [`7c48437`](https://github.com/eea/volto-tableau/commit/7c4843780efb9b85a4728de73c00d831c1d8fdcf)]
|
|
450
449
|
- Update e2e.js [Nilesh - [`f67b45c`](https://github.com/eea/volto-tableau/commit/f67b45c170f58f8d0301192994226f173e4cb00a)]
|
|
451
450
|
- latest volto compatibility refs #154757 [nileshgulia1 - [`881ba48`](https://github.com/eea/volto-tableau/commit/881ba482dc9b82e7fdac16549d41e80a6d26b3de)]
|
|
452
|
-
- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`58e25df`](https://github.com/eea/volto-tableau/commit/58e25df2291add09670143bee54cde103ee835b9)]
|
|
453
451
|
### [1.3.0](https://github.com/eea/volto-tableau/compare/1.2.5...1.3.0) - 28 September 2022
|
|
454
452
|
|
|
455
453
|
#### :hammer_and_wrench: Others
|
|
@@ -463,15 +461,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
463
461
|
- Use volto 16 alpha 14 [Miu Razvan - [`93641be`](https://github.com/eea/volto-tableau/commit/93641be4c2393f49008aff789400cf7c947949fd)]
|
|
464
462
|
- Revert volto-tableau group to common [Andrei Grigore - [`9d24c6d`](https://github.com/eea/volto-tableau/commit/9d24c6d2767fed6a840cddaee55dbd5cecb544b5)]
|
|
465
463
|
- Tableaugroup typo fix [Andrei Grigore - [`b0b5378`](https://github.com/eea/volto-tableau/commit/b0b5378a437043120a96c9e5e8802584145daa22)]
|
|
466
|
-
- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`3234347`](https://github.com/eea/volto-tableau/commit/3234347e524cc0ed4918242f503fe9e7dba266b2)]
|
|
467
464
|
- Refs #142010 - Optimize Volto-addons gitflow pipelines [valentinab25 - [`d237e1c`](https://github.com/eea/volto-tableau/commit/d237e1c72817d7e68a3eb698563674d1514db24f)]
|
|
468
465
|
### [1.2.4](https://github.com/eea/volto-tableau/compare/1.2.3...1.2.4) - 25 October 2021
|
|
469
466
|
|
|
470
467
|
#### :hammer_and_wrench: Others
|
|
471
468
|
|
|
472
|
-
- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`2b19679`](https://github.com/eea/volto-tableau/commit/2b19679e2c7bcdc83082d1c73a595eea8b86d14f)]
|
|
473
|
-
- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`384ccae`](https://github.com/eea/volto-tableau/commit/384ccaebed8c414a5c90eb96c6ce0a2b091f249c)]
|
|
474
|
-
- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`589258e`](https://github.com/eea/volto-tableau/commit/589258e9b3cbba9cee37c57bb85ca5b707bc65d7)]
|
|
475
469
|
### [1.2.3](https://github.com/eea/volto-tableau/compare/1.2.2...1.2.3) - 14 June 2021
|
|
476
470
|
|
|
477
471
|
#### :hammer_and_wrench: Others
|
package/DEVELOP.md
CHANGED
|
@@ -26,21 +26,20 @@
|
|
|
26
26
|
|
|
27
27
|
### Or add @eeacms/volto-tableau to your Volto project
|
|
28
28
|
|
|
29
|
-
Before starting make sure your development environment is properly set. See [Volto
|
|
29
|
+
Before starting make sure your development environment is properly set. See the official Plone documentation for [creating a project with Cookieplone](https://6.docs.plone.org/install/create-project-cookieplone.html) and [installing an add-on in development mode in Volto 18 and 19](https://6.docs.plone.org/volto/development/add-ons/install-an-add-on-dev-18.html).
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
For new Volto 18+ projects, use Cookieplone. It includes `mrs-developer` by default.
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
1. Create a new Volto project with Cookieplone
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
yo @plone/volto my-volto-project --addon @eeacms/volto-tableau --skip-install
|
|
38
|
-
cd my-volto-project
|
|
35
|
+
uvx cookieplone project
|
|
36
|
+
cd project-title
|
|
39
37
|
|
|
40
38
|
1. Add the following to `mrs.developer.json`:
|
|
41
39
|
|
|
42
40
|
{
|
|
43
41
|
"volto-tableau": {
|
|
42
|
+
"output": "packages",
|
|
44
43
|
"url": "https://github.com/eea/volto-tableau.git",
|
|
45
44
|
"package": "@eeacms/volto-tableau",
|
|
46
45
|
"branch": "develop",
|
|
@@ -48,28 +47,31 @@ Before starting make sure your development environment is properly set. See [Vol
|
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
1.
|
|
50
|
+
1. Add `@eeacms/volto-tableau` to the `addons` key in your project `volto.config.js`
|
|
51
|
+
|
|
52
|
+
1. Install or refresh the project setup
|
|
52
53
|
|
|
53
|
-
make
|
|
54
|
-
yarn
|
|
54
|
+
make install
|
|
55
55
|
|
|
56
|
-
1. Start backend
|
|
56
|
+
1. Start backend in one terminal
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
make backend-start
|
|
59
59
|
|
|
60
|
-
...wait for backend to setup and start
|
|
60
|
+
...wait for backend to setup and start, ending with `Ready to handle requests`
|
|
61
61
|
|
|
62
62
|
...you can also check http://localhost:8080/Plone
|
|
63
63
|
|
|
64
|
-
1. Start frontend
|
|
64
|
+
1. Start frontend in a second terminal
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
make frontend-start
|
|
67
67
|
|
|
68
68
|
1. Go to http://localhost:3000
|
|
69
69
|
|
|
70
70
|
1. Happy hacking!
|
|
71
71
|
|
|
72
|
-
cd
|
|
72
|
+
cd packages/volto-tableau
|
|
73
|
+
|
|
74
|
+
For legacy Volto 17 projects, keep using the yarn-based workflow from the Volto 17 documentation.
|
|
73
75
|
|
|
74
76
|
## Cypress
|
|
75
77
|
|
|
@@ -81,7 +83,7 @@ project where you added `volto-tableau` to `mrs.developer.json`
|
|
|
81
83
|
Go to:
|
|
82
84
|
|
|
83
85
|
```BASH
|
|
84
|
-
cd
|
|
86
|
+
cd packages/volto-tableau/
|
|
85
87
|
```
|
|
86
88
|
|
|
87
89
|
Start:
|
package/Dockerfile
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
# syntax=docker/dockerfile:1
|
|
2
2
|
ARG VOLTO_VERSION
|
|
3
|
-
FROM
|
|
3
|
+
FROM plone/frontend-builder:${VOLTO_VERSION}
|
|
4
4
|
|
|
5
5
|
ARG ADDON_NAME
|
|
6
6
|
ARG ADDON_PATH
|
|
7
|
+
ENV HOST="0.0.0.0"
|
|
8
|
+
|
|
9
|
+
USER root
|
|
10
|
+
RUN apt-get update -q \
|
|
11
|
+
&& apt-get install -qy --no-install-recommends \
|
|
12
|
+
chromium libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb \
|
|
13
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
14
|
+
USER node
|
|
7
15
|
|
|
8
16
|
COPY --chown=node:node ./ /app/src/addons/${ADDON_PATH}/
|
|
9
17
|
|
|
10
18
|
RUN /setupAddon
|
|
19
|
+
RUN yarn add jest-junit
|
|
11
20
|
RUN yarn install
|
|
12
21
|
|
|
13
22
|
ENTRYPOINT ["yarn"]
|
package/Jenkinsfile
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
pipeline {
|
|
2
|
-
tools {
|
|
3
|
-
jdk 'Java17'
|
|
4
|
-
}
|
|
5
2
|
agent {
|
|
6
3
|
node { label 'docker-host' }
|
|
7
4
|
}
|
|
@@ -9,12 +6,12 @@ pipeline {
|
|
|
9
6
|
environment {
|
|
10
7
|
GIT_NAME = "volto-tableau"
|
|
11
8
|
NAMESPACE = "@eeacms"
|
|
12
|
-
SONARQUBE_TAGS = "volto.eea.europa.eu,climate-energy.eea.europa.eu,forest.eea.europa.eu,biodiversity.europa.eu,water.europa.eu-freshwater,water.europa.eu-marine,industry.eea.europa.eu,demo-www.eea.europa.eu,www.eea.europa.eu-en,insitu.copernicus.eu"
|
|
9
|
+
SONARQUBE_TAGS = "volto.eea.europa.eu,climate-energy.eea.europa.eu,forest.eea.europa.eu,biodiversity.europa.eu,water.europa.eu-freshwater,water.europa.eu-marine,industry.eea.europa.eu,demo-www.eea.europa.eu,www.eea.europa.eu-en,www.eea.europa.eu,insitu.copernicus.eu"
|
|
13
10
|
DEPENDENCIES = ""
|
|
14
11
|
BACKEND_PROFILES = "eea.kitkat:testing"
|
|
15
12
|
BACKEND_ADDONS = ""
|
|
16
13
|
VOLTO = "17"
|
|
17
|
-
|
|
14
|
+
VOLTO18_BREAKING_CHANGES = "no"
|
|
18
15
|
IMAGE_NAME = BUILD_TAG.toLowerCase()
|
|
19
16
|
}
|
|
20
17
|
|
|
@@ -242,11 +239,17 @@ pipeline {
|
|
|
242
239
|
script {
|
|
243
240
|
def scannerHome = tool 'SonarQubeScanner'
|
|
244
241
|
def nodeJS = tool 'NodeJS'
|
|
242
|
+
if (env.CHANGE_ID) {
|
|
243
|
+
env.sonarParams = " -Dsonar.pullrequest.base=${env.CHANGE_TARGET} -Dsonar.pullrequest.branch=${env.CHANGE_BRANCH} -Dsonar.pullrequest.key=${env.CHANGE_ID} "
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
env.sonarParams = " -Dsonar.branch.name=${env.BRANCH_NAME}"
|
|
247
|
+
}
|
|
245
248
|
withSonarQubeEnv('Sonarqube') {
|
|
246
249
|
sh '''sed -i "s#/app/src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
|
|
247
250
|
sh '''sed -i "s#src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
|
|
248
|
-
sh "export PATH=${scannerHome}/bin:${nodeJS}/bin:$PATH; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info,./cypress-coverage/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME
|
|
249
|
-
sh '''try=5; while [ \$try -gt 0 ]; do curl -s -XPOST -u "${SONAR_AUTH_TOKEN}:" "${SONAR_HOST_URL}api/project_tags/set?project=${GIT_NAME}
|
|
251
|
+
sh "export PATH=${scannerHome}/bin:${nodeJS}/bin:$PATH; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info,./cypress-coverage/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME -Dsonar.projectName=$GIT_NAME -Dsonar.projectVersion=\$(jq -r '.version' package.json) ${env.sonarParams}"
|
|
252
|
+
sh '''try=5; while [ \$try -gt 0 ]; do curl -s -XPOST -u "${SONAR_AUTH_TOKEN}:" "${SONAR_HOST_URL}api/project_tags/set?project=${GIT_NAME}&tags=${SONARQUBE_TAGS}" > set_tags_result; if [ \$(grep -ic error set_tags_result ) -eq 0 ]; then try=0; else cat set_tags_result; echo "... Will retry"; sleep 15; try=\$(( \$try - 1 )); fi; done'''
|
|
250
253
|
}
|
|
251
254
|
}
|
|
252
255
|
}
|
|
@@ -256,75 +259,75 @@ pipeline {
|
|
|
256
259
|
}
|
|
257
260
|
}
|
|
258
261
|
|
|
259
|
-
stage('Volto
|
|
262
|
+
stage('Volto 18') {
|
|
260
263
|
agent { node { label 'integration'} }
|
|
261
264
|
when {
|
|
262
265
|
environment name: 'SKIP_TESTS', value: ''
|
|
263
|
-
not { environment name: '
|
|
266
|
+
not { environment name: 'VOLTO18_BREAKING_CHANGES', value: 'yes' }
|
|
264
267
|
}
|
|
265
268
|
stages {
|
|
266
269
|
stage('Build test image') {
|
|
267
270
|
steps {
|
|
268
|
-
sh '''docker build --pull --build-arg="VOLTO_VERSION=
|
|
271
|
+
sh '''docker build --pull --build-arg="VOLTO_VERSION=18-yarn" --build-arg="ADDON_NAME=$NAMESPACE/$GIT_NAME" --build-arg="ADDON_PATH=$GIT_NAME" . -t $IMAGE_NAME-frontend18'''
|
|
269
272
|
}
|
|
270
273
|
}
|
|
271
274
|
|
|
272
|
-
stage('Unit tests Volto
|
|
275
|
+
stage('Unit tests Volto 18') {
|
|
273
276
|
steps {
|
|
274
277
|
script {
|
|
275
278
|
try {
|
|
276
|
-
sh '''docker run --name="$IMAGE_NAME-
|
|
277
|
-
sh '''rm -rf xunit-
|
|
278
|
-
sh '''mkdir -p xunit-
|
|
279
|
-
sh '''docker cp $IMAGE_NAME-
|
|
279
|
+
sh '''docker run --name="$IMAGE_NAME-volto18" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend18 test-ci'''
|
|
280
|
+
sh '''rm -rf xunit-reports18'''
|
|
281
|
+
sh '''mkdir -p xunit-reports18'''
|
|
282
|
+
sh '''docker cp $IMAGE_NAME-volto18:/app/junit.xml xunit-reports18/'''
|
|
280
283
|
} finally {
|
|
281
284
|
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
|
|
282
|
-
junit testResults: 'xunit-
|
|
285
|
+
junit testResults: 'xunit-reports18/junit.xml', allowEmptyResults: true
|
|
283
286
|
}
|
|
284
|
-
sh script: '''docker rm -v $IMAGE_NAME-
|
|
287
|
+
sh script: '''docker rm -v $IMAGE_NAME-volto18''', returnStatus: true
|
|
285
288
|
}
|
|
286
289
|
}
|
|
287
290
|
}
|
|
288
291
|
}
|
|
289
292
|
|
|
290
|
-
stage('Integration tests Volto
|
|
293
|
+
stage('Integration tests Volto 18') {
|
|
291
294
|
steps {
|
|
292
295
|
script {
|
|
293
296
|
try {
|
|
294
|
-
sh '''docker run --pull always --rm -d --name="$IMAGE_NAME-
|
|
295
|
-
sh '''docker run -d --shm-size=4g --link $IMAGE_NAME-
|
|
296
|
-
frontend = sh script:'''docker exec --workdir=/app/src/addons/${GIT_NAME} $IMAGE_NAME-
|
|
297
|
+
sh '''docker run --pull always --rm -d --name="$IMAGE_NAME-plone18" -e SITE="Plone" -e PROFILES="$BACKEND_PROFILES" -e ADDONS="$BACKEND_ADDONS" eeacms/plone-backend'''
|
|
298
|
+
sh '''docker run -d --shm-size=4g --link $IMAGE_NAME-plone18:plone --name="$IMAGE_NAME-cypress18" -e "RAZZLE_INTERNAL_API_PATH=http://plone:8080/Plone" --entrypoint=make --workdir=/app/src/addons/$GIT_NAME $IMAGE_NAME-frontend18 start-ci'''
|
|
299
|
+
frontend = sh script:'''docker exec --workdir=/app/src/addons/${GIT_NAME} $IMAGE_NAME-cypress18 make check-ci''', returnStatus: true
|
|
297
300
|
if ( frontend != 0 ) {
|
|
298
|
-
sh '''docker logs $IMAGE_NAME-
|
|
301
|
+
sh '''docker logs $IMAGE_NAME-cypress18; exit 1'''
|
|
299
302
|
}
|
|
300
|
-
sh '''timeout -s 9 1800 docker exec --workdir=/app/src/addons/${GIT_NAME} $IMAGE_NAME-
|
|
303
|
+
sh '''timeout -s 9 1800 docker exec --workdir=/app/src/addons/${GIT_NAME} $IMAGE_NAME-cypress18 make cypress-ci'''
|
|
301
304
|
} finally {
|
|
302
305
|
try {
|
|
303
306
|
if ( frontend == 0 ) {
|
|
304
|
-
sh '''rm -rf cypress-
|
|
305
|
-
sh '''mkdir -p cypress-
|
|
306
|
-
videos = sh script: '''docker cp $IMAGE_NAME-
|
|
307
|
-
sh '''docker cp $IMAGE_NAME-
|
|
308
|
-
screenshots = sh script: '''docker cp $IMAGE_NAME-
|
|
307
|
+
sh '''rm -rf cypress-videos18 cypress-results18 cypress-coverage18 cypress-screenshots18'''
|
|
308
|
+
sh '''mkdir -p cypress-videos18 cypress-results18 cypress-coverage18 cypress-screenshots18'''
|
|
309
|
+
videos = sh script: '''docker cp $IMAGE_NAME-cypress18:/app/src/addons/$GIT_NAME/cypress/videos cypress-videos18/''', returnStatus: true
|
|
310
|
+
sh '''docker cp $IMAGE_NAME-cypress18:/app/src/addons/$GIT_NAME/cypress/reports cypress-results18/'''
|
|
311
|
+
screenshots = sh script: '''docker cp $IMAGE_NAME-cypress18:/app/src/addons/$GIT_NAME/cypress/screenshots cypress-screenshots18''', returnStatus: true
|
|
309
312
|
|
|
310
|
-
archiveArtifacts artifacts: 'cypress-
|
|
313
|
+
archiveArtifacts artifacts: 'cypress-screenshots18/**', fingerprint: true, allowEmptyArchive: true
|
|
311
314
|
|
|
312
315
|
if ( videos == 0 ) {
|
|
313
|
-
sh '''for file in $(find cypress-
|
|
314
|
-
archiveArtifacts artifacts: 'cypress-
|
|
316
|
+
sh '''for file in $(find cypress-results18 -name *.xml); do if [ $(grep -E 'failures="[1-9].*"' $file | wc -l) -eq 0 ]; then testname=$(grep -E 'file=.*failures="0"' $file | sed 's#.* file=".*\\/\\(.*\\.[jsxt]\\+\\)" time.*#\\1#' ); rm -f cypress-videos18/videos/$testname.mp4; fi; done'''
|
|
317
|
+
archiveArtifacts artifacts: 'cypress-videos18/**/*.mp4', fingerprint: true, allowEmptyArchive: true
|
|
315
318
|
}
|
|
316
319
|
}
|
|
317
320
|
} finally {
|
|
318
321
|
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
|
|
319
|
-
junit testResults: 'cypress-
|
|
322
|
+
junit testResults: 'cypress-results18/**/*.xml', allowEmptyResults: true
|
|
320
323
|
}
|
|
321
324
|
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
|
|
322
|
-
sh '''docker logs $IMAGE_NAME-
|
|
325
|
+
sh '''docker logs $IMAGE_NAME-cypress18'''
|
|
323
326
|
}
|
|
324
|
-
sh script: "docker stop $IMAGE_NAME-
|
|
325
|
-
sh script: "docker stop $IMAGE_NAME-
|
|
326
|
-
sh script: "docker rm -v $IMAGE_NAME-
|
|
327
|
-
sh script: "docker rm -v $IMAGE_NAME-
|
|
327
|
+
sh script: "docker stop $IMAGE_NAME-cypress18", returnStatus: true
|
|
328
|
+
sh script: "docker stop $IMAGE_NAME-plone18", returnStatus: true
|
|
329
|
+
sh script: "docker rm -v $IMAGE_NAME-plone18", returnStatus: true
|
|
330
|
+
sh script: "docker rm -v $IMAGE_NAME-cypress18", returnStatus: true
|
|
328
331
|
}
|
|
329
332
|
}
|
|
330
333
|
}
|
|
@@ -337,7 +340,7 @@ pipeline {
|
|
|
337
340
|
post {
|
|
338
341
|
always {
|
|
339
342
|
sh script: "docker rmi $IMAGE_NAME-frontend", returnStatus: true
|
|
340
|
-
sh script: "docker rmi $IMAGE_NAME-
|
|
343
|
+
sh script: "docker rmi $IMAGE_NAME-frontend18", returnStatus: true
|
|
341
344
|
}
|
|
342
345
|
}
|
|
343
346
|
}
|
|
@@ -363,7 +366,7 @@ pipeline {
|
|
|
363
366
|
script {
|
|
364
367
|
sh '''echo "Error" > checkresult.txt'''
|
|
365
368
|
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
|
366
|
-
sh '''set -o pipefail; docker run -i --rm --pull always --name="$IMAGE_NAME-gitflow-sn" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" eeacms/gitflow /
|
|
369
|
+
sh '''set -o pipefail; docker run -i --rm --pull always --name="$IMAGE_NAME-gitflow-sn" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" eeacms/gitflow /checkSonarqubemasterV2.sh | grep -v "Found script" | tee checkresult.txt'''
|
|
367
370
|
}
|
|
368
371
|
|
|
369
372
|
publishChecks name: 'SonarQube', title: 'Sonarqube Code Quality Check', summary: 'Quality check on the SonarQube metrics from branch develop, comparing it with the ones from master branch. No bugs are allowed',
|
package/Makefile
CHANGED
|
@@ -46,7 +46,7 @@ endif
|
|
|
46
46
|
DIR=$(shell basename $$(pwd))
|
|
47
47
|
NODE_MODULES?="../../../node_modules"
|
|
48
48
|
PLONE_VERSION?=6
|
|
49
|
-
VOLTO_VERSION?=
|
|
49
|
+
VOLTO_VERSION?=18-yarn
|
|
50
50
|
ADDON_PATH="${DIR}"
|
|
51
51
|
ADDON_NAME="@eeacms/${ADDON_PATH}"
|
|
52
52
|
DOCKER_COMPOSE=PLONE_VERSION=${PLONE_VERSION} VOLTO_VERSION=${VOLTO_VERSION} ADDON_NAME=${ADDON_NAME} ADDON_PATH=${ADDON_PATH} docker compose
|
package/README.md
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
[](https://github.com/eea/volto-tableau/releases)
|
|
4
4
|
|
|
5
5
|
[](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-tableau/job/master/display/redirect)
|
|
6
|
-
[](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-tableau
|
|
6
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-tableau)
|
|
7
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-tableau)
|
|
8
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-tableau)
|
|
9
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-tableau)
|
|
10
10
|
|
|
11
11
|
[](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-tableau/job/develop/display/redirect)
|
|
12
|
-
[](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-tableau
|
|
12
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-tableau&branch=develop)
|
|
13
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-tableau&branch=develop)
|
|
14
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-tableau&branch=develop)
|
|
15
|
+
[](https://sonarqube.eea.europa.eu/dashboard?id=volto-tableau&branch=develop)
|
|
16
16
|
|
|
17
17
|
[Volto](https://github.com/plone/volto) add-on
|
|
18
18
|
|
|
@@ -37,6 +37,11 @@ Registers a VisualizationView component for a content type named 'tableau_visual
|
|
|
37
37
|
|
|
38
38
|
Go to http://localhost:3000
|
|
39
39
|
|
|
40
|
+
`make start` now defaults to Volto 18. To run the same setup against Volto 17, use:
|
|
41
|
+
|
|
42
|
+
VOLTO_VERSION=17 make
|
|
43
|
+
VOLTO_VERSION=17 make start
|
|
44
|
+
|
|
40
45
|
### Add volto-tableau to your Volto project
|
|
41
46
|
|
|
42
47
|
1. Make sure you have a [Plone backend](https://plone.org/download) up-and-running at http://localhost:8080/Plone
|
|
@@ -50,30 +55,39 @@ Go to http://localhost:3000
|
|
|
50
55
|
- If you already have a volto project, just update `package.json`:
|
|
51
56
|
|
|
52
57
|
```JSON
|
|
53
|
-
"addons": [
|
|
54
|
-
"@eeacms/volto-tableau"
|
|
55
|
-
],
|
|
56
|
-
|
|
57
58
|
"dependencies": {
|
|
58
59
|
"@eeacms/volto-tableau": "*"
|
|
59
60
|
}
|
|
60
61
|
```
|
|
61
62
|
|
|
62
|
-
|
|
63
|
+
and `volto.config.js`:
|
|
64
|
+
|
|
65
|
+
```JavaScript
|
|
66
|
+
const addons = ['@eeacms/volto-tableau'];
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
- If not, create one with Cookieplone, as recommended by the official Plone documentation for Volto 18+:
|
|
63
70
|
|
|
64
71
|
```
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
cd my-volto-project
|
|
72
|
+
uvx cookieplone project
|
|
73
|
+
cd project-title
|
|
68
74
|
```
|
|
69
75
|
|
|
70
|
-
1. Install
|
|
76
|
+
1. Install or update dependencies, then start the project:
|
|
71
77
|
|
|
72
78
|
```
|
|
73
|
-
|
|
74
|
-
yarn start
|
|
79
|
+
make install
|
|
75
80
|
```
|
|
76
81
|
|
|
82
|
+
For a Cookieplone project, start the backend and frontend in separate terminals:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
make backend-start
|
|
86
|
+
make frontend-start
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
For a legacy Volto 17 project, install the package with `yarn` and restart the frontend as usual.
|
|
90
|
+
|
|
77
91
|
1. Go to http://localhost:3000
|
|
78
92
|
|
|
79
93
|
1. Happy editing!
|
|
@@ -5,22 +5,24 @@ describe('Blocks Tests', () => {
|
|
|
5
5
|
afterEach(slateAfterEach);
|
|
6
6
|
|
|
7
7
|
it('Add Block: Empty', () => {
|
|
8
|
+
const titleSelector = '.block.inner.title [contenteditable="true"]';
|
|
9
|
+
|
|
8
10
|
// Change page title
|
|
9
|
-
cy.
|
|
10
|
-
cy.
|
|
11
|
+
cy.get(titleSelector).clear();
|
|
12
|
+
cy.get(titleSelector).type('My Add-on Page');
|
|
11
13
|
|
|
12
14
|
cy.get('.documentFirstHeading').contains('My Add-on Page');
|
|
13
15
|
|
|
14
|
-
cy.
|
|
16
|
+
cy.get(titleSelector).type('{enter}');
|
|
15
17
|
|
|
16
18
|
// Add block
|
|
17
19
|
cy.get('.ui.basic.icon.button.block-add-button')
|
|
18
20
|
.first()
|
|
19
21
|
.click({ force: true });
|
|
20
|
-
cy.get(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
cy.get(".blocks-chooser .ui.form .field.searchbox input[type='text']").type(
|
|
23
|
+
'image',
|
|
24
|
+
);
|
|
25
|
+
cy.get('.button.image').contains('Image').click({ force: true });
|
|
24
26
|
|
|
25
27
|
// Save
|
|
26
28
|
cy.get('#toolbar-save').click({ force: true });
|
|
@@ -27,15 +27,22 @@ describe('Blocks Tests', () => {
|
|
|
27
27
|
afterEach(slateAfterEach);
|
|
28
28
|
|
|
29
29
|
it('Add Tableau block', () => {
|
|
30
|
-
cy.
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
cy.on('uncaught:exception', (err) => {
|
|
31
|
+
if (err.message?.includes('Not Found')) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
cy.intercept('GET', `/**/*?expand*`).as('content');
|
|
33
37
|
// when I add a maps block
|
|
34
|
-
cy.addNewBlock('tableau');
|
|
38
|
+
cy.addNewBlock('tableau', true);
|
|
35
39
|
|
|
36
40
|
cy.get(
|
|
37
41
|
`.sidebar-container .field-wrapper-tableau_vis_url #field-tableau_vis_url`,
|
|
38
|
-
).
|
|
42
|
+
).clear({ force: true });
|
|
43
|
+
cy.get(
|
|
44
|
+
`.sidebar-container .field-wrapper-tableau_vis_url #field-tableau_vis_url`,
|
|
45
|
+
).type('/cypress/my-page', { force: true });
|
|
39
46
|
cy.wait('@content');
|
|
40
47
|
cy.get('#toolbar-save').click({ force: true });
|
|
41
48
|
cy.intercept('GET', `/**/*?expand*`).as('content');
|
|
@@ -387,8 +387,9 @@ Cypress.Commands.add('getSlate', ({ createNewSlate = true } = {}) => {
|
|
|
387
387
|
},
|
|
388
388
|
() => {
|
|
389
389
|
if (createNewSlate) {
|
|
390
|
-
cy.get(
|
|
391
|
-
.
|
|
390
|
+
cy.get(SLATE_TITLE_SELECTOR)
|
|
391
|
+
.focus()
|
|
392
|
+
.click({ force: true })
|
|
392
393
|
.type('{moveToEnd}{enter}', { force: true });
|
|
393
394
|
}
|
|
394
395
|
slate = cy.get(SLATE_SELECTOR, { timeout: 10000 }).last();
|
|
@@ -548,7 +549,10 @@ Cypress.Commands.add('addNewBlock', (blockName, createNewSlate = false) => {
|
|
|
548
549
|
Cypress.Commands.add('getSlate', (createNewSlate = false) => {
|
|
549
550
|
let slate;
|
|
550
551
|
if (createNewSlate) {
|
|
551
|
-
cy.get(
|
|
552
|
+
cy.get(SLATE_TITLE_SELECTOR)
|
|
553
|
+
.focus()
|
|
554
|
+
.click({ force: true })
|
|
555
|
+
.type('{moveToEnd}{enter}', { force: true });
|
|
552
556
|
}
|
|
553
557
|
cy.getIfExists(
|
|
554
558
|
SLATE_SELECTOR,
|
package/docker-compose.yml
CHANGED
package/jest-addon.config.js
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
require('dotenv').config({ path: __dirname + '/.env' })
|
|
2
2
|
|
|
3
|
+
const fs = require('fs')
|
|
4
|
+
const path = require('path')
|
|
5
|
+
|
|
6
|
+
const voltoSlatePath = fs.existsSync(
|
|
7
|
+
path.join(__dirname, '../../../node_modules/@plone/volto-slate/src'),
|
|
8
|
+
)
|
|
9
|
+
? '<rootDir>/node_modules/@plone/volto-slate/src'
|
|
10
|
+
: '<rootDir>/node_modules/@plone/volto/packages/volto-slate/src'
|
|
11
|
+
|
|
12
|
+
const countupPath = fs.existsSync(path.join(__dirname, '../countup/src'))
|
|
13
|
+
? '<rootDir>/src/addons/countup/src'
|
|
14
|
+
: '<rootDir>/node_modules/@eeacms/countup'
|
|
15
|
+
|
|
3
16
|
module.exports = {
|
|
4
17
|
testMatch: ['**/src/addons/**/?(*.)+(spec|test).[jt]s?(x)'],
|
|
5
18
|
collectCoverageFrom: [
|
|
@@ -16,11 +29,10 @@ module.exports = {
|
|
|
16
29
|
'@plone/volto-quanta/(.*)$': '<rootDir>/src/addons/volto-quanta/src/$1',
|
|
17
30
|
'@eeacms/search/(.*)$': '<rootDir>/src/addons/volto-searchlib/searchlib/$1',
|
|
18
31
|
'@eeacms/search': '<rootDir>/src/addons/volto-searchlib/searchlib',
|
|
32
|
+
'@eeacms/countup$': countupPath,
|
|
19
33
|
'@eeacms/(.*?)/(.*)$': '<rootDir>/node_modules/@eeacms/$1/src/$2',
|
|
20
|
-
'@plone/volto-slate$':
|
|
21
|
-
|
|
22
|
-
'@plone/volto-slate/(.*)$':
|
|
23
|
-
'<rootDir>/node_modules/@plone/volto/packages/volto-slate/src/$1',
|
|
34
|
+
'@plone/volto-slate$': voltoSlatePath,
|
|
35
|
+
'@plone/volto-slate/(.*)$': `${voltoSlatePath}/$1`,
|
|
24
36
|
'~/(.*)$': '<rootDir>/src/$1',
|
|
25
37
|
'load-volto-addons':
|
|
26
38
|
'<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import { render, screen, waitFor } from '@testing-library/react';
|
|
3
3
|
import { Provider } from 'react-intl-redux';
|
|
4
4
|
import config from '@plone/volto/registry';
|
|
5
|
-
import '@testing-library/jest-dom
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
6
|
|
|
7
7
|
import Edit from './Edit';
|
|
8
8
|
import installEmbedTableau from '.';
|
|
@@ -22,7 +22,7 @@ describe('Edit', () => {
|
|
|
22
22
|
with_share: true,
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
it('should render the component', () => {
|
|
25
|
+
it('should render the component', async () => {
|
|
26
26
|
const { container } = render(
|
|
27
27
|
<Provider store={global.store}>
|
|
28
28
|
<Edit
|
|
@@ -44,6 +44,10 @@ describe('Edit', () => {
|
|
|
44
44
|
</Provider>,
|
|
45
45
|
);
|
|
46
46
|
|
|
47
|
+
await waitFor(() => {
|
|
48
|
+
expect(container.querySelector('#sidebar .ui.form')).toBeInTheDocument();
|
|
49
|
+
});
|
|
50
|
+
|
|
47
51
|
expect(container.querySelector('.embed-tableau')).toBeInTheDocument();
|
|
48
52
|
expect(
|
|
49
53
|
container.querySelector('.privacy-protection-wrapper'),
|
|
@@ -56,11 +60,12 @@ describe('Edit', () => {
|
|
|
56
60
|
});
|
|
57
61
|
expect(container.querySelector('.tableau-wrapper')).toBeInTheDocument();
|
|
58
62
|
expect(container.querySelector('#sidebar')).toBeInTheDocument();
|
|
59
|
-
expect(container.querySelector('#sidebar .ui.form')).toBeInTheDocument();
|
|
60
63
|
expect(
|
|
61
64
|
container.querySelector('#sidebar .ui.form .header.pulled'),
|
|
62
65
|
).toBeInTheDocument();
|
|
63
|
-
expect(
|
|
66
|
+
expect(
|
|
67
|
+
await screen.findByText('Embed Dashboard (Tableau)'),
|
|
68
|
+
).toBeInTheDocument();
|
|
64
69
|
expect(
|
|
65
70
|
container.querySelector('#blockform-fieldset-default'),
|
|
66
71
|
).toBeInTheDocument();
|
|
@@ -3,7 +3,7 @@ import { render, screen } from '@testing-library/react';
|
|
|
3
3
|
import { Provider } from 'react-redux';
|
|
4
4
|
import configureStore from 'redux-mock-store';
|
|
5
5
|
import View from './View';
|
|
6
|
-
import '@testing-library/jest-dom
|
|
6
|
+
import '@testing-library/jest-dom';
|
|
7
7
|
import Tableau from '@eeacms/volto-tableau/Tableau/Tableau';
|
|
8
8
|
|
|
9
9
|
jest.mock('@eeacms/volto-tableau/Tableau/Tableau', () =>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
|
-
import '@testing-library/jest-dom
|
|
3
|
+
import '@testing-library/jest-dom';
|
|
4
4
|
import { Provider } from 'react-redux';
|
|
5
5
|
|
|
6
6
|
import VisualizationViewWidget from './VisualizationViewWidget';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import '@testing-library/jest-dom
|
|
2
|
+
import { render, screen, waitFor } from '@testing-library/react';
|
|
3
|
+
import '@testing-library/jest-dom';
|
|
4
4
|
import { Provider } from 'react-intl-redux';
|
|
5
5
|
import VisualizationWidget from './VisualizationWidget';
|
|
6
6
|
|
|
7
7
|
describe('VisualizationWidget', () => {
|
|
8
|
-
it('should render the component', () => {
|
|
8
|
+
it('should render the component', async () => {
|
|
9
9
|
const data = {
|
|
10
10
|
value: {
|
|
11
11
|
url: 'http://localhost:3000/tableau-ct',
|
|
@@ -29,6 +29,11 @@ describe('VisualizationWidget', () => {
|
|
|
29
29
|
<VisualizationWidget {...data} id={'1234'} title="Title" />
|
|
30
30
|
</Provider>,
|
|
31
31
|
);
|
|
32
|
-
expect(
|
|
32
|
+
expect(
|
|
33
|
+
await screen.findByRole('button', { name: /open tableau editor/i }),
|
|
34
|
+
).toBeInTheDocument();
|
|
35
|
+
await waitFor(() => {
|
|
36
|
+
expect(container.querySelector('.tableau-wrapper')).toBeInTheDocument();
|
|
37
|
+
});
|
|
33
38
|
});
|
|
34
39
|
});
|