Skip to content

Commit

Permalink
use base url in metadata images
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrodri committed Apr 4, 2024
1 parent f5ea2fc commit ee78295
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/disconnected/homepage/metadata.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, expect } from "@playwright/test";

test('homepage metadata', async ({ page }) => {
test('homepage metadata', async ({ page, baseURL }) => {
await page.goto('/');

// TODO: frh -> WIP this should be automatically get from multitenancy and check better what each tag is for
Expand All @@ -21,7 +21,7 @@ test('homepage metadata', async ({ page }) => {
await expect(twitterDescription).toBe('Home of token house governance and RPGF');

const twitterImage = await page.locator('meta[name="twitter\\:image"]').first().getAttribute('content');
await expect(twitterImage).toBe('http://localhost:3000/api/images/og/proposals?title=Optimism%20Agora&description=Home%20of%20token%20house%20governance%20and%20RPGF');
await expect(twitterImage).toBe(`${baseURL}/api/images/og/proposals?title=Optimism%20Agora&description=Home%20of%20token%20house%20governance%20and%20RPGF`);

const twitterImageWidth = await page.locator('meta[name="twitter\\:image\\:width"]').first().getAttribute('content');
await expect(twitterImageWidth).toBe('1200');
Expand All @@ -37,7 +37,7 @@ test('homepage metadata', async ({ page }) => {
await expect(ogDescription).toBe('Home of token house governance and RPGF');

const ogImage = await page.locator('meta[property="og\\:image"]').getAttribute('content');
await expect(ogImage).toBe('http://localhost:3000/api/images/og/proposals?title=Optimism%20Agora&description=Home%20of%20token%20house%20governance%20and%20RPGF');
await expect(ogImage).toBe(`${baseURL}/api/images/og/proposals?title=Optimism%20Agora&description=Home%20of%20token%20house%20governance%20and%20RPGF`);

const ogImageWidth = await page.locator('meta[property="og\\:image\\:width"]').getAttribute('content');
await expect(ogImageWidth).toBe('1200');
Expand Down

0 comments on commit ee78295

Please sign in to comment.