@plone/volto 16.30.2 → 16.30.3

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.draft CHANGED
@@ -1,11 +1,9 @@
1
- ## 16.30.2 (2024-01-24)
1
+ ## 16.30.3 (2024-02-15)
2
2
 
3
3
  ### Bugfix
4
4
 
5
- - Removed git merge conflicts from french, english and brazilian volto.po locale files. @ichim-david [#5682](https://github.com/plone/volto/issues/5682)
6
-
7
- ### Internal
8
-
9
- - Update versions of deps for Plone 5 @sneridagh [#5686](https://github.com/plone/volto/issues/5686)
5
+ - Fix `links-to-item` should be a protected route. @iFlameing [#5666](https://github.com/plone/volto/issues/5666)
6
+ - Fixed listing SSR rendering by sending `subrequestId` instead of `id` only within `getAsyncData`, similar to calling `getQueryStringResults` directly. @ichim-david [#5688](https://github.com/plone/volto/issues/5688)
7
+ - Add extra wait calls to listing block tests to avoid sporadic failures. @ichim-david [#5753](https://github.com/plone/volto/issues/5753)
10
8
 
11
9
 
Binary file
package/CHANGELOG.md CHANGED
@@ -8,6 +8,14 @@
8
8
 
9
9
  <!-- towncrier release notes start -->
10
10
 
11
+ ## 16.30.3 (2024-02-15)
12
+
13
+ ### Bugfix
14
+
15
+ - Fix `links-to-item` should be a protected route. @iFlameing [#5666](https://github.com/plone/volto/issues/5666)
16
+ - Fixed listing SSR rendering by sending `subrequestId` instead of `id` only within `getAsyncData`, similar to calling `getQueryStringResults` directly. @ichim-david [#5688](https://github.com/plone/volto/issues/5688)
17
+ - Add extra wait calls to listing block tests to avoid sporadic failures. @ichim-david [#5753](https://github.com/plone/volto/issues/5753)
18
+
11
19
  ## 16.30.2 (2024-01-24)
12
20
 
13
21
  ### Bugfix
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-console */
1
2
  import '@testing-library/cypress/add-commands';
2
3
  import { getIfExists } from '../helpers';
3
4
  import { ploneAuth } from './constants';
@@ -38,6 +39,30 @@ Cypress.Commands.add('isInViewport', (element) => {
38
39
  });
39
40
  });
40
41
 
42
+ // --- isInHTML ----------------------------------------------------------
43
+ Cypress.Commands.add('isInHTML', ({ parent = 'body', content }) => {
44
+ cy.url().then((currentUrl) => {
45
+ // sometimes the cy command is called when the url is still at content/edit
46
+ // we want to query the html markup of the content, not the edit form
47
+ const url =
48
+ currentUrl.indexOf('/edit') !== -1
49
+ ? currentUrl.split('/edit')[0]
50
+ : currentUrl;
51
+ cy.request({
52
+ method: 'GET',
53
+ url: url,
54
+ }).then((response) => {
55
+ const html = Cypress.$(response.body);
56
+ if (content.startsWith('.') || content.startsWith('#')) {
57
+ return expect(html.find(parent)).to.have.descendants(content);
58
+ } else {
59
+ // check if parent contains the content text string in its HTML output
60
+ return expect(html.find(parent)).to.contain(content);
61
+ }
62
+ });
63
+ });
64
+ });
65
+
41
66
  // --- AUTOLOGIN -------------------------------------------------------------
42
67
  Cypress.Commands.add('autologin', (usr, pass) => {
43
68
  let api_url, user, password;
@@ -698,7 +723,7 @@ Cypress.Commands.add('clearSlate', (selector) => {
698
723
  return cy
699
724
  .get(selector)
700
725
  .focus()
701
- .click()
726
+ .click({ force: true }) // fix sporadic failure this element is currently animating
702
727
  .wait(1000)
703
728
  .type('{selectAll}')
704
729
  .wait(1000)
@@ -801,7 +826,6 @@ function getTextNode(el, match) {
801
826
  return walk.nextNode();
802
827
  }
803
828
 
804
- const nodes = [];
805
829
  let node;
806
830
  while ((node = walk.nextNode())) {
807
831
  if (node.wholeText.includes(match)) {
@@ -830,7 +854,7 @@ function createHtmlPasteEvent(htmlContent) {
830
854
 
831
855
  Cypress.Commands.add('addNewBlock', (blockName, createNewSlate = false) => {
832
856
  let block;
833
- block = cy.getSlate(createNewSlate).type(`/${blockName}{enter}`);
857
+ block = cy.getSlate(createNewSlate).click().type(`/${blockName}{enter}`);
834
858
  return block;
835
859
  });
836
860
 
@@ -884,5 +908,38 @@ Cypress.Commands.add('configureListingWith', (contentType) => {
884
908
  '.querystring-widget .fields:first-of-type > .field .react-select__menu .react-select__option',
885
909
  )
886
910
  .contains(contentType)
911
+
887
912
  .click();
888
913
  });
914
+
915
+ Cypress.Commands.add(
916
+ 'addLocationQuerystring',
917
+ (option = 'Relative path', value) => {
918
+ cy.get('.block-editor-listing').click();
919
+ cy.get('.querystring-widget .fields').contains('Add criteria').click();
920
+ cy.get('.querystring-widget .react-select__menu .react-select__option')
921
+ .contains('Location')
922
+ .click();
923
+
924
+ cy.get('.querystring-widget .fields').contains('Absolute path').click();
925
+ cy.get(
926
+ '.querystring-widget .fields .react-select__menu .react-select__option',
927
+ )
928
+ .contains(option)
929
+ .click();
930
+ if (value) {
931
+ cy.get('.querystring-widget .fields .input')
932
+ .click()
933
+ .type(`${value}{enter}`);
934
+ }
935
+ },
936
+ );
937
+
938
+ Cypress.Commands.add('queryCounter', (path, steps, number = 1) => {
939
+ cy.intercept(path, cy.spy().as('counterName'));
940
+ steps.forEach((element) => {
941
+ element();
942
+ });
943
+
944
+ cy.get('@counterName').its('callCount').should('equal', number);
945
+ });