Integrate Prisma for content; enhance SEO, i18n, and deployment workflows
Co-authored-by: dennis <dennis@konkol.net>
This commit is contained in:
22
e2e/seo.spec.ts
Normal file
22
e2e/seo.spec.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { test, expect } from "@playwright/test";
|
||||
|
||||
test.describe("SEO endpoints", () => {
|
||||
test("robots.txt is served and contains sitemap", async ({ request }) => {
|
||||
const res = await request.get("/robots.txt");
|
||||
expect(res.ok()).toBeTruthy();
|
||||
const txt = await res.text();
|
||||
expect(txt).toContain("User-agent:");
|
||||
expect(txt).toContain("Sitemap:");
|
||||
});
|
||||
|
||||
test("sitemap.xml is served and contains locale routes", async ({ request }) => {
|
||||
const res = await request.get("/sitemap.xml");
|
||||
expect(res.ok()).toBeTruthy();
|
||||
const xml = await res.text();
|
||||
expect(xml).toContain('<urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9">');
|
||||
// At least the localized home routes should exist
|
||||
expect(xml).toMatch(/\/en<\/loc>/);
|
||||
expect(xml).toMatch(/\/de<\/loc>/);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user