الاختبارات
2,489
مجموع النجاح المثبّت في اللقطة
تدقيق الحدود
1,915 ملفًا
0 مخالفة
عقد الوثائق
140 / 91 / 34
مُنفّذ / مستثنى بسبب / وثائق مغطّاة
diff --git a/scripts/build-trust-center.mjs b/scripts/build-trust-center.mjs
index f7215e0f..265c2e1e 100644
--- a/scripts/build-trust-center.mjs
+++ b/scripts/build-trust-center.mjs
@@ -173,7 +173,7 @@ footer{margin-top:44px;border-top:1px solid var(--line);padding-top:16px;color:v
+
${kpis}
${esc(T.claimsTitle)}
${T.claimHead.map((h) => `| ${esc(h)} | `).join("")}
${claims}
${esc(T.statusNote)}
diff --git a/scripts/smoke-pages.mjs b/scripts/smoke-pages.mjs
index 4245cb0c..478d07cc 100644
--- a/scripts/smoke-pages.mjs
+++ b/scripts/smoke-pages.mjs
@@ -18,8 +18,19 @@ const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..");
export function checkPage({ url, status, body, expectedTotal }) {
const errors = [];
if (status !== 200) errors.push(`${url}: HTTP ${status}`);
- if (!/
[^<]*CoreGuard/i.test(body)) errors.push(`${url}: title does not name CoreGuard`);
if (/\?\?\?/.test(body)) errors.push(`${url}: contains a ??? run (encoding damage)`);
+ if (url.endsWith(".json")) {
+ try {
+ const data = JSON.parse(body);
+ if (expectedTotal && data.testsTotal !== expectedTotal) {
+ errors.push(`${url}: testsTotal ${data.testsTotal} != ${expectedTotal}`);
+ }
+ } catch {
+ errors.push(`${url}: invalid JSON`);
+ }
+ return errors;
+ }
+ if (!/[^<]*CoreGuard/i.test(body)) errors.push(`${url}: title does not name CoreGuard`);
if (url.endsWith("/NUMBERS.html") && expectedTotal && !body.includes(String(expectedTotal))) {
errors.push(`${url}: does not state the snapshot total ${expectedTotal}`);
}
diff --git a/test/ci/smoke-pages.test.js b/test/ci/smoke-pages.test.js
index 03a9d858..35f8a84e 100644
--- a/test/ci/smoke-pages.test.js
+++ b/test/ci/smoke-pages.test.js
@@ -4,6 +4,10 @@ import { checkPage } from "../../scripts/smoke-pages.mjs";
test("Pages smoke: a good page passes", () => {
assert.deepEqual(checkPage({ url: "https://x/", status: 200, body: "CoreGuard", expectedTotal: 2470 }), []);
+ const json = JSON.stringify({ testsTotal: 2470 });
+ assert.deepEqual(checkPage({ url: "https://x/state-snapshot.json", status: 200, body: json, expectedTotal: 2470 }), []);
+ assert.match(checkPage({ url: "https://x/state-snapshot.json", status: 200, body: "{}", expectedTotal: 2470 })[0], /testsTotal/);
+ assert.match(checkPage({ url: "https://x/state-snapshot.json", status: 200, body: "{", expectedTotal: 2470 })[0], /invalid JSON/);
});
test("Pages smoke: negative controls — status, title, encoding, total and mirror link bite", () => {