fix(canvas/test): buildDeployMap check() — fix vacuous test assertion
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 11s
CI / Detect changes (pull_request) Successful in 21s
Harness Replays / detect-changes (pull_request) Successful in 12s
Lint curl status-code capture / Scan workflows for curl status-capture pollution (pull_request) Successful in 8s
E2E API Smoke Test / detect-changes (pull_request) Successful in 18s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 20s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 20s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 15s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 42s
qa-review / approved (pull_request) Failing after 14s
gate-check-v3 / gate-check (pull_request) Failing after 25s
sop-checklist / all-items-acked (pull_request) acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4
security-review / approved (pull_request) Failing after 9s
sop-checklist-gate / gate (pull_request) Successful in 9s
sop-tier-check / tier-check (pull_request) Successful in 10s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m7s
Lint pre-flip continue-on-error / Verify continue-on-error flips have run-log proof (pull_request) Successful in 1m21s
lint-continue-on-error-tracking / lint-continue-on-error-tracking (pull_request) Successful in 1m32s
lint-mask-pr-atomicity / lint-mask-pr-atomicity (pull_request) Successful in 1m29s
Lint workflow YAML (Gitea-1.22.6-hostile shapes) / Lint workflow YAML for Gitea-1.22.6-hostile shapes (pull_request) Successful in 1m29s
lint-required-context-exists-in-bp / lint-required-context-exists-in-bp (pull_request) Successful in 1m51s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 15s
Harness Replays / Harness Replays (pull_request) Successful in 5s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 7s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 1m43s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 5m10s
CI / Python Lint & Test (pull_request) Successful in 7m27s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 8m4s
CI / Platform (Go) (pull_request) Successful in 11m10s
CI / Canvas (Next.js) (pull_request) Successful in 12m35s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
CI / all-required (pull_request) Successful in 3s

The check() helper had two bugs:
1. Type mismatch: `expected: Partial<OrgDeployState>` but callers pass
   `{ id: "X", ...state }` — the `id` field was never accounted for.
2. `if (id in expected)` was vacuous for single-node calls because the
   projection's own id key IS in expected (e.g. id="a" in {id:"a", ...}),
   and silently did nothing for multi-node calls.

Fix: type expected as `Record<string, Partial<OrgDeployState>>` mapping
node-id → expected state. Loop over result.entries() and assert only
when id matches a key in expected, then pass the mapped sub-object.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-13 04:34:00 +00:00
parent ae318fae90
commit c30d5f9a34
@@ -47,16 +47,17 @@ function proj(
return { id, parentId, status };
}
// expected maps node-id → partial state (includes `id` as a key)
function check(
projections: Projection[],
deletingIds: string[],
expected: Partial<OrgDeployState>,
expected: Record<string, Partial<OrgDeployState>>,
): void {
const result = buildDeployMap(projections, new Set(deletingIds));
expect(result.size).toBe(projections.length);
for (const [id, state] of result.entries()) {
if (id in expected) {
expect(state).toMatchObject(expected);
expect(state).toMatchObject(expected[id]);
}
}
}