Release govoplan-campaign v0.1.28: stabilize saving, review and delivery recovery
Module Package Release / publish-packages (push) Successful in 12s
Module Package Release / publish-packages (push) Successful in 12s
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import { calculateBuildReviewProgress } from "../src/features/campaigns/review/reviewProgress.ts";
|
||||
import { attachmentDeliveryPreflight, calculateBuildReviewProgress } from "../src/features/campaigns/review/reviewProgress.ts";
|
||||
|
||||
test("separates blocking, individual, and group review work", () => {
|
||||
assert.deepEqual(calculateBuildReviewProgress({
|
||||
@@ -52,3 +52,23 @@ test("normalizes malformed counters without overstating progress", () => {
|
||||
assert.equal(progress.required, 2);
|
||||
assert.equal(progress.remaining, 0);
|
||||
});
|
||||
|
||||
const acceptedAttachments = { migrationRequired: false, hasBuild: true, reviewLoaded: true,
|
||||
blocking: 0, remaining: 0, inspectionComplete: true, missing: 14, ambiguous: 0 };
|
||||
|
||||
test("fourteen accepted missing matches do not ask again at final delivery preflight", () => {
|
||||
assert.equal(attachmentDeliveryPreflight(acceptedAttachments).state, "ready");
|
||||
assert.equal(attachmentDeliveryPreflight({ ...acceptedAttachments, inspectionComplete: false }).state, "ready");
|
||||
});
|
||||
|
||||
test("expected policy omissions need no acceptance and pending review is not a hard attachment blocker", () => {
|
||||
assert.equal(attachmentDeliveryPreflight({ ...acceptedAttachments, inspectionComplete: false, remaining: 0 }).state, "ready");
|
||||
assert.equal(attachmentDeliveryPreflight({ ...acceptedAttachments, inspectionComplete: false, remaining: 14 }).state, "warning");
|
||||
});
|
||||
|
||||
test("saved review cannot override real blockers, missing build evidence or legacy Mail migration", () => {
|
||||
assert.equal(attachmentDeliveryPreflight({ ...acceptedAttachments, blocking: 1 }).state, "blocked");
|
||||
assert.equal(attachmentDeliveryPreflight({ ...acceptedAttachments, migrationRequired: true }).state, "blocked");
|
||||
assert.equal(attachmentDeliveryPreflight({ ...acceptedAttachments, reviewLoaded: false }).state, "info");
|
||||
assert.equal(attachmentDeliveryPreflight({ ...acceptedAttachments, hasBuild: false }).state, "info");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user