Skip to content

Commit

Permalink
test(SLB-297): update default content and schema tests to include quo…
Browse files Browse the repository at this point in the history
…te blocks
  • Loading branch information
chindris committed Apr 16, 2024
1 parent d8d41f3 commit 63a9f6b
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,43 @@ _meta:
72187a1f-3e48-4b45-a9b7-189c6fd7ee26: media
default:
revision_uid:
- target_id: 1
-
target_id: 1
status:
- value: true
-
value: true
uid:
- target_id: 1
-
target_id: 1
title:
- value: 'Blocks: complete'
-
value: 'Blocks: complete'
created:
- value: 1686759493
-
value: 1686759493
promote:
- value: false
-
value: false
sticky:
- value: false
-
value: false
moderation_state:
- value: published
-
value: published
path:
- alias: /blocks-complete
-
alias: /blocks-complete
langcode: en
pathauto: 0
content_translation_source:
- value: und
-
value: und
content_translation_outdated:
- value: false
-
value: false
body:
- value: |-
-
value: |-
<!-- wp:custom/hero {"mediaEntityIds":["3a0fe860-a6d6-428a-9474-365bd57509aa"],"headline":"All kinds of blocks with maximum data","lead":"Lead text","ctaUrl":"https://example.com","ctaText":"CTA text","formId":"contact"} /-->
<!-- wp:custom/content -->
Expand Down Expand Up @@ -79,6 +91,9 @@ default:
<!-- wp:custom/cta {"url":"https://www.google.com","text":"External CTA","data-id":"https://www.google.com","data-entity-type":"","openInNewTab":true} /-->
<!-- wp:custom/cta {"url":"/media/1","text":"CTA with link to media","data-id":"b998ae5e-8b56-40ca-8f80-fd4404e7e716","data-entity-type":"media"} /-->
<!-- wp:custom/quote {"quote":"Lorem ipsum dolor sit amet, \u003cstrong\u003econsectetur\u003c/strong\u003e adipiscing elit. Vivamus sagittis nisi nec neque porta, a ornare ligula efficitur.","author":"John Doe","role":"Project manager","mediaEntityIds":["3a0fe860-a6d6-428a-9474-365bd57509aa"]} /-->
<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->
Expand All @@ -88,29 +103,40 @@ default:
translations:
de:
status:
- value: true
-
value: true
uid:
- target_id: 1
-
target_id: 1
title:
- value: 'Blocks: complete DE'
-
value: 'Blocks: complete DE'
created:
- value: 1687338353
-
value: 1687338353
promote:
- value: false
-
value: false
sticky:
- value: false
-
value: false
moderation_state:
- value: published
-
value: published
path:
- alias: /blocks-complete
-
alias: /blocks-complete
langcode: de
pathauto: 0
content_translation_source:
- value: en
-
value: en
content_translation_outdated:
- value: false
-
value: false
body:
- value: |-
-
value: |-
<!-- wp:custom/hero {"mediaEntityIds":["3a0fe860-a6d6-428a-9474-365bd57509aa"],"headline":"All kinds of blocks with maximum data DE","lead":"Lead text DE"} /-->
<!-- wp:custom/content -->
Expand Down Expand Up @@ -149,6 +175,8 @@ translations:
<!-- wp:custom/cta {"url":"https://www.example.com","text":"External CTA DE","data-id":"https://www.example.com","data-entity-type":"","openInNewTab":true} /-->
<!-- wp:custom/cta {"url":"/media/1","text":"CTA with link to media DE","data-id":"b998ae5e-8b56-40ca-8f80-fd4404e7e716","data-entity-type":"media"} /-->
<!-- wp:custom/quote {"quote":"Lorem ipsum dolor sit amet, consectetur \u003cstrong\u003eadipiscing\u003c/strong\u003e elit. Vivamus sagittis nisi nec neque porta, a ornare ligula efficitur DE.","author":"John Doe","role":"Projektmanager","mediaEntityIds":["3a0fe860-a6d6-428a-9474-365bd57509aa"]} /-->
<!-- /wp:custom/content -->
format: gutenberg
summary: ''
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ default:
<!-- /wp:custom/heading -->
<!-- wp:custom/cta /-->
<!-- wp:custom/quote {"quote":"In vitae diam quis odio tincidunt faucibus eget ut libero","author":"Jane Doe"} /-->
<!-- /wp:custom/content -->
format: gutenberg
summary: ''
24 changes: 24 additions & 0 deletions tests/schema/specs/blocks.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ test('Blocks', async () => {
text
openInNewTab
}
... on BlockQuote {
quote
author
role
image {
__typename
}
}
}
}
{
Expand Down Expand Up @@ -161,6 +169,15 @@ test('Blocks', async () => {
"text": "CTA with link to media",
"url": "/media/[numeric]",
},
{
"__typename": "BlockQuote",
"author": "John Doe",
"image": {
"__typename": "MediaImage",
},
"quote": "Lorem ipsum dolor sit amet, <strong>consectetur</strong> adipiscing elit. Vivamus sagittis nisi nec neque porta, a ornare ligula efficitur.",
"role": "Project manager",
},
{
"__typename": "BlockMarkup",
"markup": "
Expand Down Expand Up @@ -209,6 +226,13 @@ test('Blocks', async () => {
"text": null,
"url": null,
},
{
"__typename": "BlockQuote",
"author": "Jane Doe",
"image": null,
"quote": "In vitae diam quis odio tincidunt faucibus eget ut libero",
"role": null,
},
],
"hero": {
"__typename": "Hero",
Expand Down

0 comments on commit 63a9f6b

Please sign in to comment.