Implement public audit pages
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user