Skip to content

Commit

Permalink
test: add test for rss feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanprobst committed May 5, 2024
1 parent efef703 commit 9ba0494
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions e2e/tests/app/metadata.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,24 @@ test("should serve an open-graph image", async ({ page, request }) => {
expect(contentType).toBe("image/png");
}
});

test("should have links to rss feeds", async ({ page }) => {
await page.goto("/en");

const feeds = page.locator('link[rel="alternate"][type="application/rss+xml"]');
const hrefs = await feeds.evaluateAll((elements) => {
return elements.map((element) => {
return (element as HTMLLinkElement).href;
});
});

expect(hrefs).toEqual(
expect.arrayContaining(
locales.map((locale) => {
return String(
createUrl({ baseUrl: env.NEXT_PUBLIC_APP_BASE_URL, pathname: `/${locale}/rss.xml` }),
);
}),
),
);
});

0 comments on commit 9ba0494

Please sign in to comment.