Skip to content

Commit

Permalink
test(gatsby): update integration test cases to use uuid's
Browse files Browse the repository at this point in the history
  • Loading branch information
pmelab committed Oct 25, 2023
1 parent 966bbeb commit 9343904
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ exports[`gatsby/Image.gql 1`] = `
"data": {
"loadImage": {
"__typename": "Image",
"id": "[numeric]:en",
"drupalId": "[numeric]",
"id": "fd3a7238-807a-483d-a703-c9b1b6b4a8e8:en",
"drupalId": "fd3a7238-807a-483d-a703-c9b1b6b4a8e8",
"langcode": "en",
"defaultTranslation": true,
"translations": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ exports[`gatsby/Webform.gql 1`] = `
"data": {
"loadWebform": {
"__typename": "Webform",
"id": "for_testing_confirmation_options",
"drupalId": "for_testing_confirmation_options",
"id": "452a69f0-cade-443f-8ba6-46b5fe92cedd",
"drupalId": "452a69f0-cade-443f-8ba6-46b5fe92cedd",
"url": "http://127.0.0.1:8888/en/form/for-testing-confirmation-options",
"title": "For testing confirmation options",
"path": "/en/form/for-testing-confirmation-options"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ exports[`gatsby/content/Article.gql 1`] = `
"data": {
"complete": {
"__typename": "Article",
"id": "[numeric]:en",
"drupalId": "[numeric]",
"id": "c997198a-a4a5-484a-8567-46ca6a24301a:en",
"drupalId": "c997198a-a4a5-484a-8567-46ca6a24301a",
"title": "With everything",
"langcode": "en",
"body": "<p><strong>Article</strong> <em>body</em>.</p>\\n\\n<p>Pug is embedded 👇 </p>\\n\\n<article class=\\"media media--type-image media--view-mode-default\\" data-align=\\"center\\"><div class=\\"field field--name-field-media-image field--type-image field--label-visually_hidden\\">\\n <div class=\\"field__label visually-hidden\\">Image</div>\\n <div class=\\"field__item\\"> <img loading=\\"lazy\\" src=\\"/sites/default/files/2021-01/image_jpg_pug.jpg\\" width=\\"1920\\" height=\\"1080\\" alt=\\"Pug alt text\\" /></div>\\n </div>\\n\\n </article><p>Kitten goes in a separate field 👉</p>\\n",
"image": {
"id": "[numeric]:en"
"id": "fd3a7238-807a-483d-a703-c9b1b6b4a8e8:en"
},
"tags": [
{
"id": "[numeric]"
"id": "cfc1e9c7-3fb8-43a9-982a-756d72dc4f86"
},
{
"id": "[numeric]"
"id": "5abb8be2-d3ab-44ea-8dc1-dfdbaf02c08f"
}
],
"defaultTranslation": true,
Expand All @@ -44,8 +44,8 @@ exports[`gatsby/content/Article.gql 1`] = `
},
"minimal": {
"__typename": "Article",
"id": "[numeric]:en",
"drupalId": "[numeric]",
"id": "80b65cc6-5f5f-4113-a52b-c00d3bd0bfe9:en",
"drupalId": "80b65cc6-5f5f-4113-a52b-c00d3bd0bfe9",
"title": "Other article",
"langcode": "en",
"body": null,
Expand Down Expand Up @@ -74,20 +74,20 @@ exports[`gatsby/content/Article.gql 1`] = `
"data": {
"complete": {
"__typename": "Article",
"id": "[numeric]:en",
"drupalId": "[numeric]",
"id": "c997198a-a4a5-484a-8567-46ca6a24301a:en",
"drupalId": "c997198a-a4a5-484a-8567-46ca6a24301a",
"title": "With everything",
"langcode": "en",
"body": "<p><strong>Article</strong> <em>body</em>.</p>\\n\\n<p>Pug is embedded 👇 </p>\\n\\n<article class=\\"media media--type-image media--view-mode-default\\" data-align=\\"center\\"><div class=\\"field field--name-field-media-image field--type-image field--label-visually_hidden\\">\\n <div class=\\"field__label visually-hidden\\">Image</div>\\n <div class=\\"field__item\\"> <img loading=\\"lazy\\" src=\\"/sites/default/files/2021-01/image_jpg_pug.jpg\\" width=\\"1920\\" height=\\"1080\\" alt=\\"Pug alt text\\" /></div>\\n </div>\\n\\n </article><p>Kitten goes in a separate field 👉</p>\\n",
"image": {
"id": "[numeric]:en"
"id": "fd3a7238-807a-483d-a703-c9b1b6b4a8e8:en"
},
"tags": [
{
"id": "[numeric]"
"id": "cfc1e9c7-3fb8-43a9-982a-756d72dc4f86"
},
{
"id": "[numeric]"
"id": "5abb8be2-d3ab-44ea-8dc1-dfdbaf02c08f"
}
],
"defaultTranslation": true,
Expand All @@ -110,8 +110,8 @@ exports[`gatsby/content/Article.gql 1`] = `
},
"minimal": {
"__typename": "Article",
"id": "[numeric]:en",
"drupalId": "[numeric]",
"id": "80b65cc6-5f5f-4113-a52b-c00d3bd0bfe9:en",
"drupalId": "80b65cc6-5f5f-4113-a52b-c00d3bd0bfe9",
"title": "Other article",
"langcode": "en",
"body": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ exports[`gatsby/content/GutenbergPage.gql 1`] = `
"data": {
"complete": {
"__typename": "GutenbergPage",
"id": "[numeric]:en",
"drupalId": "[numeric]",
"id": "f9778402-1375-4bc0-a550-00610ad3865d:en",
"drupalId": "f9778402-1375-4bc0-a550-00610ad3865d",
"title": "Gutenberg page",
"langcode": "en",
"body": [
Expand Down Expand Up @@ -42,7 +42,7 @@ exports[`gatsby/content/GutenbergPage.gql 1`] = `
{
"__typename": "BlockTeaser",
"image": {
"id": "[numeric]:en"
"id": "378fdfc0-05fa-4d50-aaed-3342cd5f844c:en"
},
"title": "Teaser",
"subtitle": "on left"
Expand All @@ -55,7 +55,7 @@ exports[`gatsby/content/GutenbergPage.gql 1`] = `
{
"__typename": "BlockImage",
"image": {
"id": "[numeric]:en"
"id": "fd3a7238-807a-483d-a703-c9b1b6b4a8e8:en"
},
"caption": "Just media on right"
},
Expand All @@ -79,8 +79,8 @@ exports[`gatsby/content/GutenbergPage.gql 1`] = `
},
"minimal": {
"__typename": "GutenbergPage",
"id": "[numeric]:en",
"drupalId": "[numeric]",
"id": "af2bb5e4-237a-4e76-befe-e7a3d8dc699c:en",
"drupalId": "af2bb5e4-237a-4e76-befe-e7a3d8dc699c",
"title": "Empty Gutenberg page",
"langcode": "en",
"body": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ exports[`gatsby/content/Page.gql 1`] = `
"data": {
"basic": {
"__typename": "Page",
"id": "[numeric]:en",
"drupalId": "[numeric]",
"id": "a38bce61-3640-4799-bacf-18ccc6e74216:en",
"drupalId": "a38bce61-3640-4799-bacf-18ccc6e74216",
"title": "A page",
"langcode": "en",
"body": "<p>Some text.</p>\\n",
Expand All @@ -29,8 +29,8 @@ exports[`gatsby/content/Page.gql 1`] = `
},
"references": {
"__typename": "Page",
"id": "[numeric]:en",
"drupalId": "[numeric]",
"id": "bb230ced-eb4d-495f-9571-50a7f6f69e67:en",
"drupalId": "bb230ced-eb4d-495f-9571-50a7f6f69e67",
"title": "Page with paragraphs",
"langcode": "en",
"body": null,
Expand All @@ -50,14 +50,14 @@ exports[`gatsby/content/Page.gql 1`] = `
{
"__typename": "ParagraphReferences",
"singleReference": {
"id": "[numeric]:en"
"id": "af2bb5e4-237a-4e76-befe-e7a3d8dc699c:en"
},
"references": [
{
"id": "[numeric]:en"
"id": "7702e639-4704-4599-a8b5-a65d88c61ea3:en"
},
{
"id": "[numeric]:en"
"id": "80b65cc6-5f5f-4113-a52b-c00d3bd0bfe9:en"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Tag @entity(type: "taxonomy_term", bundle: "tag") {
}

type Page @entity(type: "node", bundle: "page") {
id: String! @resolveEntityId
id: String! @resolveEntityUuid
path: String! @isPath @resolveEntityPath
title: String! @resolveProperty(path: "title.value")
body: String @resolveProperty(path: "field_body.0.processed")
Expand Down
2 changes: 1 addition & 1 deletion apps/silverback-gatsby/src/pages/custom-schema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const query = graphql`
id
title
}
page(id: "Page:2:en") {
page(id: "Page:a38bce61-3640-4799-bacf-18ccc6e74216:en") {
title
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ test('templates', async ({ page }) => {

test('@gatsby-both drupal custom schema', async ({ page }) => {
await page.goto(`${gatsby.baseUrl}/custom-schema`);
await expect(page.locator('p:text-is("A page (Page:2:en)")')).toBeVisible();
await expect(
page.locator(
'p:text-is("A page (Page:a38bce61-3640-4799-bacf-18ccc6e74216:en)")',
),
).toBeVisible();
await expect(page.locator('p:text-is("Load: A page")')).toBeVisible();
});

0 comments on commit 9343904

Please sign in to comment.