Skip to content

Commit

Permalink
Merge pull request #2483 from pdcp1/fix/twitter-share
Browse files Browse the repository at this point in the history
Fix Twitter share
  • Loading branch information
kepae authored Dec 11, 2023
2 parents 45b36f3 + ac37344 commit e2d3e3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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');
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion site/gatsby-site/src/components/blog/PrismicBlogPost.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit e2d3e3f

Please sign in to comment.