Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions e2e/robots.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { expect, test } from '@playwright/test';

import { E2E_BASE_URL } from './support/e2eConfig';
import { PRODUCTION_SITE_ORIGIN } from './support/siteContracts';

test('robots.txt allows crawling and advertises the sitemap', async ({
request,
}) => {
const response = await request.get(`${E2E_BASE_URL}/robots.txt`);

expect(response.ok()).toBe(true);

const robots = await response.text();

expect(robots).toContain('User-agent: *');
expect(robots).toContain('Allow: /');
expect(robots).toContain(`Sitemap: ${PRODUCTION_SITE_ORIGIN}/sitemap.xml`);
});
2 changes: 2 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
User-agent: *
Allow: /

Sitemap: https://piech.dev/sitemap.xml
Loading