@kitconcept/volto-light-theme 3.1.2 → 3.3.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.
Files changed (122) hide show
  1. package/.changelog.draft +12 -0
  2. package/.release-it.json +5 -1
  3. package/CHANGELOG.md +25 -4
  4. package/README.md +45 -134
  5. package/build/messages/src/components/Anontools/Anontools.json +10 -0
  6. package/build/messages/src/components/Blocks/Button/schema.json +6 -0
  7. package/build/messages/src/components/Blocks/EventMetadata/View.json +30 -0
  8. package/build/messages/src/components/Blocks/Image/Edit.json +10 -0
  9. package/build/messages/src/components/Blocks/Image/ImageSidebar.json +18 -0
  10. package/build/messages/src/components/Blocks/Image/schema.json +10 -0
  11. package/build/messages/src/components/Blocks/Listing/ListingBody.json +26 -0
  12. package/build/messages/src/components/Blocks/Search/TopSideFacets.json +10 -0
  13. package/build/messages/src/components/Blocks/Search/components/SearchDetails.json +10 -0
  14. package/build/messages/src/components/Blocks/Search/components/SearchInput.json +6 -0
  15. package/build/messages/src/components/Blocks/Slider/DefaultBody.json +18 -0
  16. package/build/messages/src/components/Blocks/Slider/schema.json +14 -0
  17. package/build/messages/src/components/Blocks/schema.json +6 -0
  18. package/build/messages/src/components/Breadcrumbs/Breadcrumbs.json +10 -0
  19. package/build/messages/src/components/Footer/Footer.json +30 -0
  20. package/build/messages/src/components/Header/Header.json +6 -0
  21. package/build/messages/src/components/LanguageSelector/LanguageSelector.json +6 -0
  22. package/build/messages/src/components/Logo/Logo.json +10 -0
  23. package/build/messages/src/components/MobileNavigation/MobileNavigation.json +26 -0
  24. package/build/messages/src/components/Navigation/Navigation.json +10 -0
  25. package/build/messages/src/components/SearchWidget/IntranetSearchWidget.json +14 -0
  26. package/build/messages/src/components/SearchWidget/SearchWidget.json +10 -0
  27. package/build/messages/src/components/Theme/EventView.json +6 -0
  28. package/build/messages/src/components/Widgets/AlignWidget.json +22 -0
  29. package/build/messages/src/index.json +10 -0
  30. package/locales/de/LC_MESSAGES/volto.po +7 -7
  31. package/locales/en/LC_MESSAGES/volto.po +7 -7
  32. package/locales/es/LC_MESSAGES/volto.po +10 -9
  33. package/locales/eu/LC_MESSAGES/volto.po +10 -9
  34. package/locales/pt_BR/volto.po +7 -7
  35. package/locales/volto.pot +8 -8
  36. package/package.json +8 -26
  37. package/src/components/Blocks/Image/Edit.jsx +14 -14
  38. package/src/components/Blocks/Image/ImageSidebar.jsx +3 -3
  39. package/src/components/Blocks/Image/View.jsx +17 -17
  40. package/src/components/Footer/Footer.jsx +2 -2
  41. package/src/components/Header/Header.jsx +12 -12
  42. package/src/index.js +2 -0
  43. package/src/theme/_content.scss +0 -1
  44. package/src/theme/_header.scss +1 -1
  45. package/src/theme/_variables.scss +3 -3
  46. package/.dockerignore +0 -1
  47. package/.editorconfig +0 -34
  48. package/.eslintignore +0 -6
  49. package/.eslintrc +0 -53
  50. package/.github/workflows/acceptance.yml +0 -98
  51. package/.github/workflows/changelog.yml +0 -43
  52. package/.github/workflows/code.yml +0 -16
  53. package/.github/workflows/deploy.yml +0 -105
  54. package/.github/workflows/unit.yml +0 -16
  55. package/.prettierignore +0 -3
  56. package/.prettierrc +0 -12
  57. package/.stylelintrc +0 -32
  58. package/.yarn/releases/yarn-3.2.3.cjs +0 -783
  59. package/.yarnrc.yml +0 -3
  60. package/Makefile +0 -174
  61. package/UPGRADE-GUIDE.md +0 -38
  62. package/acceptance/.gitkeep +0 -0
  63. package/acceptance/ci-a11y.yml +0 -31
  64. package/acceptance/ci.yml +0 -29
  65. package/acceptance/cypress/.gitkeep +0 -0
  66. package/acceptance/cypress/fixtures/broccoli.jpg +0 -0
  67. package/acceptance/cypress/fixtures/example.json +0 -5
  68. package/acceptance/cypress/fixtures/file.pdf +0 -0
  69. package/acceptance/cypress/fixtures/halfdome2022.jpg +0 -0
  70. package/acceptance/cypress/fixtures/image.png +0 -0
  71. package/acceptance/cypress/plugins/index.js +0 -17
  72. package/acceptance/cypress/support/commands.js +0 -23
  73. package/acceptance/cypress/support/e2e.js +0 -23
  74. package/acceptance/cypress/support/reset-fixture.js +0 -45
  75. package/acceptance/cypress/support/slate.js +0 -14
  76. package/acceptance/cypress/tests/.gitkeep +0 -0
  77. package/acceptance/cypress/tests/a11y/accordionBlock.cy.js +0 -30
  78. package/acceptance/cypress/tests/a11y/basic.cy.js +0 -26
  79. package/acceptance/cypress/tests/a11y/buttonBlock.cy.js +0 -18
  80. package/acceptance/cypress/tests/a11y/eventContenttype.cy.js +0 -18
  81. package/acceptance/cypress/tests/a11y/fileContenttype.cy.js +0 -18
  82. package/acceptance/cypress/tests/a11y/gridBlock.cy.js +0 -18
  83. package/acceptance/cypress/tests/a11y/gridImageBlock.cy.js +0 -18
  84. package/acceptance/cypress/tests/a11y/gridListingBlock.cy.js +0 -18
  85. package/acceptance/cypress/tests/a11y/gridTeaserBlock.cy.js +0 -18
  86. package/acceptance/cypress/tests/a11y/gridTextBlock.cy.js +0 -33
  87. package/acceptance/cypress/tests/a11y/headingBlock.cy.js +0 -18
  88. package/acceptance/cypress/tests/a11y/highlightBlock.cy.js +0 -18
  89. package/acceptance/cypress/tests/a11y/imageBlock.cy.js +0 -18
  90. package/acceptance/cypress/tests/a11y/imageContenttype.cy.js +0 -18
  91. package/acceptance/cypress/tests/a11y/introductionBlock.cy.js +0 -18
  92. package/acceptance/cypress/tests/a11y/linkContenttype.cy.js +0 -18
  93. package/acceptance/cypress/tests/a11y/listingBlock.cy.js +0 -31
  94. package/acceptance/cypress/tests/a11y/mapsBlock.cy.js +0 -27
  95. package/acceptance/cypress/tests/a11y/newsItemContenttype.cy.js +0 -27
  96. package/acceptance/cypress/tests/a11y/pageContent.cy.js +0 -27
  97. package/acceptance/cypress/tests/a11y/searchBlock.cy.js +0 -18
  98. package/acceptance/cypress/tests/a11y/separatorBlock.cy.js +0 -28
  99. package/acceptance/cypress/tests/a11y/tableBlock.cy.js +0 -26
  100. package/acceptance/cypress/tests/a11y/teaserBlock.cy.js +0 -18
  101. package/acceptance/cypress/tests/a11y/textBlock.cy.js +0 -18
  102. package/acceptance/cypress/tests/a11y/tocBlock.cy.js +0 -18
  103. package/acceptance/cypress/tests/a11y/videoBlock.cy.js +0 -27
  104. package/acceptance/cypress/tests/main/basic.cy.js +0 -71
  105. package/acceptance/cypress/tests/main/blocks-map.cy.js +0 -56
  106. package/acceptance/cypress/tests/main/blocks-table.cy.js +0 -127
  107. package/acceptance/cypress/tests/main/listing-grid.cy.js +0 -77
  108. package/acceptance/cypress/tests/main/nav.cy.js +0 -54
  109. package/acceptance/cypress/tests/main/site-action.cy.js +0 -16
  110. package/acceptance/cypress.config.js +0 -17
  111. package/acceptance/docker-compose-a11y.yml +0 -55
  112. package/acceptance/docker-compose.yml +0 -53
  113. package/acceptance/package.json +0 -5
  114. package/acceptance/yarn.lock +0 -2638
  115. package/devops/stacks/light-theme.kitconcept.io.yml +0 -66
  116. package/dockerfiles/Dockerfile +0 -32
  117. package/dockerfiles/Dockerfile.acceptance +0 -19
  118. package/dockerfiles/Dockerfile.dev +0 -24
  119. package/dockerfiles/docker-compose.yml +0 -56
  120. package/dockerfiles/helper.py +0 -132
  121. package/volto-light-theme.png +0 -0
  122. package/volto.config.js +0 -7
@@ -1,18 +0,0 @@
1
- describe('a11y tests', () => {
2
- beforeEach(() => {
3
- // Cypress starts out with a blank slate for each test
4
- // so we must tell it to visit our website with the `cy.visit()` command.
5
- // Since we want to visit the same URL at the start of all our tests,
6
- // we include it in our beforeEach function so that it runs before each test
7
- cy.visit('/');
8
- });
9
-
10
- // Heading
11
- it('Heading-Block (/block/heading-block)', () => {
12
- cy.navigate('/block/heading-block');
13
- cy.wait(2000);
14
- cy.injectAxe();
15
- cy.configureAxe();
16
- cy.checkAccessibility();
17
- });
18
- });
@@ -1,18 +0,0 @@
1
- describe('a11y tests', () => {
2
- beforeEach(() => {
3
- // Cypress starts out with a blank slate for each test
4
- // so we must tell it to visit our website with the `cy.visit()` command.
5
- // Since we want to visit the same URL at the start of all our tests,
6
- // we include it in our beforeEach function so that it runs before each test
7
- cy.visit('/');
8
- });
9
-
10
- // Highlight Block
11
- it('Highlight-Block (/block/highlight-block)', () => {
12
- cy.navigate('/block/highlight-block');
13
- cy.wait(2000);
14
- cy.injectAxe();
15
- cy.configureAxe();
16
- cy.checkAccessibility();
17
- });
18
- });
@@ -1,18 +0,0 @@
1
- describe('a11y tests', () => {
2
- beforeEach(() => {
3
- // Cypress starts out with a blank slate for each test
4
- // so we must tell it to visit our website with the `cy.visit()` command.
5
- // Since we want to visit the same URL at the start of all our tests,
6
- // we include it in our beforeEach function so that it runs before each test
7
- cy.visit('/');
8
- });
9
-
10
- // Image-Block
11
- it('Image-Block (/block/image-block)', () => {
12
- cy.navigate('/block/image-block');
13
- cy.wait(2000);
14
- cy.injectAxe();
15
- cy.configureAxe();
16
- cy.checkAccessibility();
17
- });
18
- });
@@ -1,18 +0,0 @@
1
- describe('a11y tests', () => {
2
- beforeEach(() => {
3
- // Cypress starts out with a blank slate for each test
4
- // so we must tell it to visit our website with the `cy.visit()` command.
5
- // Since we want to visit the same URL at the start of all our tests,
6
- // we include it in our beforeEach function so that it runs before each test
7
- cy.visit('/');
8
- });
9
-
10
- //Image
11
- it('Image (/content-types/image)', () => {
12
- cy.navigate('/content-types/image');
13
- cy.wait(2000);
14
- cy.injectAxe();
15
- cy.configureAxe();
16
- cy.checkAccessibility();
17
- });
18
- });
@@ -1,18 +0,0 @@
1
- describe('a11y tests', () => {
2
- beforeEach(() => {
3
- // Cypress starts out with a blank slate for each test
4
- // so we must tell it to visit our website with the `cy.visit()` command.
5
- // Since we want to visit the same URL at the start of all our tests,
6
- // we include it in our beforeEach function so that it runs before each test
7
- cy.visit('/');
8
- });
9
-
10
- // Introduction-Block
11
- it('Introduction-Block (/block/introduction-block)', () => {
12
- cy.navigate('/block/introduction-block');
13
- cy.wait(2000);
14
- cy.injectAxe();
15
- cy.configureAxe();
16
- cy.checkAccessibility();
17
- });
18
- });
@@ -1,18 +0,0 @@
1
- describe('a11y tests', () => {
2
- beforeEach(() => {
3
- // Cypress starts out with a blank slate for each test
4
- // so we must tell it to visit our website with the `cy.visit()` command.
5
- // Since we want to visit the same URL at the start of all our tests,
6
- // we include it in our beforeEach function so that it runs before each test
7
- cy.visit('/');
8
- });
9
-
10
- //Link
11
- it('link (/content-types/internal-link)', () => {
12
- cy.navigate('/content-types/internal-link');
13
- cy.wait(2000);
14
- cy.injectAxe();
15
- cy.configureAxe();
16
- cy.checkAccessibility();
17
- });
18
- });
@@ -1,31 +0,0 @@
1
- describe('a11y tests', () => {
2
- beforeEach(() => {
3
- // Cypress starts out with a blank slate for each test
4
- // so we must tell it to visit our website with the `cy.visit()` command.
5
- // Since we want to visit the same URL at the start of all our tests,
6
- // we include it in our beforeEach function so that it runs before each test
7
- cy.visit('/');
8
- });
9
-
10
- // Listing-block
11
- it('Listing-block (/block/listing-block)', () => {
12
- cy.navigate('/block/listing-block');
13
- cy.wait(2000);
14
- cy.injectAxe();
15
- cy.configureAxe({
16
- // Disabling 'image-alt'
17
- // semantic-ui-react's Embed doesn't include an alt tag for the placeholder image
18
- rules: [
19
- {
20
- id: 'image-alt',
21
- enabled: false,
22
- },
23
- {
24
- id: 'nested-interactive',
25
- enabled: false,
26
- },
27
- ],
28
- });
29
- cy.checkAccessibility();
30
- });
31
- });
@@ -1,27 +0,0 @@
1
- describe('a11y tests', () => {
2
- beforeEach(() => {
3
- // Cypress starts out with a blank slate for each test
4
- // so we must tell it to visit our website with the `cy.visit()` command.
5
- // Since we want to visit the same URL at the start of all our tests,
6
- // we include it in our beforeEach function so that it runs before each test
7
- cy.visit('/');
8
- });
9
-
10
- // Maps block
11
- it('Maps Block (/block/maps-block)', () => {
12
- cy.navigate('/block/maps-block');
13
- cy.wait(2000);
14
- cy.injectAxe();
15
- cy.configureAxe({
16
- rules: [
17
- // there are two copies of slate h3,
18
- // which have with the same id
19
- {
20
- id: 'duplicate-id-active',
21
- enabled: false,
22
- },
23
- ],
24
- });
25
- cy.checkAccessibility();
26
- });
27
- });
@@ -1,27 +0,0 @@
1
- describe('a11y tests', () => {
2
- beforeEach(() => {
3
- // Cypress starts out with a blank slate for each test
4
- // so we must tell it to visit our website with the `cy.visit()` command.
5
- // Since we want to visit the same URL at the start of all our tests,
6
- // we include it in our beforeEach function so that it runs before each test
7
- cy.visit('/');
8
- });
9
-
10
- //news-item
11
- it('news-item (/content-types/news-item)', () => {
12
- cy.navigate('/content-types/news-item');
13
- cy.wait(2000);
14
- cy.injectAxe();
15
- cy.configureAxe({
16
- rules: [
17
- // there are two copies of slate h3,
18
- // which have with the same id
19
- {
20
- id: 'duplicate-id-active',
21
- enabled: false,
22
- },
23
- ],
24
- });
25
- cy.checkAccessibility();
26
- });
27
- });
@@ -1,27 +0,0 @@
1
- describe('a11y tests', () => {
2
- beforeEach(() => {
3
- // Cypress starts out with a blank slate for each test
4
- // so we must tell it to visit our website with the `cy.visit()` command.
5
- // Since we want to visit the same URL at the start of all our tests,
6
- // we include it in our beforeEach function so that it runs before each test
7
- cy.visit('/');
8
- });
9
-
10
- //Page
11
- it('Page (/content-types/page)', () => {
12
- cy.navigate('/content-types/page');
13
- cy.wait(2000);
14
- cy.injectAxe();
15
- cy.configureAxe({
16
- rules: [
17
- // there are two copies of slate h3,
18
- // which have with the same id
19
- {
20
- id: 'duplicate-id-active',
21
- enabled: false,
22
- },
23
- ],
24
- });
25
- cy.checkAccessibility();
26
- });
27
- });
@@ -1,18 +0,0 @@
1
- describe('a11y tests', () => {
2
- beforeEach(() => {
3
- // Cypress starts out with a blank slate for each test
4
- // so we must tell it to visit our website with the `cy.visit()` command.
5
- // Since we want to visit the same URL at the start of all our tests,
6
- // we include it in our beforeEach function so that it runs before each test
7
- cy.visit('/');
8
- });
9
-
10
- // Search-block
11
- it('Search-block (/block/search-block)', () => {
12
- cy.navigate('/block/search-block');
13
- cy.wait(2000);
14
- cy.injectAxe();
15
- cy.configureAxe();
16
- cy.checkAccessibility();
17
- });
18
- });
@@ -1,28 +0,0 @@
1
- describe('a11y tests', () => {
2
- beforeEach(() => {
3
- // Cypress starts out with a blank slate for each test
4
- // so we must tell it to visit our website with the `cy.visit()` command.
5
- // Since we want to visit the same URL at the start of all our tests,
6
- // we include it in our beforeEach function so that it runs before each test
7
- cy.visit('/');
8
- });
9
-
10
- // separator-block
11
- it('Separator-block (/block/separator-block)', () => {
12
- cy.navigate('/block/separator-block');
13
- cy.wait(2000);
14
- cy.injectAxe();
15
- cy.configureAxe({
16
- rules: [
17
- // there are copies of slate h3,
18
- // which have with the same id
19
- {
20
- id: 'duplicate-id-active',
21
- enabled: false,
22
- },
23
-
24
- ],
25
- });
26
- cy.checkAccessibility();
27
- });
28
- });
@@ -1,26 +0,0 @@
1
- describe('a11y tests', () => {
2
- beforeEach(() => {
3
- // Cypress starts out with a blank slate for each test
4
- // so we must tell it to visit our website with the `cy.visit()` command.
5
- // Since we want to visit the same URL at the start of all our tests,
6
- // we include it in our beforeEach function so that it runs before each test
7
- cy.visit('/');
8
- });
9
-
10
- // Table-block
11
- it('Table-block (/block/table-block)', () => {
12
- cy.navigate('/block/table-block');
13
- cy.wait(2000);
14
- cy.injectAxe();
15
- cy.configureAxe({
16
- rules: [
17
- // the example page intentionally omits the h1
18
- {
19
- id: 'page-has-heading-one',
20
- enabled: false,
21
- },
22
- ],
23
- });
24
- cy.checkAccessibility();
25
- });
26
- });
@@ -1,18 +0,0 @@
1
- describe('a11y tests', () => {
2
- beforeEach(() => {
3
- // Cypress starts out with a blank slate for each test
4
- // so we must tell it to visit our website with the `cy.visit()` command.
5
- // Since we want to visit the same URL at the start of all our tests,
6
- // we include it in our beforeEach function so that it runs before each test
7
- cy.visit('/');
8
- });
9
-
10
- // Teaser-block
11
- it('Teaser-block (/block/teaser-block)', () => {
12
- cy.navigate('/block/teaser-block');
13
- cy.wait(2000);
14
- cy.injectAxe();
15
- cy.configureAxe();
16
- cy.checkAccessibility();
17
- });
18
- });
@@ -1,18 +0,0 @@
1
- describe('a11y tests', () => {
2
- beforeEach(() => {
3
- // Cypress starts out with a blank slate for each test
4
- // so we must tell it to visit our website with the `cy.visit()` command.
5
- // Since we want to visit the same URL at the start of all our tests,
6
- // we include it in our beforeEach function so that it runs before each test
7
- cy.visit('/');
8
- });
9
-
10
- // Text-block
11
- it('Text-block (/block/text-block)', () => {
12
- cy.navigate('/block/text-block');
13
- cy.wait(2000);
14
- cy.injectAxe();
15
- cy.configureAxe();
16
- cy.checkAccessibility();
17
- });
18
- });
@@ -1,18 +0,0 @@
1
- describe('a11y tests', () => {
2
- beforeEach(() => {
3
- // Cypress starts out with a blank slate for each test
4
- // so we must tell it to visit our website with the `cy.visit()` command.
5
- // Since we want to visit the same URL at the start of all our tests,
6
- // we include it in our beforeEach function so that it runs before each test
7
- cy.visit('/');
8
- });
9
-
10
- // Table of Contents
11
- it('Table of Contents (/block/toc-block)', () => {
12
- cy.navigate('/block/toc-block');
13
- cy.wait(2000);
14
- cy.injectAxe();
15
- cy.configureAxe();
16
- cy.checkAccessibility();
17
- });
18
- });
@@ -1,27 +0,0 @@
1
- describe('a11y tests', () => {
2
- beforeEach(() => {
3
- // Cypress starts out with a blank slate for each test
4
- // so we must tell it to visit our website with the `cy.visit()` command.
5
- // Since we want to visit the same URL at the start of all our tests,
6
- // we include it in our beforeEach function so that it runs before each test
7
- cy.visit('/');
8
- });
9
-
10
- // Video Block
11
- it('Video Block (/block/video-block)', () => {
12
- cy.navigate('/block/video-block');
13
- cy.wait(2000);
14
- cy.injectAxe();
15
- cy.configureAxe({
16
- // Disabling 'image-alt'
17
- // semantic-ui-react's Embed doesn't include an alt tag for the placeholder image
18
- rules: [
19
- {
20
- id: 'image-alt',
21
- enabled: false,
22
- },
23
- ],
24
- });
25
- cy.checkAccessibility();
26
- });
27
- });
@@ -1,71 +0,0 @@
1
- import {
2
- getSlateEditorAndType,
3
- getSelectedSlateEditor,
4
- } from '../../support/slate';
5
-
6
- context('Basic Acceptance Tests', () => {
7
- describe('Text Block Tests', () => {
8
- beforeEach(() => {
9
- cy.intercept('GET', `/**/*?expand*`).as('content');
10
- cy.intercept('GET', '/**/Document').as('schema');
11
-
12
- // given a logged in editor and a page in edit mode
13
- cy.autologin();
14
- cy.createContent({
15
- contentType: 'Document',
16
- contentId: 'document',
17
- contentTitle: 'Document',
18
- });
19
- cy.visit('/');
20
- cy.wait('@content');
21
- });
22
-
23
- it('As editor I can add a page with a text block', function () {
24
- // when I add a page with a text block
25
- cy.get('#toolbar-add').click();
26
- cy.get('#toolbar-add-document').click({ force: true });
27
- cy.get('.documentFirstHeading')
28
- .type('My Page')
29
- .get('.documentFirstHeading')
30
- .contains('My Page');
31
-
32
- getSlateEditorAndType(
33
- '.block .slate-editor [contenteditable=true]',
34
- 'This is the text',
35
- );
36
-
37
- getSelectedSlateEditor().contains('This is the text');
38
- cy.get('#toolbar-save').click();
39
- cy.wait('@content');
40
- cy.url().should('eq', Cypress.config().baseUrl + '/my-page');
41
- });
42
-
43
- it('As editor I can add a link to a text block', function () {
44
- cy.navigate('/document/edit');
45
- cy.wait('@schema');
46
-
47
- cy.get('.block.inner.title .documentFirstHeading');
48
-
49
- cy.log('when I create a link');
50
-
51
- cy.getSlateEditorAndType(
52
- 'Colorless green ideas sleep furiously.',
53
- ).setSlateSelection('furiously');
54
- cy.clickSlateButton('Add link');
55
- cy.get('.slate-toolbar .link-form-container input').type(
56
- 'https://google.com{enter}',
57
- );
58
-
59
- cy.get('#toolbar-save', { timeout: 10000 }).click();
60
- cy.wait('@content');
61
-
62
- cy.log('then the page view should contain a link');
63
-
64
- cy.get('.container p').contains('Colorless green ideas sleep furiously.');
65
- cy.get('.container p a')
66
- .should('have.text', 'furiously')
67
- .and('have.attr', 'href')
68
- .and('include', 'https://google.com');
69
- });
70
- });
71
- });
@@ -1,56 +0,0 @@
1
- describe('Map Block Tests', () => {
2
- beforeEach(() => {
3
- cy.intercept('GET', `/**/*?expand*`).as('content');
4
- cy.intercept('GET', '/**/Document').as('schema');
5
- // given a logged in editor and a page in edit mode
6
- cy.autologin();
7
- cy.createContent({
8
- contentType: 'Document',
9
- contentId: 'my-page',
10
- contentTitle: 'My Page',
11
- });
12
- cy.visit('/my-page');
13
- cy.wait('@content');
14
- cy.navigate('/my-page/edit');
15
- cy.wait('@content');
16
- });
17
-
18
- it('Add maps block - Google Maps', () => {
19
- // when I add a maps block
20
- cy.addNewBlock('maps');
21
-
22
- cy.get(`.block.maps .toolbar-inner .ui.input input`)
23
- .type(
24
- '<iframe src="https://www.google.com/maps/embed?pb=" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>',
25
- )
26
- .type('{enter}');
27
- cy.get('#toolbar-save').click();
28
- cy.wait('@content');
29
- cy.url().should('eq', Cypress.config().baseUrl + '/my-page');
30
-
31
- // then the page view should contain the maps block
32
- cy.get('#page-document iframe')
33
- .should('have.attr', 'src')
34
- .and('match', /\/\/www.google.com\/maps\/embed\?pb=/);
35
- });
36
-
37
- it('Add maps block - OpenStreet Maps', () => {
38
- // when I add a maps block
39
- cy.addNewBlock('maps');
40
-
41
- cy.get(`.block.maps .toolbar-inner .ui.input input`)
42
- .type(
43
- '<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://www.openstreetmap.org/export/embed.html?bbox=2.0408821105957036%2C41.2938013640244%2C2.2400093078613286%2C41.49109217223111&amp;layer=mapnik" style="border: 1px solid black"></iframe><br/><small><a href="https://www.openstreetmap.org/#map=13/41.3925/2.1404">View Larger Map</a></small>',
44
- )
45
- .type('{enter}');
46
- cy.get('#toolbar-save').click();
47
- cy.wait('@content');
48
- cy.url().should('eq', Cypress.config().baseUrl + '/my-page');
49
-
50
- // cy.pause();
51
- // then the page view should contain the maps block
52
- cy.get('#page-document iframe')
53
- .should('have.attr', 'src')
54
- .and('match', /\/\/www.openstreetmap.org\/export\/embed/);
55
- });
56
- });
@@ -1,127 +0,0 @@
1
- describe('Table Block Tests', () => {
2
- beforeEach(() => {
3
- cy.intercept('GET', `/**/*?expand*`).as('content');
4
- cy.intercept('GET', '/**/Document').as('schema');
5
-
6
- // given a logged in editor and a page in edit mode
7
- cy.autologin();
8
- cy.createContent({
9
- contentType: 'Document',
10
- contentId: 'my-page',
11
- contentTitle: 'My Page',
12
- });
13
- cy.visit('/my-page');
14
- cy.wait('@content');
15
-
16
- cy.navigate('/my-page/edit');
17
- cy.wait('@schema');
18
- });
19
-
20
- it('Add table block', () => {
21
- cy.intercept('PATCH', '*').as('save');
22
-
23
- // Edit
24
- cy.addNewBlock('table');
25
- cy.wait(2000);
26
- cy.get(
27
- '.celled.fixed.table thead tr th:first-child() [contenteditable="true"]',
28
- )
29
- .focus()
30
- .click()
31
- .type('column 1 / row 1');
32
- cy.get(
33
- '.celled.fixed.table thead tr th:nth-child(2) [contenteditable="true"]',
34
- )
35
- .focus()
36
- .click()
37
- .type('column 2 / row 1');
38
- cy.get(
39
- '.celled.fixed.table tbody tr:nth-child(1) td:first-child() [contenteditable="true"]',
40
- )
41
- .focus()
42
- .click()
43
- .type('column 1 / row 2');
44
- cy.get(
45
- '.celled.fixed.table tbody tr:nth-child(1) td:nth-child(2) [contenteditable="true"]',
46
- )
47
- .focus()
48
- .click()
49
- .type('column 2 / row 2');
50
- cy.get('button[title="Insert col after"]').click();
51
- cy.get('button[title="Insert row after"]').click();
52
- cy.get('button[title="Insert row before"]').click();
53
- cy.get('button[title="Insert col before"]').click();
54
-
55
- // Save
56
- cy.get('#toolbar-save').click();
57
- cy.wait('@save');
58
- cy.wait('@content');
59
-
60
- // View
61
- cy.get('.celled.fixed.table thead tr th:first-child()').contains(
62
- 'column 1 / row 1',
63
- );
64
- cy.get('.celled.fixed.table thead tr th:nth-child(3)').contains(
65
- 'column 2 / row 1',
66
- );
67
- cy.get(
68
- '.celled.fixed.table tbody tr:nth-child(2) td:first-child()',
69
- ).contains('column 1 / row 2');
70
- cy.get(
71
- '.celled.fixed.table tbody tr:nth-child(2) td:nth-child(3)',
72
- ).contains('column 2 / row 2');
73
-
74
- // Edit
75
- cy.visit('/my-page/edit');
76
- cy.wait('@schema');
77
-
78
- cy.get('#toolbar-save').should('be.visible');
79
- cy.get('.celled.fixed.table tr:first-child() th:nth-child(2)').should(
80
- 'be.visible',
81
- );
82
-
83
- cy.get('.celled.fixed.table tr:first-child() th:nth-child(2)').click({
84
- waitForAnimations: false,
85
- });
86
-
87
- // without the second click the test fails. so this makes the test green.
88
- cy.get(
89
- '.celled.fixed.table thead tr:first-child() th:nth-child(2)',
90
- ).click();
91
-
92
- cy.get('button[title="Delete col"]').click();
93
- cy.get(
94
- '.celled.fixed.table thead tr:first-child() th:nth-child(3)',
95
- ).click();
96
- cy.get('button[title="Delete col"]').click();
97
- cy.get(
98
- '.celled.fixed.table tbody tr:first-child() td:first-child()',
99
- ).click();
100
- cy.get('button[title="Delete row"]').click();
101
- cy.get(
102
- '.celled.fixed.table tbody tr:nth-child(2) td:first-child()',
103
- ).click();
104
- cy.get('button[title="Delete row"]').click();
105
-
106
- // Save
107
- cy.get('#toolbar-save').click();
108
- cy.wait('@save');
109
- cy.wait('@content');
110
-
111
- // View
112
- cy.get('.celled.fixed.table thead tr th:first-child()').should(
113
- 'contain',
114
- 'column 1 / row 1',
115
- );
116
- cy.get('.celled.fixed.table thead tr th:nth-child(2)> p ').should(
117
- 'have.text',
118
- 'column 2 / row 1',
119
- );
120
- cy.get(
121
- '.celled.fixed.table tbody tr:first-child() td:first-child()',
122
- ).contains('column 1 / row 2');
123
- cy.get(
124
- '.celled.fixed.table tbody tr:first-child() td:nth-child(2)',
125
- ).contains('column 2 / row 2');
126
- });
127
- });