Implement public audit pages

This commit is contained in:
Matthias
2026-06-05 14:14:07 +02:00
parent 03cb65fde4
commit 47ee2c2d51
25 changed files with 1039 additions and 45 deletions

View File

@@ -99,6 +99,41 @@ test("pageSpeedAction starts and finishes run mutations", () => {
);
});
test("pageSpeedAction queues audit generation after PageSpeed completion", () => {
assert.equal(
hasPattern(actionSource, /internal\.auditGeneration\.queueLeadAuditGeneration/),
true,
"Action should call internal.auditGeneration.queueLeadAuditGeneration after PageSpeed work.",
);
assert.equal(
hasPattern(
actionSource,
/queueAuditGenerationAfterPageSpeed\(\s*ctx,\s*args\.runId,\s*started\s*\)/,
),
true,
"Action should route PageSpeed completion through a shared audit-generation handoff helper.",
);
assert.equal(
hasPattern(
actionSource,
/queueAuditGenerationAfterPageSpeed[\s\S]*leadId:\s*started\.lead\._id[\s\S]*parentRunId:\s*runId/,
),
true,
"The handoff should queue audit generation for the same lead and parent PageSpeed run.",
);
assert.equal(
hasPattern(
actionSource,
/catch \(auditQueueError\)[\s\S]*Audit-Generierung konnte nicht in die Warteschlange gesetzt werden/,
),
true,
"Audit-generation queue failures should be logged without failing PageSpeed completion.",
);
});
test("pageSpeedAction has action-level guard to fail whole run on unexpected errors", () => {
assert.equal(
hasPattern(