2026-09-02 16:17:55 +01:00
|
|
|
import robots from '@/app/robots';
|
|
|
|
|
|
|
|
|
|
describe('robots.txt', () => {
|
|
|
|
|
it('disallows the admin panel and the CMS API', () => {
|
|
|
|
|
const rules = robots().rules;
|
|
|
|
|
const rule = Array.isArray(rules) ? rules[0] : rules;
|
|
|
|
|
expect(rule.disallow).toEqual(
|
|
|
|
|
expect.arrayContaining(['/api/', '/_next/', '/admin/', '/cms-api/']),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
});
|
2026-09-02 16:28:58 +01:00
|
|
|
|
|
|
|
|
describe('sitemap discovery', () => {
|
|
|
|
|
it('lists both the proxied school sitemap and the Next-owned content sitemap', () => {
|
|
|
|
|
expect(robots().sitemap).toEqual([
|
|
|
|
|
'https://www.schoolcompare.co.uk/sitemap.xml',
|
|
|
|
|
'https://www.schoolcompare.co.uk/content-sitemap.xml',
|
|
|
|
|
]);
|
|
|
|
|
});
|
|
|
|
|
});
|