From 9571d3483f05ec34015d1571fcfd9aa26e17b02f Mon Sep 17 00:00:00 2001 From: Pablo Costa Date: Mon, 11 Dec 2023 17:57:05 -0300 Subject: [PATCH 1/2] Fix `metatitle` for Blog posts --- site/gatsby-site/src/components/blog/PrismicBlogPost.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/gatsby-site/src/components/blog/PrismicBlogPost.js b/site/gatsby-site/src/components/blog/PrismicBlogPost.js index f1be929965..8d1804a9f4 100644 --- a/site/gatsby-site/src/components/blog/PrismicBlogPost.js +++ b/site/gatsby-site/src/components/blog/PrismicBlogPost.js @@ -12,7 +12,7 @@ import Outline from 'components/Outline'; import AiidHelmet from 'components/AiidHelmet'; const PrismicBlogPost = ({ post, location }) => { - const metaTitle = post.data.metaTitle; + const metaTitle = post.data.metatitle; const metaDescription = post.data.metaDescription; From ac373445bbc7728f973080bd1d28cbf3fcbaa099 Mon Sep 17 00:00:00 2001 From: Pablo Costa Date: Mon, 11 Dec 2023 18:26:21 -0300 Subject: [PATCH 2/2] Fix Twitter share tests --- .../cypress/e2e/integration/socialShareButtons.cy.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/site/gatsby-site/cypress/e2e/integration/socialShareButtons.cy.js b/site/gatsby-site/cypress/e2e/integration/socialShareButtons.cy.js index b87fb574d7..86fb4e050e 100644 --- a/site/gatsby-site/cypress/e2e/integration/socialShareButtons.cy.js +++ b/site/gatsby-site/cypress/e2e/integration/socialShareButtons.cy.js @@ -26,7 +26,7 @@ describe('Social Share buttons on pages', { retries: { runMode: 4 } }, () => { }); } - urlsToTest.forEach(({ page, url, shareButtonSections }) => { + urlsToTest.forEach(({ page, url, title, shareButtonSections }) => { it(`${page} page should have ${shareButtonSections} Social Share button sections`, () => { cy.visit(url); @@ -38,8 +38,7 @@ describe('Social Share buttons on pages', { retries: { runMode: 4 } }, () => { const canonicalUrl = `https://incidentdatabase.ai${url}`; // Twitter share - // TODO: https://github.com/responsible-ai-collaborative/aiid/issues/2481 - it.skip(`${page} page should have a Twitter share button`, () => { + it(`${page} page should have a Twitter share button`, () => { cy.visit(url); cy.get('[data-cy=btn-share-twitter]').should('exist'); @@ -57,9 +56,8 @@ describe('Social Share buttons on pages', { retries: { runMode: 4 } }, () => { cy.get('@popup_twitter', { timeout: 8000 }).should('be.called'); cy.url().should( 'contain', - `https://twitter.com/i/flow/login?redirect_after_login=%2Fintent%2Ftweet%3Ftext%3D` + `https://twitter.com/intent/tweet?text=${encodeURI(title)}&url=${canonicalUrl}` ); - cy.url().should('contain', `url%3D${encodeURIComponent(canonicalUrl)}`); }); // LinkedIn share