[object Object]

← back to NationalPaperHangers

tests: e2e-business-invariants — sitemap.xml + robots.txt regression checks (528 URLs, ref to sitemap, /admin Disallow). 41 prod assertions

8efbbdb513d8b82bee0b3a6e717302870cb9b681 · 2026-05-07 08:44:52 -0700 · Steve

Files touched

Diff

commit 8efbbdb513d8b82bee0b3a6e717302870cb9b681
Author: Steve <steve@designerwallcoverings.com>
Date:   Thu May 7 08:44:52 2026 -0700

    tests: e2e-business-invariants — sitemap.xml + robots.txt regression checks (528 URLs, ref to sitemap, /admin Disallow). 41 prod assertions
---
 tests/e2e-business-invariants.js | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/tests/e2e-business-invariants.js b/tests/e2e-business-invariants.js
index d8bedde..ab6c344 100644
--- a/tests/e2e-business-invariants.js
+++ b/tests/e2e-business-invariants.js
@@ -99,8 +99,25 @@ function findChromium() {
       assert(!!twUrl && /^https?:\/\//.test(twUrl), `${path} has twitter:image`);
     }
 
-    // ─── Invariant 6 · privacy + terms have correct DW-disclaimer text ────
-    console.log(`\n[invariant 6] privacy + terms include the referral-service disclaimer`);
+    // ─── Invariant 6 · sitemap.xml + robots.txt are healthy ──────────────
+    // Sitemap should include all studio profiles + the static pages.
+    // robots.txt should reference the sitemap and Disallow private paths.
+    console.log(`\n[invariant 6] sitemap.xml + robots.txt`);
+    const robotsResp = await page.goto(`${BASE}/robots.txt`, { waitUntil: 'domcontentloaded', timeout: 8000 });
+    assert(robotsResp && robotsResp.status() === 200, '/robots.txt → 200');
+    const robotsBody = await page.content();
+    assert(/Sitemap:.*sitemap\.xml/i.test(robotsBody), 'robots.txt references sitemap');
+    assert(/Disallow:\s*\/admin/i.test(robotsBody), 'robots.txt disallows /admin');
+
+    const smapResp = await page.goto(`${BASE}/sitemap.xml`, { waitUntil: 'domcontentloaded', timeout: 12000 });
+    assert(smapResp && smapResp.status() === 200, '/sitemap.xml → 200');
+    const smapBody = await page.content();
+    const urlCount = (smapBody.match(/<loc>/g) || []).length;
+    assert(urlCount > 100, `sitemap has > 100 URLs (got ${urlCount})`);
+    assert(/\/installer\//i.test(smapBody), 'sitemap includes installer profiles');
+
+    // ─── Invariant 7 · privacy + terms have correct DW-disclaimer text ────
+    console.log(`\n[invariant 7] privacy + terms include the referral-service disclaimer`);
     for (const path of ['/privacy', '/terms']) {
       await page.goto(`${BASE}${path}`, { waitUntil: 'domcontentloaded', timeout: 12000 });
       const html = await page.content();

← 442cc6c og: add og:image + twitter:image to every page (default bran  ·  back to NationalPaperHangers  ·  tighten .gitignore: add missing standing-rule patterns (buil ab11e6e →