Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshinorin committed Jan 23, 2024
1 parent bc20ff5 commit c2a594c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions __tests__/e2e/articles/redirect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ test.describe('Article - Redirect', () => {
await expect(page.locator('meta[property="og:site_name"]')).toHaveAttribute('content', 'E2E Test Site');
await expect(page.locator('meta[property="og:locale"]')).toHaveAttribute('content', 'ja_JP');
await expect(page.locator('meta[property="og:image"]')).toHaveAttribute('content', 'defaultImage.jpg');
await expect(page.locator('meta[name="injectedMetaName"]')).toHaveAttribute('content', 'injectedMetaContent');
await expect(page.locator('meta[name="robots"]')).toHaveAttribute('content', 'noarchive, nofollow, noimageindex, noindex');
await expect(page.locator('meta[name="injectedMetaName"]')).toHaveAttribute('content', 'http://localhost:3000/defaultImage.jpg');

await expect(page.locator('meta[name="description"]')).toHaveAttribute('content', 'Proin tellus nibh, pretium vitae bibendum in, tempus nec odio...');
await expect(page.locator('meta[property="og:description"]')).toHaveAttribute('content', 'Proin tellus nibh, pretium vitae bibendum in, tempus nec odio...');

const robots = await page.locator('meta[name="robots"]').getAttribute('content');
const sortedRobots = robots.split(',').sort().map(r => r.trim());
expect(sortedRobots.join(', ')).toBe('noarchive, nofollow, noimageindex, noindex');

// TODO: assert content value
await expect(page.locator('meta[property="article:published_time"]')).toHaveAttribute('content');
await expect(page.locator('meta[property="article:modified_time"]')).toHaveAttribute('content');
Expand Down

0 comments on commit c2a594c

Please sign in to comment.