From 3c12d25c037b83a2d44017e4efbf5ff791b4f1d6 Mon Sep 17 00:00:00 2001 From: Vasile Chindris Date: Mon, 14 Oct 2024 22:10:36 +0300 Subject: [PATCH 01/42] chore(SLB-487): remove the type property from the suggestions query --- packages/drupal/gutenberg_blocks/js/blocks/cta.tsx | 1 - packages/drupal/gutenberg_blocks/js/blocks/teaser-item.tsx | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/drupal/gutenberg_blocks/js/blocks/cta.tsx b/packages/drupal/gutenberg_blocks/js/blocks/cta.tsx index 359d2aaa5..afb45d280 100644 --- a/packages/drupal/gutenberg_blocks/js/blocks/cta.tsx +++ b/packages/drupal/gutenberg_blocks/js/blocks/cta.tsx @@ -116,7 +116,6 @@ registerBlockType<{ // for 'data-entity-type' in the onChange() handler by yourself. //suggestionsQuery={{ - // type: 'post', // subtype: 'gutenberg', //}} diff --git a/packages/drupal/gutenberg_blocks/js/blocks/teaser-item.tsx b/packages/drupal/gutenberg_blocks/js/blocks/teaser-item.tsx index 2b2192d8b..d0fd1f7dd 100644 --- a/packages/drupal/gutenberg_blocks/js/blocks/teaser-item.tsx +++ b/packages/drupal/gutenberg_blocks/js/blocks/teaser-item.tsx @@ -39,7 +39,6 @@ registerBlockType<{ }} settings={{}} suggestionsQuery={{ - type: 'post', // Use the teaser_list linkit profile to fetch suggestions. subtype: 'teaser_list', }} From 27a98a02b133f4138a30435c315a6d9825b57e42 Mon Sep 17 00:00:00 2001 From: Eli Stone <2546188+elistone@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:10:48 +0000 Subject: [PATCH 02/42] chore(SLB-508): delete minimal content --- .../17626bb4-557f-48fc-b869-ae566f4ceae6.yml | 60 -------------- .../ceb9b2a7-4c4c-4084-ada9-d5f6505d466b.yml | 81 ------------------- 2 files changed, 141 deletions(-) delete mode 100644 packages/drupal/test_content/content/node/17626bb4-557f-48fc-b869-ae566f4ceae6.yml delete mode 100644 packages/drupal/test_content/content/node/ceb9b2a7-4c4c-4084-ada9-d5f6505d466b.yml diff --git a/packages/drupal/test_content/content/node/17626bb4-557f-48fc-b869-ae566f4ceae6.yml b/packages/drupal/test_content/content/node/17626bb4-557f-48fc-b869-ae566f4ceae6.yml deleted file mode 100644 index b18e817e6..000000000 --- a/packages/drupal/test_content/content/node/17626bb4-557f-48fc-b869-ae566f4ceae6.yml +++ /dev/null @@ -1,60 +0,0 @@ -_meta: - version: '1.0' - entity_type: node - uuid: 17626bb4-557f-48fc-b869-ae566f4ceae6 - bundle: page - default_langcode: en -default: - revision_uid: - - - target_id: 1 - status: - - - value: true - uid: - - - target_id: 1 - title: - - - value: 'Page: minimal' - created: - - - value: 1686758984 - promote: - - - value: false - sticky: - - - value: false - moderation_state: - - - value: published - pate_is_template: - - - value: false - pate_structure_only: - - - value: false - path: - - - alias: /page-minimal - langcode: en - pathauto: 0 - content_translation_source: - - - value: und - content_translation_outdated: - - - value: false - body: - - - value: |- - - - - -

- - - format: gutenberg - summary: '' diff --git a/packages/drupal/test_content/content/node/ceb9b2a7-4c4c-4084-ada9-d5f6505d466b.yml b/packages/drupal/test_content/content/node/ceb9b2a7-4c4c-4084-ada9-d5f6505d466b.yml deleted file mode 100644 index afb06f0f3..000000000 --- a/packages/drupal/test_content/content/node/ceb9b2a7-4c4c-4084-ada9-d5f6505d466b.yml +++ /dev/null @@ -1,81 +0,0 @@ -_meta: - version: '1.0' - entity_type: node - uuid: ceb9b2a7-4c4c-4084-ada9-d5f6505d466b - bundle: page - default_langcode: en -default: - revision_uid: - - - target_id: 1 - status: - - - value: true - uid: - - - target_id: 1 - title: - - - value: 'Blocks: minimal' - created: - - - value: 1686759406 - promote: - - - value: false - sticky: - - - value: false - moderation_state: - - - value: published - pate_is_template: - - - value: false - pate_structure_only: - - - value: false - path: - - - alias: /blocks-minimal - langcode: en - pathauto: 0 - content_translation_source: - - - value: und - content_translation_outdated: - - - value: false - body: - - - value: |- - - - - - - - - - - - - -
- - - -

- - - - - - -

- - - - - format: gutenberg - summary: '' From 4f73537a37a0d9943e08ddfca88bd9c033a94fe8 Mon Sep 17 00:00:00 2001 From: Eli Stone <2546188+elistone@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:13:56 +0000 Subject: [PATCH 03/42] chore(SLB-508): updated the complete content pages --- .../content/node/ef80e284-154b-41fd-9317-154b0a175299.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/drupal/test_content/content/node/ef80e284-154b-41fd-9317-154b0a175299.yml b/packages/drupal/test_content/content/node/ef80e284-154b-41fd-9317-154b0a175299.yml index 7d7ad27e3..81399161d 100644 --- a/packages/drupal/test_content/content/node/ef80e284-154b-41fd-9317-154b0a175299.yml +++ b/packages/drupal/test_content/content/node/ef80e284-154b-41fd-9317-154b0a175299.yml @@ -100,14 +100,14 @@ translations: body: - value: |- - + -

Paragraph

+

Absatz

- + format: gutenberg summary: '' From 7d051948678ba2da2cb11fba5e56f73f79a016c4 Mon Sep 17 00:00:00 2001 From: Eli Stone <2546188+elistone@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:20:14 +0000 Subject: [PATCH 04/42] chore(SLB-508): updating specs after removing minimal content --- tests/schema/specs/blocks.spec.ts | 61 ------------------------------ tests/schema/specs/content.spec.ts | 49 ------------------------ 2 files changed, 110 deletions(-) diff --git a/tests/schema/specs/blocks.spec.ts b/tests/schema/specs/blocks.spec.ts index 68e1756ac..3959b9f55 100644 --- a/tests/schema/specs/blocks.spec.ts +++ b/tests/schema/specs/blocks.spec.ts @@ -95,9 +95,6 @@ test('Blocks', async () => { complete: _loadDrupalPage(id: "a397ca48-8fad-411e-8901-0eba2feb989c") { ...Blocks } - minimal: _loadDrupalPage(id: "ceb9b2a7-4c4c-4084-ada9-d5f6505d466b") { - ...Blocks - } } `); @@ -276,64 +273,6 @@ test('Blocks', async () => { "lead": "Lead text", }, }, - "minimal": { - "content": [ - { - "__typename": "BlockMedia", - "caption": null, - "media": null, - }, - { - "__typename": "BlockForm", - "url": null, - }, - { - "__typename": "BlockMarkup", - "markup": " - - -
- -

- ", - }, - { - "__typename": "BlockCta", - "icon": null, - "iconPosition": null, - "openInNewTab": null, - "text": null, - "url": null, - }, - { - "__typename": "BlockImageWithText", - "image": null, - "imagePosition": "left", - "textContent": { - "__typename": "BlockMarkup", - "markup": " -

- ", - }, - }, - { - "__typename": "BlockQuote", - "author": "Jane Doe", - "image": null, - "quote": "In vitae diam quis odio tincidunt faucibus eget ut libero", - "role": null, - }, - ], - "hero": { - "__typename": "Hero", - "ctaText": null, - "ctaUrl": null, - "formUrl": null, - "headline": "All kinds of blocks with minimum data", - "image": null, - "lead": null, - }, - }, }, } `); diff --git a/tests/schema/specs/content.spec.ts b/tests/schema/specs/content.spec.ts index 4d7484c6f..a107c4a3e 100644 --- a/tests/schema/specs/content.spec.ts +++ b/tests/schema/specs/content.spec.ts @@ -33,9 +33,6 @@ test('Page', async () => { complete: _loadDrupalPage(id: "ef80e284-154b-41fd-9317-154b0a175299") { ...Page } - minimal: _loadDrupalPage(id: "17626bb4-557f-48fc-b869-ae566f4ceae6") { - ...Page - } } `); expect(result).toMatchInlineSnapshot(` @@ -92,52 +89,6 @@ test('Page', async () => { }, "title": "Page: complete", }, - "minimal": { - "content": [ - { - "__typename": "BlockMarkup", - }, - ], - "hero": { - "__typename": "Hero", - }, - "locale": "en", - "metaTags": [ - { - "attributes": { - "content": "Page: minimal | Silverback Drupal Template", - "href": null, - "name": "title", - "property": null, - "rel": null, - }, - "tag": "meta", - }, - { - "attributes": { - "content": "", - "href": null, - "name": "description", - "property": null, - "rel": null, - }, - "tag": "meta", - }, - { - "attributes": { - "content": null, - "href": "http://127.0.0.1:8000/en/page-minimal", - "name": null, - "property": null, - "rel": "canonical", - }, - "tag": "link", - }, - ], - "path": "/en/page-minimal", - "teaserImage": null, - "title": "Page: minimal", - }, }, } `); From 126a4ff99ec54e885fa4bff67123f4b857042239 Mon Sep 17 00:00:00 2001 From: Eli Stone <2546188+elistone@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:52:53 +0000 Subject: [PATCH 05/42] chore(SLB-508): updated example content --- .../080b30e2-5a68-4390-9dec-0c7e850840a7.yml | 60 +++++ .../3164a225-df20-4794-8cfc-b7cd81cfde58.yml | 222 ------------------ .../358dcf0d-0910-4d0b-acc8-5a20108b3f20.yml | 64 +++++ .../4189dec1-3b09-4eec-b4d5-b7cc28eaeae3.yml | 71 ++++++ .../487b2750-bf2a-4b5d-a753-2942a63bb6a4.yml | 72 ++++++ .../54ee7380-a3c0-4c45-8305-933143dc2ff6.yml | 60 +++++ .../557b324d-2183-48e7-9054-6dc90e18beb1.yml | 76 ++++++ .../67c21535-4851-4aea-b46e-c4eccd4e494a.yml | 64 +++++ .../69c06c93-0d3f-47e1-a5ee-ba697bd532c1.yml | 62 +++++ .../71e7b043-3718-4d6a-a2c8-42fb03554800.yml | 72 ++++++ .../7f0f6893-c61d-4ecd-8b74-fb0a0d023ead.yml | 60 +++++ .../87b412b9-09e6-4de4-be13-a97b64df74b8.yml | 76 ++++++ .../a11aaeea-a71a-4ef0-a996-833c95767386.yml | 76 ++++++ .../a23e5334-20fc-4c34-acba-bf3c8cb5fa40.yml | 65 +++++ .../bdbcc2b9-2d33-4723-a6fc-35c5f56b1ab9.yml | 80 +++++++ ... f14c6cb1-b052-4523-ad52-1fbfd32282ff.yml} | 20 +- 16 files changed, 965 insertions(+), 235 deletions(-) create mode 100644 packages/drupal/test_content/content/node/080b30e2-5a68-4390-9dec-0c7e850840a7.yml delete mode 100644 packages/drupal/test_content/content/node/3164a225-df20-4794-8cfc-b7cd81cfde58.yml create mode 100644 packages/drupal/test_content/content/node/358dcf0d-0910-4d0b-acc8-5a20108b3f20.yml create mode 100644 packages/drupal/test_content/content/node/4189dec1-3b09-4eec-b4d5-b7cc28eaeae3.yml create mode 100644 packages/drupal/test_content/content/node/487b2750-bf2a-4b5d-a753-2942a63bb6a4.yml create mode 100644 packages/drupal/test_content/content/node/54ee7380-a3c0-4c45-8305-933143dc2ff6.yml create mode 100644 packages/drupal/test_content/content/node/557b324d-2183-48e7-9054-6dc90e18beb1.yml create mode 100644 packages/drupal/test_content/content/node/67c21535-4851-4aea-b46e-c4eccd4e494a.yml create mode 100644 packages/drupal/test_content/content/node/69c06c93-0d3f-47e1-a5ee-ba697bd532c1.yml create mode 100644 packages/drupal/test_content/content/node/71e7b043-3718-4d6a-a2c8-42fb03554800.yml create mode 100644 packages/drupal/test_content/content/node/7f0f6893-c61d-4ecd-8b74-fb0a0d023ead.yml create mode 100644 packages/drupal/test_content/content/node/87b412b9-09e6-4de4-be13-a97b64df74b8.yml create mode 100644 packages/drupal/test_content/content/node/a11aaeea-a71a-4ef0-a996-833c95767386.yml create mode 100644 packages/drupal/test_content/content/node/a23e5334-20fc-4c34-acba-bf3c8cb5fa40.yml create mode 100644 packages/drupal/test_content/content/node/bdbcc2b9-2d33-4723-a6fc-35c5f56b1ab9.yml rename packages/drupal/test_content/content/node/{52ee5cc7-0ac5-49b5-8550-ce59476bd4ac.yml => f14c6cb1-b052-4523-ad52-1fbfd32282ff.yml} (62%) diff --git a/packages/drupal/test_content/content/node/080b30e2-5a68-4390-9dec-0c7e850840a7.yml b/packages/drupal/test_content/content/node/080b30e2-5a68-4390-9dec-0c7e850840a7.yml new file mode 100644 index 000000000..1a8fce6d8 --- /dev/null +++ b/packages/drupal/test_content/content/node/080b30e2-5a68-4390-9dec-0c7e850840a7.yml @@ -0,0 +1,60 @@ +_meta: + version: '1.0' + entity_type: node + uuid: 080b30e2-5a68-4390-9dec-0c7e850840a7 + bundle: page + default_langcode: en +default: + revision_uid: + - + target_id: 1 + status: + - + value: true + uid: + - + target_id: 1 + title: + - + value: 'Block: CTA' + created: + - + value: 1733840458 + promote: + - + value: false + sticky: + - + value: false + moderation_state: + - + value: published + pate_is_template: + - + value: false + pate_structure_only: + - + value: false + path: + - + alias: /block-cta + langcode: en + pathauto: 0 + content_translation_source: + - + value: und + content_translation_outdated: + - + value: false + body: + - + value: |- + + + + + + + + format: gutenberg + summary: '' diff --git a/packages/drupal/test_content/content/node/3164a225-df20-4794-8cfc-b7cd81cfde58.yml b/packages/drupal/test_content/content/node/3164a225-df20-4794-8cfc-b7cd81cfde58.yml deleted file mode 100644 index 7c1ceaaf9..000000000 --- a/packages/drupal/test_content/content/node/3164a225-df20-4794-8cfc-b7cd81cfde58.yml +++ /dev/null @@ -1,222 +0,0 @@ -_meta: - version: '1.0' - entity_type: node - uuid: 3164a225-df20-4794-8cfc-b7cd81cfde58 - bundle: page - default_langcode: en - depends: - 3a0fe860-a6d6-428a-9474-365bd57509aa: media -default: - revision_uid: - - - target_id: 1 - status: - - - value: true - uid: - - - target_id: 1 - title: - - - value: 'Info grid' - created: - - - value: 1716194667 - promote: - - - value: false - sticky: - - - value: false - moderation_state: - - - value: published - pate_is_template: - - - value: false - pate_structure_only: - - - value: false - path: - - - alias: /info-grid - langcode: en - pathauto: 0 - content_translation_source: - - - value: und - content_translation_outdated: - - - value: false - body: - - - value: |- - - - - - - -

I am a heading

- - - -

I am the body

- - - - - - - -

I am second heading

- - - -

I am the second body

- - - - - - - -

I am the third heading

- - - -

I am the third body

- - - - - - - - - -

Just one info grid

- - - -

- - - - - - - - - -

- - - -

- - - - - - - -

- - - -

- - - - - - - -

- - - -

- - - - - -

- - - - - - - - - -

test

- - - -

Heading

- - - - - -

I am p tag

- - - - - -

Testing

- - - -

Testing

- - - -

Testing

- - - - - - - -

Heading

- - - -

Heading

- - - - - -

Heading

- - - -

TEst

- - - -

est

- - - -

test

- - - -

test

- - - - - - - format: gutenberg - summary: '' diff --git a/packages/drupal/test_content/content/node/358dcf0d-0910-4d0b-acc8-5a20108b3f20.yml b/packages/drupal/test_content/content/node/358dcf0d-0910-4d0b-acc8-5a20108b3f20.yml new file mode 100644 index 000000000..d653a0e13 --- /dev/null +++ b/packages/drupal/test_content/content/node/358dcf0d-0910-4d0b-acc8-5a20108b3f20.yml @@ -0,0 +1,64 @@ +_meta: + version: '1.0' + entity_type: node + uuid: 358dcf0d-0910-4d0b-acc8-5a20108b3f20 + bundle: page + default_langcode: en +default: + revision_uid: + - + target_id: 1 + status: + - + value: true + uid: + - + target_id: 1 + title: + - + value: 'Block: Horizontal separator' + created: + - + value: 1733841108 + promote: + - + value: false + sticky: + - + value: false + moderation_state: + - + value: published + pate_is_template: + - + value: false + pate_structure_only: + - + value: false + path: + - + alias: /block-horizontal-separator + langcode: en + pathauto: 0 + content_translation_source: + - + value: und + content_translation_outdated: + - + value: false + body: + - + value: |- + + + + + + +

Lorem ipsum dolor sit amet consectetur adipiscing elit mi phasellus, molestie nascetur bibendum condimentum justo non purus inceptos, vestibulum facilisis congue luctus ultricies tempor urna penatibus. Sagittis eleifend maecenas mauris ante ullamcorper montes sed penatibus integer, fames mollis scelerisque vitae gravida cras dictum feugiat augue.

+ + + + + format: gutenberg + summary: '' diff --git a/packages/drupal/test_content/content/node/4189dec1-3b09-4eec-b4d5-b7cc28eaeae3.yml b/packages/drupal/test_content/content/node/4189dec1-3b09-4eec-b4d5-b7cc28eaeae3.yml new file mode 100644 index 000000000..ad661da31 --- /dev/null +++ b/packages/drupal/test_content/content/node/4189dec1-3b09-4eec-b4d5-b7cc28eaeae3.yml @@ -0,0 +1,71 @@ +_meta: + version: '1.0' + entity_type: node + uuid: 4189dec1-3b09-4eec-b4d5-b7cc28eaeae3 + bundle: page + default_langcode: en + depends: + 3a0fe860-a6d6-428a-9474-365bd57509aa: media + 5dfc1856-e9e4-4f02-9cd6-9d888870ce1a: media +default: + revision_uid: + - + target_id: 1 + status: + - + value: true + uid: + - + target_id: 1 + title: + - + value: 'Block: Image with Text' + created: + - + value: 1733841504 + promote: + - + value: false + sticky: + - + value: false + moderation_state: + - + value: published + pate_is_template: + - + value: false + pate_structure_only: + - + value: false + path: + - + alias: /block-image-text + langcode: en + pathauto: 0 + content_translation_source: + - + value: und + content_translation_outdated: + - + value: false + body: + - + value: |- + + + + + +

Image with text on the left

+ + + + + +

Image with text on the right

+ + + + format: gutenberg + summary: '' diff --git a/packages/drupal/test_content/content/node/487b2750-bf2a-4b5d-a753-2942a63bb6a4.yml b/packages/drupal/test_content/content/node/487b2750-bf2a-4b5d-a753-2942a63bb6a4.yml new file mode 100644 index 000000000..2f3b48a16 --- /dev/null +++ b/packages/drupal/test_content/content/node/487b2750-bf2a-4b5d-a753-2942a63bb6a4.yml @@ -0,0 +1,72 @@ +_meta: + version: '1.0' + entity_type: node + uuid: 487b2750-bf2a-4b5d-a753-2942a63bb6a4 + bundle: page + default_langcode: en +default: + revision_uid: + - + target_id: 1 + status: + - + value: true + uid: + - + target_id: 1 + title: + - + value: 'Block: List' + created: + - + value: 1733840670 + promote: + - + value: false + sticky: + - + value: false + moderation_state: + - + value: published + pate_is_template: + - + value: false + pate_structure_only: + - + value: false + path: + - + alias: /block-list + langcode: en + pathauto: 0 + content_translation_source: + - + value: und + content_translation_outdated: + - + value: false + body: + - + value: |- + + + + + + + + + + + + + + + + + + + + format: gutenberg + summary: '' diff --git a/packages/drupal/test_content/content/node/54ee7380-a3c0-4c45-8305-933143dc2ff6.yml b/packages/drupal/test_content/content/node/54ee7380-a3c0-4c45-8305-933143dc2ff6.yml new file mode 100644 index 000000000..f2e4bdb3b --- /dev/null +++ b/packages/drupal/test_content/content/node/54ee7380-a3c0-4c45-8305-933143dc2ff6.yml @@ -0,0 +1,60 @@ +_meta: + version: '1.0' + entity_type: node + uuid: 54ee7380-a3c0-4c45-8305-933143dc2ff6 + bundle: page + default_langcode: en + depends: + 5dfc1856-e9e4-4f02-9cd6-9d888870ce1a: media +default: + revision_uid: + - + target_id: 1 + status: + - + value: true + uid: + - + target_id: 1 + title: + - + value: 'Block: Quote' + created: + - + value: 1733840993 + promote: + - + value: false + sticky: + - + value: false + moderation_state: + - + value: published + pate_is_template: + - + value: false + pate_structure_only: + - + value: false + path: + - + alias: /block-quote + langcode: en + pathauto: 0 + content_translation_source: + - + value: und + content_translation_outdated: + - + value: false + body: + - + value: |- + + + + + + format: gutenberg + summary: '' diff --git a/packages/drupal/test_content/content/node/557b324d-2183-48e7-9054-6dc90e18beb1.yml b/packages/drupal/test_content/content/node/557b324d-2183-48e7-9054-6dc90e18beb1.yml new file mode 100644 index 000000000..47a613f40 --- /dev/null +++ b/packages/drupal/test_content/content/node/557b324d-2183-48e7-9054-6dc90e18beb1.yml @@ -0,0 +1,76 @@ +_meta: + version: '1.0' + entity_type: node + uuid: 557b324d-2183-48e7-9054-6dc90e18beb1 + bundle: page + default_langcode: en +default: + revision_uid: + - + target_id: 1 + status: + - + value: true + uid: + - + target_id: 1 + title: + - + value: 'Block: Info Grid' + created: + - + value: 1733841773 + promote: + - + value: false + sticky: + - + value: false + moderation_state: + - + value: published + pate_is_template: + - + value: false + pate_structure_only: + - + value: false + path: + - + alias: /block-info-grid + langcode: en + pathauto: 0 + content_translation_source: + - + value: und + content_translation_outdated: + - + value: false + body: + - + value: |- + + + + + + +

Some information here

+ + + + + +

Some information here

+ + + + + +

Some information here

+ + + + + format: gutenberg + summary: '' diff --git a/packages/drupal/test_content/content/node/67c21535-4851-4aea-b46e-c4eccd4e494a.yml b/packages/drupal/test_content/content/node/67c21535-4851-4aea-b46e-c4eccd4e494a.yml new file mode 100644 index 000000000..394c720f7 --- /dev/null +++ b/packages/drupal/test_content/content/node/67c21535-4851-4aea-b46e-c4eccd4e494a.yml @@ -0,0 +1,64 @@ +_meta: + version: '1.0' + entity_type: node + uuid: 67c21535-4851-4aea-b46e-c4eccd4e494a + bundle: page + default_langcode: en +default: + revision_uid: + - + target_id: 1 + status: + - + value: true + uid: + - + target_id: 1 + title: + - + value: 'Block: Paragraph' + created: + - + value: 1733840599 + promote: + - + value: false + sticky: + - + value: false + moderation_state: + - + value: published + pate_is_template: + - + value: false + pate_structure_only: + - + value: false + path: + - + alias: /block-paragraph + langcode: en + pathauto: 0 + content_translation_source: + - + value: und + content_translation_outdated: + - + value: false + body: + - + value: |- + + + + +

Lorem ipsum dolor sit amet consectetur, adipiscing elit nisi tincidunt urna, ligula viverra congue est. Netus congue bibendum fringilla risus nisl fermentum massa, eleifend venenatis lacus interdum elementum. Donec euismod venenatis ridiculus non risus porttitor magna mollis faucibus vel tincidunt, molestie lacus felis mi montes mauris placerat et sagittis vitae, sociosqu curabitur cursus iaculis quam dapibus sed mattis velit aptent. Vestibulum feugiat vel vitae venenatis vulputate ad nulla arcu eget in, magna pulvinar sem primis auctor erat justo scelerisque.

+ + + +

Pharetra magna condimentum per est aliquet in blandit metus, magnis iaculis diam ultrices integer bibendum cursus consequat auctor, etiam mollis euismod nisi imperdiet tristique donec. Nec rutrum mus sociosqu dictumst arcu congue ligula, conubia lectus egestas volutpat lacus enim, ultrices praesent nisl venenatis netus quis. Nostra commodo per aliquam neque litora habitasse cubilia mattis phasellus nec, aliquet etiam libero urna consequat vivamus scelerisque eu rhoncus sed, mus lacinia natoque auctor quis massa pellentesque cras sem. Fringilla accumsan laoreet rutrum integer sagittis pellentesque, rhoncus condimentum luctus semper dictumst, aliquet eros imperdiet lectus bibendum. Donec vel placerat accumsan cursus, posuere mi velit facilisis fermentum, lobortis penatibus id.

+ + + format: gutenberg + summary: '' diff --git a/packages/drupal/test_content/content/node/69c06c93-0d3f-47e1-a5ee-ba697bd532c1.yml b/packages/drupal/test_content/content/node/69c06c93-0d3f-47e1-a5ee-ba697bd532c1.yml new file mode 100644 index 000000000..306877037 --- /dev/null +++ b/packages/drupal/test_content/content/node/69c06c93-0d3f-47e1-a5ee-ba697bd532c1.yml @@ -0,0 +1,62 @@ +_meta: + version: '1.0' + entity_type: node + uuid: 69c06c93-0d3f-47e1-a5ee-ba697bd532c1 + bundle: page + default_langcode: en +default: + revision_uid: + - + target_id: 1 + status: + - + value: true + uid: + - + target_id: 1 + title: + - + value: 'Block: Form' + created: + - + value: 1733841355 + promote: + - + value: false + sticky: + - + value: false + moderation_state: + - + value: published + pate_is_template: + - + value: false + pate_structure_only: + - + value: false + path: + - + alias: /block-form + langcode: en + pathauto: 0 + content_translation_source: + - + value: und + content_translation_outdated: + - + value: false + body: + - + value: |- + + + + + + + + + + format: gutenberg + summary: '' diff --git a/packages/drupal/test_content/content/node/71e7b043-3718-4d6a-a2c8-42fb03554800.yml b/packages/drupal/test_content/content/node/71e7b043-3718-4d6a-a2c8-42fb03554800.yml new file mode 100644 index 000000000..5b15215ab --- /dev/null +++ b/packages/drupal/test_content/content/node/71e7b043-3718-4d6a-a2c8-42fb03554800.yml @@ -0,0 +1,72 @@ +_meta: + version: '1.0' + entity_type: node + uuid: 71e7b043-3718-4d6a-a2c8-42fb03554800 + bundle: page + default_langcode: en +default: + revision_uid: + - + target_id: 1 + status: + - + value: true + uid: + - + target_id: 1 + title: + - + value: 'Block: Table' + created: + - + value: 1733840802 + promote: + - + value: false + sticky: + - + value: false + moderation_state: + - + value: published + pate_is_template: + - + value: false + pate_structure_only: + - + value: false + path: + - + alias: /block-table + langcode: en + pathauto: 0 + content_translation_source: + - + value: und + content_translation_outdated: + - + value: false + body: + - + value: |- + + + + +
Col 1Col 2Col 3Col 4
Row 1---
Row 2---
Row 3---
Row 4---
Table Caption
+ + + +
Col 1Col 2Col 3Col 4
Row 1---
Row 2---
Row 3---
Row 4---
Table Caption - Fixed width
+ + + +
Header 1Header 2Header 3Header 4
Col 1Col 2Col 3Col 4
Row 1---
Row 2---
Row 3---
Row 4---
Table Caption - Header Section
+ + + +
Col 1Col 2Col 3Col 4
Row 1---
Row 2---
Row 3---
Row 4---
Footer 1Footer 2Footer 3Footer 4
Table Caption - Footer Section
+ + + format: gutenberg + summary: '' diff --git a/packages/drupal/test_content/content/node/7f0f6893-c61d-4ecd-8b74-fb0a0d023ead.yml b/packages/drupal/test_content/content/node/7f0f6893-c61d-4ecd-8b74-fb0a0d023ead.yml new file mode 100644 index 000000000..5fac9a7f9 --- /dev/null +++ b/packages/drupal/test_content/content/node/7f0f6893-c61d-4ecd-8b74-fb0a0d023ead.yml @@ -0,0 +1,60 @@ +_meta: + version: '1.0' + entity_type: node + uuid: 7f0f6893-c61d-4ecd-8b74-fb0a0d023ead + bundle: page + default_langcode: en + depends: + 5dfc1856-e9e4-4f02-9cd6-9d888870ce1a: media +default: + revision_uid: + - + target_id: 1 + status: + - + value: true + uid: + - + target_id: 1 + title: + - + value: 'Block: Media' + created: + - + value: 1733841189 + promote: + - + value: false + sticky: + - + value: false + moderation_state: + - + value: published + pate_is_template: + - + value: false + pate_structure_only: + - + value: false + path: + - + alias: /block-media + langcode: en + pathauto: 0 + content_translation_source: + - + value: und + content_translation_outdated: + - + value: false + body: + - + value: |- + + + + + + format: gutenberg + summary: '' diff --git a/packages/drupal/test_content/content/node/87b412b9-09e6-4de4-be13-a97b64df74b8.yml b/packages/drupal/test_content/content/node/87b412b9-09e6-4de4-be13-a97b64df74b8.yml new file mode 100644 index 000000000..55f244a51 --- /dev/null +++ b/packages/drupal/test_content/content/node/87b412b9-09e6-4de4-be13-a97b64df74b8.yml @@ -0,0 +1,76 @@ +_meta: + version: '1.0' + entity_type: node + uuid: 87b412b9-09e6-4de4-be13-a97b64df74b8 + bundle: page + default_langcode: en +default: + revision_uid: + - + target_id: 1 + status: + - + value: true + uid: + - + target_id: 1 + title: + - + value: 'Block: Teaser list' + created: + - + value: 1733841857 + promote: + - + value: false + sticky: + - + value: false + moderation_state: + - + value: published + pate_is_template: + - + value: false + pate_structure_only: + - + value: false + path: + - + alias: /block-teaser-list + langcode: en + pathauto: 0 + content_translation_source: + - + value: und + content_translation_outdated: + - + value: false + body: + - + value: |- + + + + + + + + + + + + + + + + + + + + + + + + format: gutenberg + summary: '' diff --git a/packages/drupal/test_content/content/node/a11aaeea-a71a-4ef0-a996-833c95767386.yml b/packages/drupal/test_content/content/node/a11aaeea-a71a-4ef0-a996-833c95767386.yml new file mode 100644 index 000000000..d3e131ed7 --- /dev/null +++ b/packages/drupal/test_content/content/node/a11aaeea-a71a-4ef0-a996-833c95767386.yml @@ -0,0 +1,76 @@ +_meta: + version: '1.0' + entity_type: node + uuid: a11aaeea-a71a-4ef0-a996-833c95767386 + bundle: page + default_langcode: en +default: + revision_uid: + - + target_id: 1 + status: + - + value: true + uid: + - + target_id: 1 + title: + - + value: 'Block: Accordion' + created: + - + value: 1733841680 + promote: + - + value: false + sticky: + - + value: false + moderation_state: + - + value: published + pate_is_template: + - + value: false + pate_structure_only: + - + value: false + path: + - + alias: /block-accordion + langcode: en + pathauto: 0 + content_translation_source: + - + value: und + content_translation_outdated: + - + value: false + body: + - + value: |- + + + + + + +

Lorem ipsum dolor sit amet consectetur adipiscing elit auctor, lectus nibh gravida platea euismod parturient vitae interdum senectus, laoreet litora mauris tempor risus curae inceptos. Morbi ut facilisi ullamcorper arcu dictum hac congue eros nunc, nisl nullam dictumst malesuada euismod primis fusce convallis tempor, sociosqu est dis cursus maecenas id felis dui. Vestibulum turpis scelerisque montes felis laoreet metus ligula tincidunt auctor tempus fusce fermentum, conubia habitant sapien hac sed semper cum cubilia nunc augue. Laoreet velit parturient fermentum penatibus sociosqu mollis auctor nascetur pellentesque et libero, ac nisl commodo posuere sagittis enim egestas placerat molestie curabitur. Dictumst laoreet commodo magnis feugiat sagittis platea felis est convallis, integer curae blandit sociis suspendisse maecenas potenti risus ridiculus, a tempor tellus pellentesque fermentum fames tincidunt scelerisque.

+ + + + + +

Lorem ipsum dolor sit amet consectetur adipiscing elit dis rutrum vestibulum congue est malesuada egestas vitae, at ante varius nec vulputate cubilia mauris cras auctor suscipit faucibus nisl dictumst. Pulvinar sociosqu parturient habitant himenaeos in volutpat nascetur magnis, iaculis varius at mi sollicitudin morbi ligula nec, diam per scelerisque risus elementum tempor vel. Velit montes quisque metus penatibus porttitor iaculis justo posuere, porta suspendisse sem nullam ante facilisis proin, neque sollicitudin dis himenaeos ligula morbi euismod. Volutpat tempus ultrices feugiat dictum senectus porta condimentum sodales, eros sociosqu libero risus suspendisse proin tortor, egestas ridiculus nostra platea commodo id torquent. Dis ultrices mollis hac tempor magna diam suscipit natoque odio et, tortor tellus enim litora eu felis ad volutpat cursus pharetra, nostra mus auctor inceptos metus mattis porta scelerisque magnis. Natoque iaculis nascetur pellentesque est arcu pharetra phasellus interdum, venenatis tempor proin dictum metus dapibus dis, tortor malesuada duis ad eu ullamcorper elementum. Metus odio dignissim dictum fames nec ut, faucibus porta placerat ullamcorper cum donec felis, tempor imperdiet scelerisque commodo himenaeos.

+ + + + + +

Lorem ipsum dolor sit amet consectetur adipiscing elit sodales, dictum massa scelerisque parturient sagittis rutrum taciti porttitor, in eleifend habitant habitasse enim placerat phasellus. Mus tempus euismod id donec facilisi imperdiet mollis, montes convallis cubilia per tristique faucibus, pellentesque quam interdum sagittis tellus ac. Sociis sapien imperdiet himenaeos mus ornare conubia hac molestie proin, etiam diam arcu eleifend euismod odio vivamus. Turpis nisl ad hac duis fusce phasellus nibh dictum integer purus arcu, donec sociosqu eu at tortor sapien scelerisque tempus gravida mattis, torquent praesent feugiat volutpat felis viverra pellentesque eget suscipit quisque.

+ + + + + format: gutenberg + summary: '' diff --git a/packages/drupal/test_content/content/node/a23e5334-20fc-4c34-acba-bf3c8cb5fa40.yml b/packages/drupal/test_content/content/node/a23e5334-20fc-4c34-acba-bf3c8cb5fa40.yml new file mode 100644 index 000000000..2707f2bf9 --- /dev/null +++ b/packages/drupal/test_content/content/node/a23e5334-20fc-4c34-acba-bf3c8cb5fa40.yml @@ -0,0 +1,65 @@ +_meta: + version: '1.0' + entity_type: node + uuid: a23e5334-20fc-4c34-acba-bf3c8cb5fa40 + bundle: page + default_langcode: en + depends: + 3a0fe860-a6d6-428a-9474-365bd57509aa: media + 5dfc1856-e9e4-4f02-9cd6-9d888870ce1a: media +default: + revision_uid: + - + target_id: 1 + status: + - + value: true + uid: + - + target_id: 1 + title: + - + value: 'Block: Image Teasers' + created: + - + value: 1733841404 + promote: + - + value: false + sticky: + - + value: false + moderation_state: + - + value: published + pate_is_template: + - + value: false + pate_structure_only: + - + value: false + path: + - + alias: /block-image-teasers + langcode: en + pathauto: 0 + content_translation_source: + - + value: und + content_translation_outdated: + - + value: false + body: + - + value: |- + + + + + + + + + + format: gutenberg + summary: '' diff --git a/packages/drupal/test_content/content/node/bdbcc2b9-2d33-4723-a6fc-35c5f56b1ab9.yml b/packages/drupal/test_content/content/node/bdbcc2b9-2d33-4723-a6fc-35c5f56b1ab9.yml new file mode 100644 index 000000000..18fff7695 --- /dev/null +++ b/packages/drupal/test_content/content/node/bdbcc2b9-2d33-4723-a6fc-35c5f56b1ab9.yml @@ -0,0 +1,80 @@ +_meta: + version: '1.0' + entity_type: node + uuid: bdbcc2b9-2d33-4723-a6fc-35c5f56b1ab9 + bundle: page + default_langcode: en +default: + revision_uid: + - + target_id: 1 + status: + - + value: true + uid: + - + target_id: 1 + title: + - + value: 'Block: Heading' + created: + - + value: 1733841242 + promote: + - + value: false + sticky: + - + value: false + moderation_state: + - + value: published + pate_is_template: + - + value: false + pate_structure_only: + - + value: false + path: + - + alias: /block-heading + langcode: en + pathauto: 0 + content_translation_source: + - + value: und + content_translation_outdated: + - + value: false + body: + - + value: |- + + + + +

Heading two

+ + + +

Heading three

+ + + +

Heading four

+ + + +

Heading two - Bold

+ + + +

Heading three - Bold

+ + + +

Heading four - Bold

+ + + format: gutenberg + summary: '' diff --git a/packages/drupal/test_content/content/node/52ee5cc7-0ac5-49b5-8550-ce59476bd4ac.yml b/packages/drupal/test_content/content/node/f14c6cb1-b052-4523-ad52-1fbfd32282ff.yml similarity index 62% rename from packages/drupal/test_content/content/node/52ee5cc7-0ac5-49b5-8550-ce59476bd4ac.yml rename to packages/drupal/test_content/content/node/f14c6cb1-b052-4523-ad52-1fbfd32282ff.yml index c195e8488..536cc53bf 100644 --- a/packages/drupal/test_content/content/node/52ee5cc7-0ac5-49b5-8550-ce59476bd4ac.yml +++ b/packages/drupal/test_content/content/node/f14c6cb1-b052-4523-ad52-1fbfd32282ff.yml @@ -1,7 +1,7 @@ _meta: version: '1.0' entity_type: node - uuid: 52ee5cc7-0ac5-49b5-8550-ce59476bd4ac + uuid: f14c6cb1-b052-4523-ad52-1fbfd32282ff bundle: page default_langcode: en default: @@ -16,10 +16,10 @@ default: target_id: 1 title: - - value: 'Conditional blocks' + value: 'Block: Conditional content' created: - - value: 1715684657 + value: 1733841586 promote: - value: false @@ -37,7 +37,7 @@ default: value: false path: - - alias: /conditional-blocks + alias: /block-conditional-content langcode: en pathauto: 0 content_translation_source: @@ -49,18 +49,12 @@ default: body: - value: |- - + - + -

Complete

- - - - - -

No conditions

+

This content will only be shown for one year.

From 4b5966c765ccf7b8583a1b818745390a6f4415f8 Mon Sep 17 00:00:00 2001 From: Eli Stone <2546188+elistone@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:01:40 +0000 Subject: [PATCH 06/42] chore(SLB-508): updating the schema tests --- tests/schema/specs/blocks.spec.ts | 1131 +++++++++++++++++------------ 1 file changed, 664 insertions(+), 467 deletions(-) diff --git a/tests/schema/specs/blocks.spec.ts b/tests/schema/specs/blocks.spec.ts index 3959b9f55..9ef12910a 100644 --- a/tests/schema/specs/blocks.spec.ts +++ b/tests/schema/specs/blocks.spec.ts @@ -3,302 +3,199 @@ import { expect, test } from 'vitest'; import { fetch } from '../lib.js'; -test('Blocks', async () => { +test('Block: Teaser list', async () => { const result = await fetch(gql` - fragment Blocks on Page { - hero { - __typename - headline - lead - image { + { + _loadDrupalPage(id: "87b412b9-09e6-4de4-be13-a97b64df74b8") { + content { __typename - } - ctaText - ctaUrl - formUrl - } - content { - __typename - ... on BlockMarkup { - markup - } - ... on BlockMedia { - caption - media { - __typename - ... on MediaImage { - __typename - } - ... on MediaVideo { - __typename - } - } - } - ... on BlockForm { - url - } - ... on BlockImageTeasers { - teasers { - __typename - image { + ... on BlockTeaserList { + layout + buttonText + staticContent { __typename + ... on BlockTeaserItem { + __typename + content { + __typename + ... on CardItem { + id + path + title + hero { + lead + headline + } + teaserImage { + alt + source(width: 400, height: 300) + } + } + } + } } - title - ctaText - ctaUrl - } - } - ... on BlockCta { - url - text - openInNewTab - icon - iconPosition - } - ... on BlockImageWithText { - image { - __typename - } - imagePosition - textContent { - __typename - markup - } - } - ... on BlockQuote { - quote - author - role - image { - __typename - } - } - ... on BlockHorizontalSeparator { - __typename - } - ... on BlockAccordion { - items { - __typename - ... on BlockAccordionItemText { - __typename + contentHubEnabled + filters { title - icon - textContent { - markup - } + limit } } } } } - { - complete: _loadDrupalPage(id: "a397ca48-8fad-411e-8901-0eba2feb989c") { - ...Blocks - } - } `); - - const firstParagraph = result.data.complete.content[0]; - firstParagraph.markup = firstParagraph.markup.replace( - /data-id="\d+"/, - 'data-id="[numeric]"', - ); - - for (const block of result.data.complete.content) { - if (block.__typename === 'BlockCta') { - block.url = block.url.replace(/media\/\d+/, 'media/[numeric]'); - } - } - expect(result).toMatchInlineSnapshot(` { "data": { - "complete": { + "_loadDrupalPage": { "content": [ { - "__typename": "BlockMarkup", - "markup": " -

A standalone paragraph with markup and link

- ", - }, - { - "__typename": "BlockHorizontalSeparator", - }, - { - "__typename": "BlockMedia", - "caption": "Media image", - "media": { - "__typename": "MediaImage", - }, - }, - { - "__typename": "BlockMedia", - "caption": "Media video", - "media": { - "__typename": "MediaVideo", - }, - }, - { - "__typename": "BlockForm", - "url": "http://127.0.0.1:8000/en/form/contact", - }, - { - "__typename": "BlockImageWithText", - "image": { - "__typename": "MediaImage", - }, - "imagePosition": "right", - "textContent": { - "__typename": "BlockMarkup", - "markup": " -

All kinds of allowed blocks

- - - -

Heading

- -

Quote

Citation
- -

- ", + "__typename": "BlockTeaserList", + "buttonText": null, + "contentHubEnabled": null, + "filters": { + "limit": null, + "title": null, }, - }, - { - "__typename": "BlockMarkup", - "markup": " -

Starting from this paragraph, all the following blocks should be aggregated, as they are just HTML

- -
12
34 with markup
Table caption
- - - -

Heading 3

- -

Quote

Citation
- ", - }, - { - "__typename": "BlockImageTeasers", - "teasers": [ + "layout": null, + "staticContent": [ { - "__typename": "BlockImageTeaser", - "ctaText": "Foo", - "ctaUrl": "https://google.com", - "image": { - "__typename": "MediaImage", + "__typename": "BlockTeaserItem", + "content": { + "__typename": "DrupalPage", + "hero": { + "headline": "Block: Accordion", + "lead": "Block: Accordion", + }, + "id": "a11aaeea-a71a-4ef0-a996-833c95767386", + "path": "/en/block-accordion", + "teaserImage": null, + "title": "Block: Accordion", }, - "title": "Teaser 1", }, { - "__typename": "BlockImageTeaser", - "ctaText": "Bar", - "ctaUrl": "https://google.com", - "image": { - "__typename": "MediaImage", + "__typename": "BlockTeaserItem", + "content": { + "__typename": "DrupalPage", + "hero": { + "headline": "Block: CTA", + "lead": "Block: CTA", + }, + "id": "080b30e2-5a68-4390-9dec-0c7e850840a7", + "path": "/en/block-cta", + "teaserImage": null, + "title": "Block: CTA", + }, + }, + { + "__typename": "BlockTeaserItem", + "content": { + "__typename": "DrupalPage", + "hero": { + "headline": "Block: Conditional content", + "lead": "Block: Conditional content", + }, + "id": "f14c6cb1-b052-4523-ad52-1fbfd32282ff", + "path": "/en/block-conditional-content", + "teaserImage": null, + "title": "Block: Conditional content", + }, + }, + { + "__typename": "BlockTeaserItem", + "content": { + "__typename": "DrupalPage", + "hero": { + "headline": "Block: Form", + "lead": "Block: Form", + }, + "id": "69c06c93-0d3f-47e1-a5ee-ba697bd532c1", + "path": "/en/block-form", + "teaserImage": null, + "title": "Block: Form", }, - "title": "Teaser 2", }, ], }, { - "__typename": "BlockCta", - "icon": null, - "iconPosition": null, - "openInNewTab": null, - "text": "Internal CTA", - "url": "/en/drupal", - }, - { - "__typename": "BlockCta", - "icon": "ARROW", - "iconPosition": null, - "openInNewTab": true, - "text": "External CTA", - "url": "https://www.google.com", - }, - { - "__typename": "BlockCta", - "icon": "ARROW", - "iconPosition": "BEFORE", - "openInNewTab": null, - "text": "CTA with link to media", - "url": "/media/[numeric]", - }, - { - "__typename": "BlockQuote", - "author": "John Doe", - "image": { - "__typename": "MediaImage", + "__typename": "BlockTeaserList", + "buttonText": null, + "contentHubEnabled": null, + "filters": { + "limit": null, + "title": null, }, - "quote": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus sagittis nisi nec neque porta, a ornare ligula efficitur.", - "role": "Project manager", - }, - { - "__typename": "BlockAccordion", - "items": [ + "layout": "CAROUSEL", + "staticContent": [ { - "__typename": "BlockAccordionItemText", - "icon": "", - "textContent": { - "markup": " -

Incididunt laborum velit non proident nostrud velit. Minim excepteur ut aliqua nisi. Culpa laboris consectetur proident. Tempor esse ullamco et dolor proident id officia laborum voluptate nostrud elit dolore qui amet. Ex Lorem irure eu anim ipsum officia.

- ", + "__typename": "BlockTeaserItem", + "content": { + "__typename": "DrupalPage", + "hero": { + "headline": "Block: Accordion", + "lead": "Block: Accordion", + }, + "id": "a11aaeea-a71a-4ef0-a996-833c95767386", + "path": "/en/block-accordion", + "teaserImage": null, + "title": "Block: Accordion", }, - "title": "With a single paragraph and no icon", }, { - "__typename": "BlockAccordionItemText", - "icon": "arrow", - "textContent": { - "markup": " - - -

Incididunt laborum velit non proident nostrud velit. Minim excepteur ut aliqua nisi. Culpa laboris consectetur proident. Tempor esse ullamco et dolor proident id officia laborum voluptate nostrud elit dolore qui amet. Ex Lorem irure eu anim ipsum officia.

- ", + "__typename": "BlockTeaserItem", + "content": { + "__typename": "DrupalPage", + "hero": { + "headline": "Block: CTA", + "lead": "Block: CTA", + }, + "id": "080b30e2-5a68-4390-9dec-0c7e850840a7", + "path": "/en/block-cta", + "teaserImage": null, + "title": "Block: CTA", + }, + }, + { + "__typename": "BlockTeaserItem", + "content": { + "__typename": "DrupalPage", + "hero": { + "headline": "Block: Conditional content", + "lead": "Block: Conditional content", + }, + "id": "f14c6cb1-b052-4523-ad52-1fbfd32282ff", + "path": "/en/block-conditional-content", + "teaserImage": null, + "title": "Block: Conditional content", + }, + }, + { + "__typename": "BlockTeaserItem", + "content": { + "__typename": "DrupalPage", + "hero": { + "headline": "Block: Form", + "lead": "Block: Form", + }, + "id": "69c06c93-0d3f-47e1-a5ee-ba697bd532c1", + "path": "/en/block-form", + "teaserImage": null, + "title": "Block: Form", }, - "title": "With a list and a paragraph and arrow icon", }, ], }, ], - "hero": { - "__typename": "Hero", - "ctaText": "CTA text", - "ctaUrl": "https://example.com", - "formUrl": "http://127.0.0.1:8000/en/form/contact", - "headline": "All kinds of blocks with maximum data", - "image": { - "__typename": "MediaImage", - }, - "lead": "Lead text", - }, }, }, } `); - - const german = await fetch(gql` - { - page: _loadDrupalPage(id: "a397ca48-8fad-411e-8901-0eba2feb989c:de") { - content { - __typename - ... on BlockForm { - url - } - } - } - } - `); - const germanForm = german.data.page.content.find( - (it: { __typename: string }) => it.__typename === 'BlockForm', - ); - expect(germanForm.url).toBe('http://127.0.0.1:8000/de/form/contact'); }); -test('Block - info grid', async () => { +test('Block: Info Grid', async () => { const result = await fetch(gql` { - _loadDrupalPage(id: "3164a225-df20-4794-8cfc-b7cd81cfde58") { + _loadDrupalPage(id: "557b324d-2183-48e7-9054-6dc90e18beb1") { content { __typename ... on BlockInfoGrid { @@ -322,6 +219,7 @@ test('Block - info grid', async () => { } } `); + expect(result).toMatchInlineSnapshot(` { "data": { @@ -335,18 +233,9 @@ test('Block - info grid', async () => { "infoGridContent": [ { "markup": " -

I am a heading

- -

I am the body

+

Some information here

", }, - { - "icon": null, - "iconPosition": null, - "openInNewTab": null, - "text": "Link text", - "url": null, - }, ], }, { @@ -354,18 +243,9 @@ test('Block - info grid', async () => { "infoGridContent": [ { "markup": " -

I am second heading

- -

I am the second body

+

Some information here

", }, - { - "icon": null, - "iconPosition": null, - "openInNewTab": null, - "text": "Second link text", - "url": null, - }, ], }, { @@ -373,208 +253,317 @@ test('Block - info grid', async () => { "infoGridContent": [ { "markup": " -

I am the third heading

- -

I am the third body

+

Some information here

", }, - { - "icon": null, - "iconPosition": null, - "openInNewTab": null, - "text": "third link text", - "url": null, - }, ], }, ], }, - { - "__typename": "BlockInfoGrid", - "gridItems": [ - { - "icon": "NONE", - "infoGridContent": [ - { - "markup": " -

Just one info grid

+ ], + }, + }, + } + `); +}); -

- ", - }, - { - "icon": null, - "iconPosition": null, - "openInNewTab": null, - "text": null, - "url": null, - }, - ], - }, - ], - }, +test('Block: Accordion', async () => { + const result = await fetch(gql` + { + _loadDrupalPage(id: "a11aaeea-a71a-4ef0-a996-833c95767386") { + content { + __typename + ... on BlockAccordion { + items { + __typename + ... on BlockAccordionItemText { + __typename + title + icon + textContent { + markup + } + } + } + } + } + } + } + `); + expect(result).toMatchInlineSnapshot(` + { + "data": { + "_loadDrupalPage": { + "content": [ { - "__typename": "BlockInfoGrid", - "gridItems": [ + "__typename": "BlockAccordion", + "items": [ { - "icon": "NONE", - "infoGridContent": [ - { - "markup": " -

- -

+ "__typename": "BlockAccordionItemText", + "icon": "", + "textContent": { + "markup": " +

Lorem ipsum dolor sit amet consectetur adipiscing elit auctor, lectus nibh gravida platea euismod parturient vitae interdum senectus, laoreet litora mauris tempor risus curae inceptos. Morbi ut facilisi ullamcorper arcu dictum hac congue eros nunc, nisl nullam dictumst malesuada euismod primis fusce convallis tempor, sociosqu est dis cursus maecenas id felis dui. Vestibulum turpis scelerisque montes felis laoreet metus ligula tincidunt auctor tempus fusce fermentum, conubia habitant sapien hac sed semper cum cubilia nunc augue. Laoreet velit parturient fermentum penatibus sociosqu mollis auctor nascetur pellentesque et libero, ac nisl commodo posuere sagittis enim egestas placerat molestie curabitur. Dictumst laoreet commodo magnis feugiat sagittis platea felis est convallis, integer curae blandit sociis suspendisse maecenas potenti risus ridiculus, a tempor tellus pellentesque fermentum fames tincidunt scelerisque.

", - }, - { - "icon": null, - "iconPosition": null, - "openInNewTab": null, - "text": null, - "url": null, - }, - ], + }, + "title": "Accordion Title One", }, { - "icon": "NONE", - "infoGridContent": [ - { - "markup": " -

- -

+ "__typename": "BlockAccordionItemText", + "icon": "", + "textContent": { + "markup": " +

Lorem ipsum dolor sit amet consectetur adipiscing elit dis rutrum vestibulum congue est malesuada egestas vitae, at ante varius nec vulputate cubilia mauris cras auctor suscipit faucibus nisl dictumst. Pulvinar sociosqu parturient habitant himenaeos in volutpat nascetur magnis, iaculis varius at mi sollicitudin morbi ligula nec, diam per scelerisque risus elementum tempor vel. Velit montes quisque metus penatibus porttitor iaculis justo posuere, porta suspendisse sem nullam ante facilisis proin, neque sollicitudin dis himenaeos ligula morbi euismod. Volutpat tempus ultrices feugiat dictum senectus porta condimentum sodales, eros sociosqu libero risus suspendisse proin tortor, egestas ridiculus nostra platea commodo id torquent. Dis ultrices mollis hac tempor magna diam suscipit natoque odio et, tortor tellus enim litora eu felis ad volutpat cursus pharetra, nostra mus auctor inceptos metus mattis porta scelerisque magnis. Natoque iaculis nascetur pellentesque est arcu pharetra phasellus interdum, venenatis tempor proin dictum metus dapibus dis, tortor malesuada duis ad eu ullamcorper elementum. Metus odio dignissim dictum fames nec ut, faucibus porta placerat ullamcorper cum donec felis, tempor imperdiet scelerisque commodo himenaeos.

", - }, - { - "icon": null, - "iconPosition": null, - "openInNewTab": null, - "text": null, - "url": null, - }, - ], + }, + "title": "Accordion Title Two", }, { - "icon": "NONE", - "infoGridContent": [ - { - "markup": " -

- -

+ "__typename": "BlockAccordionItemText", + "icon": "", + "textContent": { + "markup": " +

Lorem ipsum dolor sit amet consectetur adipiscing elit sodales, dictum massa scelerisque parturient sagittis rutrum taciti porttitor, in eleifend habitant habitasse enim placerat phasellus. Mus tempus euismod id donec facilisi imperdiet mollis, montes convallis cubilia per tristique faucibus, pellentesque quam interdum sagittis tellus ac. Sociis sapien imperdiet himenaeos mus ornare conubia hac molestie proin, etiam diam arcu eleifend euismod odio vivamus. Turpis nisl ad hac duis fusce phasellus nibh dictum integer purus arcu, donec sociosqu eu at tortor sapien scelerisque tempus gravida mattis, torquent praesent feugiat volutpat felis viverra pellentesque eget suscipit quisque.

", - }, - { - "icon": null, - "iconPosition": null, - "openInNewTab": null, - "text": null, - "url": null, - }, - { - "markup": " -

- ", - }, - ], + }, + "title": "Accordion Title Three", }, ], }, + ], + }, + }, + } + `); +}); + +test('Block: Conditional content', async () => { + const result = await fetch(gql` + { + _loadDrupalPage(id: "f14c6cb1-b052-4523-ad52-1fbfd32282ff") { + content { + __typename + ... on BlockConditional { + content { + ... on BlockMarkup { + markup + } + } + displayFrom + displayTo + } + } + } + } + `); + expect(result).toMatchInlineSnapshot(` + { + "data": { + "_loadDrupalPage": { + "content": [ { - "__typename": "BlockInfoGrid", - "gridItems": [ + "__typename": "BlockConditional", + "content": [ { - "icon": "NONE", - "infoGridContent": [ - { - "icon": null, - "iconPosition": null, - "openInNewTab": true, - "text": "CTA", - "url": "https://www.google.com", - }, - { - "markup": " -

test

- -

Heading

+ "markup": " +

This content will only be shown for one year.

", - }, - ], }, - { - "icon": "NONE", - "infoGridContent": [ - { - "markup": " -

I am p tag

- ", - }, - { - "icon": null, - "iconPosition": null, - "openInNewTab": null, - "text": "CTA", - "url": "https://www.google.com", - }, - { - "markup": " -

Testing

- -

Testing

+ ], + "displayFrom": "2024-12-10T14:40:00.000Z", + "displayTo": "2025-12-10T14:40:00.000Z", + }, + ], + }, + }, + } + `); +}); -

Testing

+test('Block: Image with Text', async () => { + const result = await fetch(gql` + { + _loadDrupalPage(id: "4189dec1-3b09-4eec-b4d5-b7cc28eaeae3") { + content { + __typename + ... on BlockImageWithText { + image { + __typename + } + imagePosition + textContent { + __typename + markup + } + } + } + } + } + `); + expect(result).toMatchInlineSnapshot(` + { + "data": { + "_loadDrupalPage": { + "content": [ + { + "__typename": "BlockImageWithText", + "image": { + "__typename": "MediaImage", + }, + "imagePosition": "left", + "textContent": { + "__typename": "BlockMarkup", + "markup": " +

Image with text on the left

", - }, - { - "icon": null, - "iconPosition": null, - "openInNewTab": null, - "text": "CTA", - "url": null, - }, - ], + }, + }, + { + "__typename": "BlockImageWithText", + "image": { + "__typename": "MediaImage", + }, + "imagePosition": "right", + "textContent": { + "__typename": "BlockMarkup", + "markup": " +

Image with text on the right

+ ", + }, + }, + ], + }, + }, + } + `); +}); + +test('Block: Image Teasers', async () => { + const result = await fetch(gql` + { + _loadDrupalPage(id: "a23e5334-20fc-4c34-acba-bf3c8cb5fa40") { + content { + __typename + ... on BlockImageTeasers { + teasers { + __typename + image { + __typename + } + title + ctaText + ctaUrl + } + } + } + } + } + `); + expect(result).toMatchInlineSnapshot(` + { + "data": { + "_loadDrupalPage": { + "content": [ + { + "__typename": "BlockImageTeasers", + "teasers": [ + { + "__typename": "BlockImageTeaser", + "ctaText": "Image Teaser CTA", + "ctaUrl": null, + "image": { + "__typename": "MediaImage", + }, + "title": "Image Teaser Title", }, { - "icon": "NONE", - "infoGridContent": [ - { - "markup": " -

Heading

+ "__typename": "BlockImageTeaser", + "ctaText": "Image Teaser CTA", + "ctaUrl": null, + "image": { + "__typename": "MediaImage", + }, + "title": "Image Teaser Title", + }, + ], + }, + ], + }, + }, + } + `); +}); -

Heading

- ", - }, - { - "icon": null, - "iconPosition": null, - "openInNewTab": null, - "text": "CTA", - "url": null, - }, - { - "markup": " -

Heading

+test('Block: Form', async () => { + const result = await fetch(gql` + { + _loadDrupalPage(id: "69c06c93-0d3f-47e1-a5ee-ba697bd532c1") { + content { + __typename + ... on BlockForm { + url + } + } + } + } + `); + expect(result).toMatchInlineSnapshot(` + { + "data": { + "_loadDrupalPage": { + "content": [ + { + "__typename": "BlockForm", + "url": "http://127.0.0.1:8000/en/form/contact", + }, + { + "__typename": "BlockForm", + "url": "http://127.0.0.1:8000/en/form/inquiry", + }, + { + "__typename": "BlockForm", + "url": "http://127.0.0.1:8000/en/form/styling", + }, + ], + }, + }, + } + `); +}); + +test('Block: Heading', async () => { + const result = await fetch(gql` + { + _loadDrupalPage(id: "bdbcc2b9-2d33-4723-a6fc-35c5f56b1ab9") { + content { + __typename + ... on BlockMarkup { + markup + } + } + } + } + `); + expect(result).toMatchInlineSnapshot(` + { + "data": { + "_loadDrupalPage": { + "content": [ + { + "__typename": "BlockMarkup", + "markup": " +

Heading two

+ +

Heading three

-

TEst

+

Heading four

-

est

+

Heading two - Bold

-

test

+

Heading three - Bold

-

test

+

Heading four - Bold

", - }, - { - "icon": null, - "iconPosition": null, - "openInNewTab": null, - "text": null, - "url": null, - }, - ], - }, - ], }, ], }, @@ -583,20 +572,23 @@ test('Block - info grid', async () => { `); }); -test('Conditional', async () => { +test('Block: Media', async () => { const result = await fetch(gql` { - _loadDrupalPage(id: "52ee5cc7-0ac5-49b5-8550-ce59476bd4ac") { + _loadDrupalPage(id: "7f0f6893-c61d-4ecd-8b74-fb0a0d023ead") { content { __typename - ... on BlockConditional { - content { - ... on BlockMarkup { - markup + ... on BlockMedia { + caption + media { + __typename + ... on MediaImage { + __typename + } + ... on MediaVideo { + __typename } } - displayFrom - displayTo } } } @@ -608,28 +600,233 @@ test('Conditional', async () => { "_loadDrupalPage": { "content": [ { - "__typename": "BlockConditional", - "content": [ - { - "markup": " -

Complete

+ "__typename": "BlockMedia", + "caption": "Media Image Caption", + "media": { + "__typename": "MediaImage", + }, + }, + ], + }, + }, + } + `); +}); + +test('Block: Horizontal separator', async () => { + const result = await fetch(gql` + { + _loadDrupalPage(id: "358dcf0d-0910-4d0b-acc8-5a20108b3f20") { + content { + __typename + ... on BlockHorizontalSeparator { + __typename + } + } + } + } + `); + expect(result).toMatchInlineSnapshot(` + { + "data": { + "_loadDrupalPage": { + "content": [ + { + "__typename": "BlockHorizontalSeparator", + }, + { + "__typename": "BlockMarkup", + }, + { + "__typename": "BlockHorizontalSeparator", + }, + ], + }, + }, + } + `); +}); + +test('Block: Quote', async () => { + const result = await fetch(gql` + { + _loadDrupalPage(id: "54ee7380-a3c0-4c45-8305-933143dc2ff6") { + content { + __typename + ... on BlockQuote { + quote + author + role + image { + __typename + } + } + } + } + } + `); + expect(result).toMatchInlineSnapshot(` + { + "data": { + "_loadDrupalPage": { + "content": [ + { + "__typename": "BlockQuote", + "author": "Rose (Betty White)", + "image": { + "__typename": "MediaImage", + }, + "quote": "My mother always used to say: The older you get, the better you get, unless you’re a banana.", + "role": "The Golden Girls", + }, + ], + }, + }, + } + `); +}); + +test('Block: Table', async () => { + const result = await fetch(gql` + { + _loadDrupalPage(id: "71e7b043-3718-4d6a-a2c8-42fb03554800") { + content { + __typename + ... on BlockMarkup { + markup + } + } + } + } + `); + expect(result).toMatchInlineSnapshot(` + { + "data": { + "_loadDrupalPage": { + "content": [ + { + "__typename": "BlockMarkup", + "markup": " +
Col 1Col 2Col 3Col 4
Row 1---
Row 2---
Row 3---
Row 4---
Table Caption
+ +
Col 1Col 2Col 3Col 4
Row 1---
Row 2---
Row 3---
Row 4---
Table Caption - Fixed width
+ +
Header 1Header 2Header 3Header 4
Col 1Col 2Col 3Col 4
Row 1---
Row 2---
Row 3---
Row 4---
Table Caption - Header Section
+ +
Col 1Col 2Col 3Col 4
Row 1---
Row 2---
Row 3---
Row 4---
Footer 1Footer 2Footer 3Footer 4
Table Caption - Footer Section
", - }, - ], - "displayFrom": "2024-05-16T11:05:00.000Z", - "displayTo": "2024-05-23T13:03:00.000Z", }, + ], + }, + }, + } + `); +}); +test('Block: List', async () => { + const result = await fetch(gql` + { + _loadDrupalPage(id: "487b2750-bf2a-4b5d-a753-2942a63bb6a4") { + content { + __typename + ... on BlockMarkup { + markup + } + } + } + } + `); + expect(result).toMatchInlineSnapshot(` + { + "data": { + "_loadDrupalPage": { + "content": [ { - "__typename": "BlockConditional", - "content": [ - { - "markup": " -

No conditions

+ "__typename": "BlockMarkup", + "markup": " + + + + + + + ", - }, - ], - "displayFrom": null, - "displayTo": null, + }, + ], + }, + }, + } + `); +}); +test('Block: Paragraph', async () => { + const result = await fetch(gql` + { + _loadDrupalPage(id: "67c21535-4851-4aea-b46e-c4eccd4e494a") { + content { + __typename + ... on BlockMarkup { + markup + } + } + } + } + `); + expect(result).toMatchInlineSnapshot(` + { + "data": { + "_loadDrupalPage": { + "content": [ + { + "__typename": "BlockMarkup", + "markup": " +

Lorem ipsum dolor sit amet consectetur, adipiscing elit nisi tincidunt urna, ligula viverra congue est. Netus congue bibendum fringilla risus nisl fermentum massa, eleifend venenatis lacus interdum elementum. Donec euismod venenatis ridiculus non risus porttitor magna mollis faucibus vel tincidunt, molestie lacus felis mi montes mauris placerat et sagittis vitae, sociosqu curabitur cursus iaculis quam dapibus sed mattis velit aptent. Vestibulum feugiat vel vitae venenatis vulputate ad nulla arcu eget in, magna pulvinar sem primis auctor erat justo scelerisque.

+ +

Pharetra magna condimentum per est aliquet in blandit metus, magnis iaculis diam ultrices integer bibendum cursus consequat auctor, etiam mollis euismod nisi imperdiet tristique donec. Nec rutrum mus sociosqu dictumst arcu congue ligula, conubia lectus egestas volutpat lacus enim, ultrices praesent nisl venenatis netus quis. Nostra commodo per aliquam neque litora habitasse cubilia mattis phasellus nec, aliquet etiam libero urna consequat vivamus scelerisque eu rhoncus sed, mus lacinia natoque auctor quis massa pellentesque cras sem. Fringilla accumsan laoreet rutrum integer sagittis pellentesque, rhoncus condimentum luctus semper dictumst, aliquet eros imperdiet lectus bibendum. Donec vel placerat accumsan cursus, posuere mi velit facilisis fermentum, lobortis penatibus id.

+ ", + }, + ], + }, + }, + } + `); +}); +test('Block: CTA', async () => { + const result = await fetch(gql` + { + _loadDrupalPage(id: "080b30e2-5a68-4390-9dec-0c7e850840a7") { + content { + __typename + ... on BlockCta { + url + text + openInNewTab + icon + iconPosition + } + } + } + } + `); + expect(result).toMatchInlineSnapshot(` + { + "data": { + "_loadDrupalPage": { + "content": [ + { + "__typename": "BlockCta", + "icon": null, + "iconPosition": null, + "openInNewTab": null, + "text": "Block CTA", + "url": null, + }, + { + "__typename": "BlockCta", + "icon": "ARROW", + "iconPosition": null, + "openInNewTab": null, + "text": "CTA with Icon", + "url": null, }, ], }, From d4a6defb08cf743953a6a87c510287132902208e Mon Sep 17 00:00:00 2001 From: Eli Stone <2546188+elistone@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:51:11 +0000 Subject: [PATCH 07/42] chore(SLB-508): updating the schema tests --- .../content/node/54ee7380-a3c0-4c45-8305-933143dc2ff6.yml | 2 +- tests/schema/specs/blocks.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/drupal/test_content/content/node/54ee7380-a3c0-4c45-8305-933143dc2ff6.yml b/packages/drupal/test_content/content/node/54ee7380-a3c0-4c45-8305-933143dc2ff6.yml index f2e4bdb3b..d3766a688 100644 --- a/packages/drupal/test_content/content/node/54ee7380-a3c0-4c45-8305-933143dc2ff6.yml +++ b/packages/drupal/test_content/content/node/54ee7380-a3c0-4c45-8305-933143dc2ff6.yml @@ -54,7 +54,7 @@ default: - + format: gutenberg summary: '' diff --git a/tests/schema/specs/blocks.spec.ts b/tests/schema/specs/blocks.spec.ts index 9ef12910a..019e2f498 100644 --- a/tests/schema/specs/blocks.spec.ts +++ b/tests/schema/specs/blocks.spec.ts @@ -677,7 +677,7 @@ test('Block: Quote', async () => { "__typename": "MediaImage", }, "quote": "My mother always used to say: The older you get, the better you get, unless you’re a banana.", - "role": "The Golden Girls", + "role": "TheGoldenGirls", }, ], }, From 5fd8ff0829daa1ee353db1aeb57c6b9ac384da83 Mon Sep 17 00:00:00 2001 From: Alex Tkachev Date: Thu, 12 Dec 2024 12:53:50 +0400 Subject: [PATCH 08/42] fix: prevent "netlify dev" from using node_modules --- apps/website/.gitignore | 3 +++ apps/website/deno.jsonc | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 apps/website/deno.jsonc diff --git a/apps/website/.gitignore b/apps/website/.gitignore index 395b0379a..1cf0b3875 100644 --- a/apps/website/.gitignore +++ b/apps/website/.gitignore @@ -5,3 +5,6 @@ public styles.css persisted-store + +# Deno comes with "netlify dev". We don't need its lock file. +/deno.lock diff --git a/apps/website/deno.jsonc b/apps/website/deno.jsonc new file mode 100644 index 000000000..bd6cbb078 --- /dev/null +++ b/apps/website/deno.jsonc @@ -0,0 +1,10 @@ +// This isn't a Deno project, yet Deno is added by netlify-cli when +// "netlify dev" is used. +// This file is picked up by Deno automatically, so we can use it to adjust Deno +// behavior. +{ + // By default, Deno will use node_modules/.deno dir for storing dependencies. + // Somehow it messes up node_modules resolution leading to Gatsby build + // errors. So we prevent Deno from using node_modules dir. + "nodeModulesDir": false, +} From 32660b9cef47e16838921b0737a5beb51ea596b3 Mon Sep 17 00:00:00 2001 From: Eli Stone <2546188+elistone@users.noreply.github.com> Date: Thu, 12 Dec 2024 11:57:03 +0000 Subject: [PATCH 09/42] chore(SLB-508): creating webform success page --- .../3c975048-5899-48c6-ae51-798202e8dc50.yml | 60 ++++++++ .../drupal/test_content/webforms/contact.yml | 132 +++++++++++++++++- .../drupal/test_content/webforms/inquiry.yml | 2 +- 3 files changed, 192 insertions(+), 2 deletions(-) create mode 100644 packages/drupal/test_content/content/node/3c975048-5899-48c6-ae51-798202e8dc50.yml diff --git a/packages/drupal/test_content/content/node/3c975048-5899-48c6-ae51-798202e8dc50.yml b/packages/drupal/test_content/content/node/3c975048-5899-48c6-ae51-798202e8dc50.yml new file mode 100644 index 000000000..8cc075b3b --- /dev/null +++ b/packages/drupal/test_content/content/node/3c975048-5899-48c6-ae51-798202e8dc50.yml @@ -0,0 +1,60 @@ +_meta: + version: '1.0' + entity_type: node + uuid: 3c975048-5899-48c6-ae51-798202e8dc50 + bundle: page + default_langcode: en +default: + revision_uid: + - + target_id: 1 + status: + - + value: true + uid: + - + target_id: 1 + title: + - + value: 'Webform Success Page' + created: + - + value: 1734004272 + promote: + - + value: false + sticky: + - + value: false + moderation_state: + - + value: published + pate_is_template: + - + value: false + pate_structure_only: + - + value: false + path: + - + alias: /webform/success + langcode: en + pathauto: 0 + content_translation_source: + - + value: und + content_translation_outdated: + - + value: false + body: + - + value: |- + + + + +

This is the webform success page, and some webforms will be redirected here upon success.

+ + + format: gutenberg + summary: '' diff --git a/packages/drupal/test_content/webforms/contact.yml b/packages/drupal/test_content/webforms/contact.yml index 2b0873429..a2e7c7a76 100644 --- a/packages/drupal/test_content/webforms/contact.yml +++ b/packages/drupal/test_content/webforms/contact.yml @@ -41,9 +41,139 @@ elements: |- css: '' javascript: '' settings: + ajax: false + ajax_scroll_top: form + ajax_progress_type: '' + ajax_effect: '' + ajax_speed: null + page: true + page_submit_path: '' + page_confirm_path: '' + page_theme_name: '' + form_title: both + form_submit_once: false + form_open_message: '' + form_close_message: '' + form_exception_message: '' + form_previous_submissions: true + form_confidential: false + form_confidential_message: '' + form_disable_remote_addr: false + form_convert_anonymous: false + form_prepopulate: false + form_prepopulate_source_entity: false + form_prepopulate_source_entity_required: false + form_prepopulate_source_entity_type: '' + form_unsaved: false + form_disable_back: false + form_submit_back: false + form_disable_autocomplete: false + form_novalidate: false + form_disable_inline_errors: false + form_required: false + form_autofocus: false + form_details_toggle: false + form_reset: false + form_access_denied: default + form_access_denied_title: '' + form_access_denied_message: '' + form_access_denied_attributes: { } + form_file_limit: '' + form_attributes: { } + form_method: '' + form_action: '' + share: false + share_node: false + share_theme_name: '' + share_title: true + share_page_body_attributes: { } + submission_label: '' + submission_exception_message: '' + submission_locked_message: '' + submission_log: false + submission_excluded_elements: { } + submission_exclude_empty: false + submission_exclude_empty_checkbox: false + submission_views: { } + submission_views_replace: { } + submission_user_columns: { } + submission_user_duplicate: false + submission_access_denied: default + submission_access_denied_title: '' + submission_access_denied_message: '' + submission_access_denied_attributes: { } + previous_submission_message: '' + previous_submissions_message: '' + autofill: false + autofill_message: '' + autofill_excluded_elements: { } + wizard_progress_bar: true + wizard_progress_pages: false + wizard_progress_percentage: false + wizard_progress_link: false + wizard_progress_states: false + wizard_start_label: '' + wizard_preview_link: false + wizard_confirmation: true + wizard_confirmation_label: '' + wizard_auto_forward: true + wizard_auto_forward_hide_next_button: false + wizard_keyboard: true + wizard_track: '' + wizard_prev_button_label: '' + wizard_next_button_label: '' + wizard_toggle: false + wizard_toggle_show_label: '' + wizard_toggle_hide_label: '' + wizard_page_type: container + wizard_page_title_tag: h2 + preview: 0 + preview_label: '' + preview_title: '' + preview_message: '' + preview_attributes: { } + preview_excluded_elements: { } + preview_exclude_empty: true + preview_exclude_empty_checkbox: false + draft: none + draft_multiple: false + draft_auto_save: false + draft_saved_message: '' + draft_loaded_message: '' + draft_pending_single_message: '' + draft_pending_multiple_message: '' confirmation_type: url_message - confirmation_url: /page-minimal + confirmation_url: /webform/success + confirmation_title: '' confirmation_message: 'Confirmation message for Contact webform' + confirmation_attributes: { } + confirmation_back: true + confirmation_back_label: '' + confirmation_back_attributes: { } + confirmation_exclude_query: false + confirmation_exclude_token: false + confirmation_update: false + limit_total: null + limit_total_interval: null + limit_total_message: '' + limit_total_unique: false + limit_user: null + limit_user_interval: null + limit_user_message: '' + limit_user_unique: false + entity_limit_total: null + entity_limit_total_interval: null + entity_limit_user: null + entity_limit_user_interval: null + purge: none + purge_days: null + results_disabled: false + results_disabled_ignore: false + results_customize: false + token_view: false + token_update: false + token_delete: false + serial_disabled: false access: create: roles: diff --git a/packages/drupal/test_content/webforms/inquiry.yml b/packages/drupal/test_content/webforms/inquiry.yml index 0dfaabc49..e95a6199b 100644 --- a/packages/drupal/test_content/webforms/inquiry.yml +++ b/packages/drupal/test_content/webforms/inquiry.yml @@ -140,7 +140,7 @@ settings: draft_pending_single_message: '' draft_pending_multiple_message: '' confirmation_type: url_message - confirmation_url: /page-minimal + confirmation_url: /webform/success confirmation_title: '' confirmation_message: 'Confirmation message for Contact webform' confirmation_attributes: { } From 10f2e0b53e5ef84abc8633fc7bacb293d4d956fa Mon Sep 17 00:00:00 2001 From: Eli Stone <2546188+elistone@users.noreply.github.com> Date: Thu, 12 Dec 2024 11:59:39 +0000 Subject: [PATCH 10/42] chore(SLB-508): added german version of block: form --- .../69c06c93-0d3f-47e1-a5ee-ba697bd532c1.yml | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/packages/drupal/test_content/content/node/69c06c93-0d3f-47e1-a5ee-ba697bd532c1.yml b/packages/drupal/test_content/content/node/69c06c93-0d3f-47e1-a5ee-ba697bd532c1.yml index 306877037..449ab375c 100644 --- a/packages/drupal/test_content/content/node/69c06c93-0d3f-47e1-a5ee-ba697bd532c1.yml +++ b/packages/drupal/test_content/content/node/69c06c93-0d3f-47e1-a5ee-ba697bd532c1.yml @@ -60,3 +60,51 @@ default: format: gutenberg summary: '' +translations: + de: + status: + - + value: true + uid: + - + target_id: 1 + title: + - + value: 'Block: Form DE' + created: + - + value: 1734004706 + promote: + - + value: false + sticky: + - + value: false + moderation_state: + - + value: published + path: + - + alias: /block-form + langcode: de + pathauto: 0 + content_translation_source: + - + value: en + content_translation_outdated: + - + value: false + body: + - + value: |- + + + + + + + + + + format: gutenberg + summary: '' From 0bc9b36e37f41352d54b0ea9c4571b4bc54d74cc Mon Sep 17 00:00:00 2001 From: Eli Stone <2546188+elistone@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:05:36 +0000 Subject: [PATCH 11/42] chore(SLB-508): translate the success page --- .../3c975048-5899-48c6-ae51-798202e8dc50.yml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/packages/drupal/test_content/content/node/3c975048-5899-48c6-ae51-798202e8dc50.yml b/packages/drupal/test_content/content/node/3c975048-5899-48c6-ae51-798202e8dc50.yml index 8cc075b3b..2609374ab 100644 --- a/packages/drupal/test_content/content/node/3c975048-5899-48c6-ae51-798202e8dc50.yml +++ b/packages/drupal/test_content/content/node/3c975048-5899-48c6-ae51-798202e8dc50.yml @@ -58,3 +58,49 @@ default: format: gutenberg summary: '' +translations: + de: + status: + - + value: true + uid: + - + target_id: 1 + title: + - + value: 'Webform Success Page DE' + created: + - + value: 1734005079 + promote: + - + value: false + sticky: + - + value: false + moderation_state: + - + value: published + path: + - + alias: /webform/success + langcode: de + pathauto: 0 + content_translation_source: + - + value: en + content_translation_outdated: + - + value: false + body: + - + value: |- + + + + +

Dies ist die Erfolgsseite des Webformulars. Einige Webformulare werden bei Erfolg hierher umgeleitet.

+ + + format: gutenberg + summary: '' From 9224564cd2d9a95a92c4c8e311f0f47d2e3669ee Mon Sep 17 00:00:00 2001 From: Eli Stone <2546188+elistone@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:07:38 +0000 Subject: [PATCH 12/42] chore(SLB-508): updating non block related tests --- tests/e2e/specs/drupal/content-hub.spec.ts | 2 +- tests/e2e/specs/drupal/webforms.spec.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/e2e/specs/drupal/content-hub.spec.ts b/tests/e2e/specs/drupal/content-hub.spec.ts index 5098712aa..59ca87ba1 100644 --- a/tests/e2e/specs/drupal/content-hub.spec.ts +++ b/tests/e2e/specs/drupal/content-hub.spec.ts @@ -38,7 +38,7 @@ test.describe('content hub', () => { ).not.toBeVisible(); await expect( content.getByRole('heading', { - name: 'Gatsby', + name: 'Block: Heading', level: 5, }), ).toBeVisible(); diff --git a/tests/e2e/specs/drupal/webforms.spec.ts b/tests/e2e/specs/drupal/webforms.spec.ts index d099cd505..7ab7374ef 100644 --- a/tests/e2e/specs/drupal/webforms.spec.ts +++ b/tests/e2e/specs/drupal/webforms.spec.ts @@ -3,17 +3,17 @@ import { expect, test } from '@playwright/test'; import { websiteUrl } from '../../helpers/url'; test('Webforms work', async ({ page }) => { - await page.goto(websiteUrl('/en/blocks-complete')); + await page.goto(websiteUrl('/en/block-form')); // Webform can be submitted. await page .frameLocator('.silverback-iframe iframe') - .last() + .first() .getByRole('button', { name: 'Send message' }) .click(); // Webform redirects to confirmation page. - await expect(page).toHaveURL(websiteUrl('/en/page-minimal')); + await expect(page).toHaveURL(websiteUrl('/en/webform/success')); // Confirmation message is shown. await expect( @@ -27,14 +27,14 @@ test('Webforms work', async ({ page }) => { ).toHaveCount(0); // Webform from the German page redirects to the German confirmation page. - await page.goto(websiteUrl('/de/blocks-complete')); + await page.goto(websiteUrl('/de/block-form')); await page .frameLocator('.silverback-iframe iframe') - .last() + .first() .getByRole('button', { name: 'Send message' }) .click(); // TODO: Find out why it does not work. - //await expect(page).toHaveURL(websiteUrl('/de/page-minimal')); + await expect(page).toHaveURL(websiteUrl('/de/webform/success')); // TODO: Move all silverback-mono tests here? // https://github.com/AmazeeLabs/silverback-mono/tree/development/packages/tests/silverback-iframe/playwright-tests From 4e61b0286739ec2e09e499c944c2b835c9589831 Mon Sep 17 00:00:00 2001 From: Eli Stone <2546188+elistone@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:07:56 +0000 Subject: [PATCH 13/42] chore(SLB-508): remove todo --- tests/e2e/specs/drupal/webforms.spec.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/e2e/specs/drupal/webforms.spec.ts b/tests/e2e/specs/drupal/webforms.spec.ts index 7ab7374ef..04fa6d9a0 100644 --- a/tests/e2e/specs/drupal/webforms.spec.ts +++ b/tests/e2e/specs/drupal/webforms.spec.ts @@ -33,7 +33,6 @@ test('Webforms work', async ({ page }) => { .first() .getByRole('button', { name: 'Send message' }) .click(); - // TODO: Find out why it does not work. await expect(page).toHaveURL(websiteUrl('/de/webform/success')); // TODO: Move all silverback-mono tests here? From 67f4111c289dae2e175cec200b6f72f51b19f76c Mon Sep 17 00:00:00 2001 From: Eli Stone <2546188+elistone@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:18:09 +0000 Subject: [PATCH 14/42] chore(SLB-508): creating hero block --- .../a48adc4b-6b05-44e0-9a05-30e2d206d726.yml | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 packages/drupal/test_content/content/node/a48adc4b-6b05-44e0-9a05-30e2d206d726.yml diff --git a/packages/drupal/test_content/content/node/a48adc4b-6b05-44e0-9a05-30e2d206d726.yml b/packages/drupal/test_content/content/node/a48adc4b-6b05-44e0-9a05-30e2d206d726.yml new file mode 100644 index 000000000..2ba966d48 --- /dev/null +++ b/packages/drupal/test_content/content/node/a48adc4b-6b05-44e0-9a05-30e2d206d726.yml @@ -0,0 +1,62 @@ +_meta: + version: '1.0' + entity_type: node + uuid: a48adc4b-6b05-44e0-9a05-30e2d206d726 + bundle: page + default_langcode: en + depends: + 3a0fe860-a6d6-428a-9474-365bd57509aa: media +default: + revision_uid: + - + target_id: 1 + status: + - + value: true + uid: + - + target_id: 1 + title: + - + value: 'Block: Hero' + created: + - + value: 1734005766 + promote: + - + value: false + sticky: + - + value: false + moderation_state: + - + value: published + pate_is_template: + - + value: false + pate_structure_only: + - + value: false + path: + - + alias: /block-hero + langcode: en + pathauto: 0 + content_translation_source: + - + value: und + content_translation_outdated: + - + value: false + body: + - + value: |- + + + + +

+ + + format: gutenberg + summary: '' From 1f40e203fe04c36b24a01a8980aaf010f95086ec Mon Sep 17 00:00:00 2001 From: Eli Stone <2546188+elistone@users.noreply.github.com> Date: Thu, 12 Dec 2024 13:41:54 +0000 Subject: [PATCH 15/42] chore(SLB-508): updating content --- .../content/node/a11aaeea-a71a-4ef0-a996-833c95767386.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/drupal/test_content/content/node/a11aaeea-a71a-4ef0-a996-833c95767386.yml b/packages/drupal/test_content/content/node/a11aaeea-a71a-4ef0-a996-833c95767386.yml index d3e131ed7..31748e4be 100644 --- a/packages/drupal/test_content/content/node/a11aaeea-a71a-4ef0-a996-833c95767386.yml +++ b/packages/drupal/test_content/content/node/a11aaeea-a71a-4ef0-a996-833c95767386.yml @@ -53,19 +53,19 @@ default: - +

Lorem ipsum dolor sit amet consectetur adipiscing elit auctor, lectus nibh gravida platea euismod parturient vitae interdum senectus, laoreet litora mauris tempor risus curae inceptos. Morbi ut facilisi ullamcorper arcu dictum hac congue eros nunc, nisl nullam dictumst malesuada euismod primis fusce convallis tempor, sociosqu est dis cursus maecenas id felis dui. Vestibulum turpis scelerisque montes felis laoreet metus ligula tincidunt auctor tempus fusce fermentum, conubia habitant sapien hac sed semper cum cubilia nunc augue. Laoreet velit parturient fermentum penatibus sociosqu mollis auctor nascetur pellentesque et libero, ac nisl commodo posuere sagittis enim egestas placerat molestie curabitur. Dictumst laoreet commodo magnis feugiat sagittis platea felis est convallis, integer curae blandit sociis suspendisse maecenas potenti risus ridiculus, a tempor tellus pellentesque fermentum fames tincidunt scelerisque.

- +

Lorem ipsum dolor sit amet consectetur adipiscing elit dis rutrum vestibulum congue est malesuada egestas vitae, at ante varius nec vulputate cubilia mauris cras auctor suscipit faucibus nisl dictumst. Pulvinar sociosqu parturient habitant himenaeos in volutpat nascetur magnis, iaculis varius at mi sollicitudin morbi ligula nec, diam per scelerisque risus elementum tempor vel. Velit montes quisque metus penatibus porttitor iaculis justo posuere, porta suspendisse sem nullam ante facilisis proin, neque sollicitudin dis himenaeos ligula morbi euismod. Volutpat tempus ultrices feugiat dictum senectus porta condimentum sodales, eros sociosqu libero risus suspendisse proin tortor, egestas ridiculus nostra platea commodo id torquent. Dis ultrices mollis hac tempor magna diam suscipit natoque odio et, tortor tellus enim litora eu felis ad volutpat cursus pharetra, nostra mus auctor inceptos metus mattis porta scelerisque magnis. Natoque iaculis nascetur pellentesque est arcu pharetra phasellus interdum, venenatis tempor proin dictum metus dapibus dis, tortor malesuada duis ad eu ullamcorper elementum. Metus odio dignissim dictum fames nec ut, faucibus porta placerat ullamcorper cum donec felis, tempor imperdiet scelerisque commodo himenaeos.

- +

Lorem ipsum dolor sit amet consectetur adipiscing elit sodales, dictum massa scelerisque parturient sagittis rutrum taciti porttitor, in eleifend habitant habitasse enim placerat phasellus. Mus tempus euismod id donec facilisi imperdiet mollis, montes convallis cubilia per tristique faucibus, pellentesque quam interdum sagittis tellus ac. Sociis sapien imperdiet himenaeos mus ornare conubia hac molestie proin, etiam diam arcu eleifend euismod odio vivamus. Turpis nisl ad hac duis fusce phasellus nibh dictum integer purus arcu, donec sociosqu eu at tortor sapien scelerisque tempus gravida mattis, torquent praesent feugiat volutpat felis viverra pellentesque eget suscipit quisque.

From 6287f4e6ee0390b95b6f6deac9f16194dc25d944 Mon Sep 17 00:00:00 2001 From: Eli Stone <2546188+elistone@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:17:11 +0000 Subject: [PATCH 16/42] chore(SLB-508): adding more content --- .../11a60305-a4b0-4c9c-8978-afae94794863.yml | 62 +++++++++++++++++++ .../a11aaeea-a71a-4ef0-a996-833c95767386.yml | 22 +++++++ .../a23e5334-20fc-4c34-acba-bf3c8cb5fa40.yml | 4 +- 3 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 packages/drupal/test_content/content/node/11a60305-a4b0-4c9c-8978-afae94794863.yml diff --git a/packages/drupal/test_content/content/node/11a60305-a4b0-4c9c-8978-afae94794863.yml b/packages/drupal/test_content/content/node/11a60305-a4b0-4c9c-8978-afae94794863.yml new file mode 100644 index 000000000..783584c43 --- /dev/null +++ b/packages/drupal/test_content/content/node/11a60305-a4b0-4c9c-8978-afae94794863.yml @@ -0,0 +1,62 @@ +_meta: + version: '1.0' + entity_type: node + uuid: 11a60305-a4b0-4c9c-8978-afae94794863 + bundle: page + default_langcode: en + depends: + 5dfc1856-e9e4-4f02-9cd6-9d888870ce1a: media +default: + revision_uid: + - + target_id: 1 + status: + - + value: true + uid: + - + target_id: 1 + title: + - + value: 'Block: Hero with Form' + created: + - + value: 1734016491 + promote: + - + value: false + sticky: + - + value: false + moderation_state: + - + value: published + pate_is_template: + - + value: false + pate_structure_only: + - + value: false + path: + - + alias: /block-hero-form + langcode: en + pathauto: 0 + content_translation_source: + - + value: und + content_translation_outdated: + - + value: false + body: + - + value: |- + + + + +

+ + + format: gutenberg + summary: '' diff --git a/packages/drupal/test_content/content/node/a11aaeea-a71a-4ef0-a996-833c95767386.yml b/packages/drupal/test_content/content/node/a11aaeea-a71a-4ef0-a996-833c95767386.yml index 31748e4be..5e3348f8d 100644 --- a/packages/drupal/test_content/content/node/a11aaeea-a71a-4ef0-a996-833c95767386.yml +++ b/packages/drupal/test_content/content/node/a11aaeea-a71a-4ef0-a996-833c95767386.yml @@ -54,22 +54,44 @@ default: + +

I am the content for title one.

+ +

Lorem ipsum dolor sit amet consectetur adipiscing elit auctor, lectus nibh gravida platea euismod parturient vitae interdum senectus, laoreet litora mauris tempor risus curae inceptos. Morbi ut facilisi ullamcorper arcu dictum hac congue eros nunc, nisl nullam dictumst malesuada euismod primis fusce convallis tempor, sociosqu est dis cursus maecenas id felis dui. Vestibulum turpis scelerisque montes felis laoreet metus ligula tincidunt auctor tempus fusce fermentum, conubia habitant sapien hac sed semper cum cubilia nunc augue. Laoreet velit parturient fermentum penatibus sociosqu mollis auctor nascetur pellentesque et libero, ac nisl commodo posuere sagittis enim egestas placerat molestie curabitur. Dictumst laoreet commodo magnis feugiat sagittis platea felis est convallis, integer curae blandit sociis suspendisse maecenas potenti risus ridiculus, a tempor tellus pellentesque fermentum fames tincidunt scelerisque.

+ +

I am the content for title two.

+ +

Lorem ipsum dolor sit amet consectetur adipiscing elit dis rutrum vestibulum congue est malesuada egestas vitae, at ante varius nec vulputate cubilia mauris cras auctor suscipit faucibus nisl dictumst. Pulvinar sociosqu parturient habitant himenaeos in volutpat nascetur magnis, iaculis varius at mi sollicitudin morbi ligula nec, diam per scelerisque risus elementum tempor vel. Velit montes quisque metus penatibus porttitor iaculis justo posuere, porta suspendisse sem nullam ante facilisis proin, neque sollicitudin dis himenaeos ligula morbi euismod. Volutpat tempus ultrices feugiat dictum senectus porta condimentum sodales, eros sociosqu libero risus suspendisse proin tortor, egestas ridiculus nostra platea commodo id torquent. Dis ultrices mollis hac tempor magna diam suscipit natoque odio et, tortor tellus enim litora eu felis ad volutpat cursus pharetra, nostra mus auctor inceptos metus mattis porta scelerisque magnis. Natoque iaculis nascetur pellentesque est arcu pharetra phasellus interdum, venenatis tempor proin dictum metus dapibus dis, tortor malesuada duis ad eu ullamcorper elementum. Metus odio dignissim dictum fames nec ut, faucibus porta placerat ullamcorper cum donec felis, tempor imperdiet scelerisque commodo himenaeos.

+ +

I am the content for title three.

+ +

Lorem ipsum dolor sit amet consectetur adipiscing elit sodales, dictum massa scelerisque parturient sagittis rutrum taciti porttitor, in eleifend habitant habitasse enim placerat phasellus. Mus tempus euismod id donec facilisi imperdiet mollis, montes convallis cubilia per tristique faucibus, pellentesque quam interdum sagittis tellus ac. Sociis sapien imperdiet himenaeos mus ornare conubia hac molestie proin, etiam diam arcu eleifend euismod odio vivamus. Turpis nisl ad hac duis fusce phasellus nibh dictum integer purus arcu, donec sociosqu eu at tortor sapien scelerisque tempus gravida mattis, torquent praesent feugiat volutpat felis viverra pellentesque eget suscipit quisque.

+ + + +

I am the content for title four.

+ + + +

Lorem ipsum dolor sit amet consectetur adipiscing elit justo habitant, platea laoreet hac suspendisse taciti euismod fermentum cras. Sed purus est varius nullam, sem magna ultricies viverra dui, class a vehicula. Leo enim dapibus malesuada feugiat dis dui placerat pretium, lacus taciti cum sociis diam tortor dictumst, libero vel venenatis turpis nisl dictum cursus. Auctor habitant duis vestibulum venenatis natoque a ligula, malesuada senectus integer tempus fames turpis. Nostra varius feugiat habitasse eget lacinia porttitor phasellus aliquet nascetur eu a semper maecenas conubia velit sagittis, euismod praesent justo nunc lectus pulvinar nullam egestas molestie pretium metus ullamcorper luctus tincidunt tellus. Accumsan dapibus per quisque malesuada sagittis leo montes erat, euismod nostra sem cras rhoncus turpis tempor placerat aptent, taciti cubilia lobortis pellentesque nulla lectus eleifend.

+ + format: gutenberg diff --git a/packages/drupal/test_content/content/node/a23e5334-20fc-4c34-acba-bf3c8cb5fa40.yml b/packages/drupal/test_content/content/node/a23e5334-20fc-4c34-acba-bf3c8cb5fa40.yml index 2707f2bf9..740408fcf 100644 --- a/packages/drupal/test_content/content/node/a23e5334-20fc-4c34-acba-bf3c8cb5fa40.yml +++ b/packages/drupal/test_content/content/node/a23e5334-20fc-4c34-acba-bf3c8cb5fa40.yml @@ -56,9 +56,9 @@ default: - + - + format: gutenberg From 98acbc19d5c111251f8569d77af1b4c198b8ca23 Mon Sep 17 00:00:00 2001 From: Eli Stone <2546188+elistone@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:20:24 +0000 Subject: [PATCH 17/42] chore(SLB-508): adjusting all the block tests --- tests/e2e/specs/drupal/blocks.spec.ts | 345 +++++++++++++++++++++----- 1 file changed, 280 insertions(+), 65 deletions(-) diff --git a/tests/e2e/specs/drupal/blocks.spec.ts b/tests/e2e/specs/drupal/blocks.spec.ts index 2432ac6b7..a3db88738 100644 --- a/tests/e2e/specs/drupal/blocks.spec.ts +++ b/tests/e2e/specs/drupal/blocks.spec.ts @@ -1,80 +1,295 @@ -import { expect, test } from '@playwright/test'; +import { expect, Page, test } from '@playwright/test'; import { websiteUrl } from '../../helpers/url'; -test('All blocks are rendered', async ({ page }) => { - await page.goto(websiteUrl('/en/blocks-complete')); - - // Hero - await expect( - page.locator('img[data-test-id=hero-image][alt="A beautiful landscape."]'), - ).toHaveCount(1); +const validateTileAndSubtitle = async (page: Page, title: string) => { + const content = page.getByRole('main'); await expect( - page.locator('h1:text("All kinds of blocks with maximum data")'), - ).toHaveCount(1); - await expect(page.locator('text="Lead text"')).toHaveCount(1); + content.getByRole('heading', { + name: title, + level: 1, + }), + ).toBeVisible(); + await expect(content.getByText(title).last()).toBeVisible(); +}; - // Paragraph - await expect( - page.locator('p:text("A standalone paragraph with markup and link")'), - ).toHaveCount(1); - await expect( - page.locator('a:text("link")[href="/en/architecture"]'), - ).toHaveCount(1); +test.describe('Testing All Blocks', () => { + test('Accordion', async ({ page }) => { + await page.goto(websiteUrl('/en/block-accordion')); + await validateTileAndSubtitle(page, 'Block: Accordion'); - // Horizontal separator. - await expect(page.locator('hr')).toHaveCount(1); + const accordionItems = [ + { + title: 'Accordion Title One', + content: 'I am the content for title one.', + hasIcon: true, + }, + { + title: 'Accordion Title Two', + content: 'I am the content for title two.', + hasIcon: true, + }, + { + title: 'Accordion Title Three', + content: 'I am the content for title three.', + hasIcon: true, + }, + { + title: 'Accordion Title Four', + content: 'I am the content for title four.', + hasIcon: false, + }, + ]; - // Image and ImageWithText block - await expect( - page.locator( - 'img:not([data-test-id=hero-image])[alt="A beautiful landscape."]', - ), - ).toHaveCount(2); - await expect(page.locator('figcaption:text("Media image")')).toHaveCount(1); + const content = page.getByRole('main'); + for (const item of accordionItems) { + await expect(content.getByText(item.title)).toBeVisible(); + await content.getByText(item.title).click(); + await expect(content.getByText(item.content)).toBeVisible(); + } + }); - // Video - await expect( - page.locator('video[src*="/video_mp4_belt.mp4"][controls]'), - ).toHaveCount(1); - await expect(page.locator('figcaption:text("Media video")')).toHaveCount(1); + test('Conditional content', async ({ page }) => { + await page.goto(websiteUrl('/en/block-conditional-content')); + await validateTileAndSubtitle(page, 'Block: Conditional content'); - // Table - await expect(page.locator('figure.wp-block-table > table')).toHaveCount(1); - await expect( - page.locator('figure.wp-block-table > figcaption:text("Table caption")'), - ).toHaveCount(1); + await expect( + page.getByText('This content will only be shown for one year.'), + ).toBeVisible(); + }); - // List - await expect(page.locator('ul > li:text("list 1")')).toHaveCount(1); - await expect(page.locator('ol > li:text("list 2.2")')).toHaveCount(1); + test('CTA', async ({ page }) => { + await page.goto(websiteUrl('/en/block-cta')); + await validateTileAndSubtitle(page, 'Block: CTA'); - // Heading - await expect(page.locator('h3:text("Heading 3")')).toHaveCount(1); + // CTA blocks + await expect(page.locator('a:text("Block CTA")')).toHaveCount(1); + await expect(page.locator('a:text("CTA with Icon")')).toHaveCount(1); + }); - // Quote - await expect( - page.locator( - 'blockquote p:text("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus sagittis nisi nec neque porta, a ornare ligula efficitur.")', - ), - ).toHaveCount(1); - await expect( - page.locator('blockquote p.not-prose:text("John Doe")'), - ).toHaveCount(1); - await expect( - page.locator('blockquote p.not-prose span:text("Project manager")'), - ).toHaveCount(1); - await expect( - page.locator('blockquote img[alt="The silverback"]'), - ).toHaveCount(1); + test('Form', async ({ page }) => { + // EN + await page.goto(websiteUrl('/en/block-form')); + await validateTileAndSubtitle(page, 'Block: Form'); + await expect( + page.locator('.silverback-iframe iframe').first(), + ).toHaveAttribute('src', /en\/form\/contact\?iframe=true/); - // CTA blocks - await expect(page.locator('a:text("Internal CTA")')).toHaveCount(1); - await expect(page.locator('a:text("External CTA")')).toHaveCount(1); - await expect(page.locator('a:text("CTA with link to media")')).toHaveCount(1); + // DE + await page.goto(websiteUrl('/de/block-form')); + await validateTileAndSubtitle(page, 'Block: Formular'); + await expect( + page.locator('.silverback-iframe iframe').first(), + ).toHaveAttribute('src', /de\/form\/contact\?iframe=true/); + }); - // Form - await expect( - page.locator('.silverback-iframe iframe').last(), - ).toHaveAttribute('src', 'http://127.0.0.1:8000/en/form/contact?iframe=true'); + test('Heading', async ({ page }) => { + await page.goto(websiteUrl('/en/block-heading')); + await validateTileAndSubtitle(page, 'Block: Heading'); + + const headingItems = [ + { + title: 'Heading two', + level: 2, + id: 'heading-two', + }, + { + title: 'Heading three', + level: 3, + id: 'heading-three', + }, + { + title: 'Heading four', + level: 4, + id: 'heading-four', + }, + { + title: 'Heading two - Bold', + level: 2, + id: 'heading-two---bold', + }, + { + title: 'Heading three - Bold', + level: 3, + id: 'heading-three---bold', + }, + { + title: 'Heading four - Bold', + level: 4, + id: 'heading-four---bold', + }, + ]; + + const content = page.getByRole('main'); + for (const item of headingItems) { + const header = content.getByRole('heading', { + name: item.title, + level: item.level, + exact: true, + }); + + await expect(header).toBeVisible(); + await expect(header).toHaveAttribute('id', item.id); + } + }); + + test('Hero', async ({ page }) => { + await page.goto(websiteUrl('/en/block-hero')); + await validateTileAndSubtitle(page, 'Block: Hero'); + + await expect( + page.locator( + 'img[data-test-id=hero-image][alt="A beautiful landscape."]', + ), + ).toHaveCount(2); + }); + + test('Hero with Form', async ({ page }) => { + await page.goto(websiteUrl('/en/block-hero-form')); + await validateTileAndSubtitle(page, 'Block: Hero with Form'); + + await expect( + page.locator('img[data-test-id=hero-image][alt="The silverback"]'), + ).toHaveCount(1); + + await expect( + page.locator('.silverback-iframe iframe').first(), + ).toHaveAttribute('src', /en\/form\/contact\?iframe=true/); + }); + + test('Horizontal separator', async ({ page }) => { + await page.goto(websiteUrl('/en/block-horizontal-separator')); + await validateTileAndSubtitle(page, 'Block: Horizontal separator'); + + await expect(page.locator('hr')).toHaveCount(2); + }); + + test('Image Teasers', async ({ page }) => { + await page.goto(websiteUrl('/en/block-image-teasers')); + await validateTileAndSubtitle(page, 'Block: Image Teasers'); + + await expect( + page.locator( + 'img:not([data-test-id=hero-image])[alt="A beautiful landscape."]', + ), + ).toHaveCount(1); + await expect(page.locator('h2:text("Image One Teaser Title")')).toHaveCount( + 1, + ); + await expect(page.locator('a:text("Image One Teaser CTA")')).toHaveCount(1); + await expect( + page.locator('img:not([data-test-id=hero-image])[alt="The silverback"]'), + ).toHaveCount(1); + await expect(page.locator('h2:text("Image Two Teaser Title")')).toHaveCount( + 1, + ); + await expect(page.locator('a:text("Image Two Teaser CTA")')).toHaveCount(1); + }); + + test('Image with Text', async ({ page }) => { + await page.goto(websiteUrl('/en/block-image-text')); + await validateTileAndSubtitle(page, 'Block: Image with Text'); + + await expect( + page.locator( + 'img:not([data-test-id=hero-image])[alt="A beautiful landscape."]', + ), + ).toHaveCount(1); + await expect( + page.locator('img:not([data-test-id=hero-image])[alt="The silverback"]'), + ).toHaveCount(1); + + await expect( + page.locator('p:text("Image with text on the left")'), + ).toHaveCount(1); + await expect( + page.locator('p:text("Image with text on the right")'), + ).toHaveCount(1); + }); + + test('Info Grid', async ({ page }) => { + await page.goto(websiteUrl('/en/block-info-grid')); + await validateTileAndSubtitle(page, 'Block: Info Grid'); + + await expect(page.locator('p:text("Some information here")')).toHaveCount( + 3, + ); + const content = page.getByRole('main'); + await expect(content.locator('svg')).toHaveCount(3); + }); + + test('List', async ({ page }) => { + await page.goto(websiteUrl('/en/block-list')); + await validateTileAndSubtitle(page, 'Block: List'); + + const content = page.getByRole('main'); + await expect(content.locator('ul > li')).toHaveCount(12); + await expect(content.locator('ul.list-style--arrows > li')).toHaveCount(3); + await expect(content.locator('ul.list-style--checkmarks > li')).toHaveCount( + 3, + ); + await expect( + page.locator('ul.list-style--question-marks > li'), + ).toHaveCount(3); + }); + + test('Media', async ({ page }) => { + await page.goto(websiteUrl('/en/block-media')); + await validateTileAndSubtitle(page, 'Block: Media'); + + await expect( + page.locator('img:not([data-test-id=hero-image])[alt="The silverback"]'), + ).toHaveCount(1); + await expect( + page.locator('figcaption:text("Media Image Caption")'), + ).toHaveCount(1); + }); + + test('Paragraph', async ({ page }) => { + await page.goto(websiteUrl('/en/block-paragraph')); + await validateTileAndSubtitle(page, 'Block: Paragraph'); + + const content = page.getByRole('main'); + await expect(content.locator('.container-text .prose p')).toHaveCount(2); + }); + + test('Quote', async ({ page }) => { + await page.goto(websiteUrl('/en/block-quote')); + await validateTileAndSubtitle(page, 'Block: Quote'); + + await expect( + page.locator( + 'p:text("My mother always used to say: The older you get, the better you get, unless you’re a banana.")', + ), + ).toHaveCount(1); + await expect(page.locator('p:text("Rose (Betty White)")')).toHaveCount(1); + await expect(page.locator('span:text("TheGoldenGirls")')).toHaveCount(1); + }); + + test('Table', async ({ page }) => { + await page.goto(websiteUrl('/en/block-table')); + await validateTileAndSubtitle(page, 'Block: Table'); + + const content = page.getByRole('main'); + await expect(content.locator('table')).toHaveCount(4); + await expect(content.locator('td')).toHaveCount(84); + + await expect( + page.locator('figcaption:text("Table Caption - Fixed width")'), + ).toHaveCount(1); + await expect( + page.locator('figcaption:text("Table Caption - Header Section")'), + ).toHaveCount(1); + await expect( + page.locator('figcaption:text("Table Caption - Footer Section")'), + ).toHaveCount(1); + }); + + test('Teaser list', async ({ page }) => { + await page.goto(websiteUrl('/en/block-teaser-list')); + await validateTileAndSubtitle(page, 'Block: Teaser list'); + + const content = page.getByRole('main'); + await expect(content.locator('ul > li')).toHaveCount(8); + }); }); From d54d4b1e720fe70bc9a80ff3fafafc8ce5743961 Mon Sep 17 00:00:00 2001 From: Eli Stone <2546188+elistone@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:23:02 +0000 Subject: [PATCH 18/42] chore(SLB-508): removing blocks page as now replaced with block(s) --- .../a397ca48-8fad-411e-8901-0eba2feb989c.yml | 225 ------------------ 1 file changed, 225 deletions(-) delete mode 100644 packages/drupal/test_content/content/node/a397ca48-8fad-411e-8901-0eba2feb989c.yml diff --git a/packages/drupal/test_content/content/node/a397ca48-8fad-411e-8901-0eba2feb989c.yml b/packages/drupal/test_content/content/node/a397ca48-8fad-411e-8901-0eba2feb989c.yml deleted file mode 100644 index 77f28fe8f..000000000 --- a/packages/drupal/test_content/content/node/a397ca48-8fad-411e-8901-0eba2feb989c.yml +++ /dev/null @@ -1,225 +0,0 @@ -_meta: - version: '1.0' - entity_type: node - uuid: a397ca48-8fad-411e-8901-0eba2feb989c - bundle: page - default_langcode: en - depends: - 3a0fe860-a6d6-428a-9474-365bd57509aa: media - 478c4289-961d-4ce8-85d6-578ae05f3019: media - 5dfc1856-e9e4-4f02-9cd6-9d888870ce1a: media - 72187a1f-3e48-4b45-a9b7-189c6fd7ee26: media - 0b45a665-286a-414e-a091-c13fa4e20eb2: node -default: - revision_uid: - - - target_id: 1 - status: - - - value: true - uid: - - - target_id: 1 - title: - - - value: 'Blocks: complete' - created: - - - value: 1686759493 - promote: - - - value: false - sticky: - - - value: false - moderation_state: - - - value: published - pate_is_template: - - - value: false - pate_structure_only: - - - value: false - path: - - - alias: /blocks-complete - langcode: en - pathauto: 0 - content_translation_source: - - - value: und - content_translation_outdated: - - - value: false - body: - - - value: |- - - - - -

A standalone paragraph with markup and link

- - - - - - - - - - - - -

All kinds of allowed blocks

- - - - - - - -

Heading

- - - - -

Quote

Citation
- - - -

- - - - -

Starting from this paragraph, all the following blocks should be aggregated, as they are just HTML

- - - -
12
34 with markup
Table caption
- - - - - - - -

Heading 3

- - - -

Quote

Citation
- - - - - - - - - - - - - - - - - - - -

Incididunt laborum velit non proident nostrud velit. Minim excepteur ut aliqua nisi. Culpa laboris consectetur proident. Tempor esse ullamco et dolor proident id officia laborum voluptate nostrud elit dolore qui amet. Ex Lorem irure eu anim ipsum officia.

- - - - - - - - - -

Incididunt laborum velit non proident nostrud velit. Minim excepteur ut aliqua nisi. Culpa laboris consectetur proident. Tempor esse ullamco et dolor proident id officia laborum voluptate nostrud elit dolore qui amet. Ex Lorem irure eu anim ipsum officia.

- - - - - format: gutenberg - summary: '' -translations: - de: - status: - - - value: true - uid: - - - target_id: 1 - title: - - - value: 'Blocks: complete DE' - created: - - - value: 1687338353 - promote: - - - value: false - sticky: - - - value: false - moderation_state: - - - value: published - path: - - - alias: /blocks-complete - langcode: de - pathauto: 0 - content_translation_source: - - - value: en - content_translation_outdated: - - - value: false - body: - - - value: |- - - - - -

A standalone paragraph with markup and link DE

- - - - - - - - - -

Starting from this paragraph, all the following blocks should be aggregated, as they are just HTML DE

- - - -
12
34 with markup DE
Table caption DE
- - - - - - - -

Heading 3 DE

- - - -

Quote DE

Citation DE
- - - -

- - - format: gutenberg - summary: '' From 67ac1fb9dbb168f022ad7a5415ebcfcf66e678b0 Mon Sep 17 00:00:00 2001 From: Eli Stone <2546188+elistone@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:31:52 +0000 Subject: [PATCH 19/42] chore(SLB-508): updating schema tests --- tests/schema/specs/blocks.spec.ts | 38 +++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/tests/schema/specs/blocks.spec.ts b/tests/schema/specs/blocks.spec.ts index 019e2f498..b3ccd5921 100644 --- a/tests/schema/specs/blocks.spec.ts +++ b/tests/schema/specs/blocks.spec.ts @@ -300,9 +300,11 @@ test('Block: Accordion', async () => { "items": [ { "__typename": "BlockAccordionItemText", - "icon": "", + "icon": "checkmark", "textContent": { "markup": " +

I am the content for title one.

+

Lorem ipsum dolor sit amet consectetur adipiscing elit auctor, lectus nibh gravida platea euismod parturient vitae interdum senectus, laoreet litora mauris tempor risus curae inceptos. Morbi ut facilisi ullamcorper arcu dictum hac congue eros nunc, nisl nullam dictumst malesuada euismod primis fusce convallis tempor, sociosqu est dis cursus maecenas id felis dui. Vestibulum turpis scelerisque montes felis laoreet metus ligula tincidunt auctor tempus fusce fermentum, conubia habitant sapien hac sed semper cum cubilia nunc augue. Laoreet velit parturient fermentum penatibus sociosqu mollis auctor nascetur pellentesque et libero, ac nisl commodo posuere sagittis enim egestas placerat molestie curabitur. Dictumst laoreet commodo magnis feugiat sagittis platea felis est convallis, integer curae blandit sociis suspendisse maecenas potenti risus ridiculus, a tempor tellus pellentesque fermentum fames tincidunt scelerisque.

", }, @@ -310,24 +312,40 @@ test('Block: Accordion', async () => { }, { "__typename": "BlockAccordionItemText", - "icon": "", + "icon": "questionmark", "textContent": { "markup": " +

I am the content for title two.

+

Lorem ipsum dolor sit amet consectetur adipiscing elit dis rutrum vestibulum congue est malesuada egestas vitae, at ante varius nec vulputate cubilia mauris cras auctor suscipit faucibus nisl dictumst. Pulvinar sociosqu parturient habitant himenaeos in volutpat nascetur magnis, iaculis varius at mi sollicitudin morbi ligula nec, diam per scelerisque risus elementum tempor vel. Velit montes quisque metus penatibus porttitor iaculis justo posuere, porta suspendisse sem nullam ante facilisis proin, neque sollicitudin dis himenaeos ligula morbi euismod. Volutpat tempus ultrices feugiat dictum senectus porta condimentum sodales, eros sociosqu libero risus suspendisse proin tortor, egestas ridiculus nostra platea commodo id torquent. Dis ultrices mollis hac tempor magna diam suscipit natoque odio et, tortor tellus enim litora eu felis ad volutpat cursus pharetra, nostra mus auctor inceptos metus mattis porta scelerisque magnis. Natoque iaculis nascetur pellentesque est arcu pharetra phasellus interdum, venenatis tempor proin dictum metus dapibus dis, tortor malesuada duis ad eu ullamcorper elementum. Metus odio dignissim dictum fames nec ut, faucibus porta placerat ullamcorper cum donec felis, tempor imperdiet scelerisque commodo himenaeos.

", }, - "title": "Accordion Title Two", + "title": "Accordion Title Two", }, { "__typename": "BlockAccordionItemText", - "icon": "", + "icon": "arrow", "textContent": { "markup": " +

I am the content for title three.

+

Lorem ipsum dolor sit amet consectetur adipiscing elit sodales, dictum massa scelerisque parturient sagittis rutrum taciti porttitor, in eleifend habitant habitasse enim placerat phasellus. Mus tempus euismod id donec facilisi imperdiet mollis, montes convallis cubilia per tristique faucibus, pellentesque quam interdum sagittis tellus ac. Sociis sapien imperdiet himenaeos mus ornare conubia hac molestie proin, etiam diam arcu eleifend euismod odio vivamus. Turpis nisl ad hac duis fusce phasellus nibh dictum integer purus arcu, donec sociosqu eu at tortor sapien scelerisque tempus gravida mattis, torquent praesent feugiat volutpat felis viverra pellentesque eget suscipit quisque.

", }, "title": "Accordion Title Three", }, + { + "__typename": "BlockAccordionItemText", + "icon": "", + "textContent": { + "markup": " +

I am the content for title four.

+ +

Lorem ipsum dolor sit amet consectetur adipiscing elit justo habitant, platea laoreet hac suspendisse taciti euismod fermentum cras. Sed purus est varius nullam, sem magna ultricies viverra dui, class a vehicula. Leo enim dapibus malesuada feugiat dis dui placerat pretium, lacus taciti cum sociis diam tortor dictumst, libero vel venenatis turpis nisl dictum cursus. Auctor habitant duis vestibulum venenatis natoque a ligula, malesuada senectus integer tempus fames turpis. Nostra varius feugiat habitasse eget lacinia porttitor phasellus aliquet nascetur eu a semper maecenas conubia velit sagittis, euismod praesent justo nunc lectus pulvinar nullam egestas molestie pretium metus ullamcorper luctus tincidunt tellus. Accumsan dapibus per quisque malesuada sagittis leo montes erat, euismod nostra sem cras rhoncus turpis tempor placerat aptent, taciti cubilia lobortis pellentesque nulla lectus eleifend.

+ ", + }, + "title": "Accordion Title Four", + }, ], }, ], @@ -469,21 +487,21 @@ test('Block: Image Teasers', async () => { "teasers": [ { "__typename": "BlockImageTeaser", - "ctaText": "Image Teaser CTA", - "ctaUrl": null, + "ctaText": "Image One Teaser CTA", + "ctaUrl": "/", "image": { "__typename": "MediaImage", }, - "title": "Image Teaser Title", + "title": "Image One Teaser Title", }, { "__typename": "BlockImageTeaser", - "ctaText": "Image Teaser CTA", - "ctaUrl": null, + "ctaText": "Image Two Teaser CTA", + "ctaUrl": "/", "image": { "__typename": "MediaImage", }, - "title": "Image Teaser Title", + "title": "Image Two Teaser Title", }, ], }, From f75d2812c193ca7b1899b6f47f14ee04c8848d9e Mon Sep 17 00:00:00 2001 From: Eli Stone <2546188+elistone@users.noreply.github.com> Date: Fri, 13 Dec 2024 11:21:07 +0000 Subject: [PATCH 20/42] fix: enable drop cap styling --- .../Organisms/PageContent/BlockMarkup.stories.ts | 2 +- packages/ui/src/components/Routes/Page.stories.tsx | 8 ++++++-- packages/ui/src/tailwind.css | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/ui/src/components/Organisms/PageContent/BlockMarkup.stories.ts b/packages/ui/src/components/Organisms/PageContent/BlockMarkup.stories.ts index 765b45486..f028c1e89 100644 --- a/packages/ui/src/components/Organisms/PageContent/BlockMarkup.stories.ts +++ b/packages/ui/src/components/Organisms/PageContent/BlockMarkup.stories.ts @@ -72,7 +72,7 @@ export const Mixed = { args: { markup: `

Heading 1

-

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Heading 2

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.