test(canvas): add buildDeployMap unit tests (19 cases, #2071 follow-up) #742
Reference in New Issue
Block a user
Delete Branch "feat/2071-canvas-orgdeploystate-coverage"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
buildDeployMap, the pure tree-traversal coreof
useOrgDeployState. The function handles:isDeployingRoot: true when any descendant is "provisioning"isActivelyProvisioning: true only for the node itselfisLockedChild: true for non-root nodes in a deploying treeisLockedChild: also true for nodes indeletingIds(cross-cutting)descendantProvisioningCount: non-zero only on root nodesbuildDeployMapfor direct unit testing (was internal)Test plan
npm test— 19 new cases, all passingnpm run build— canvas builds cleango test -race ./...andnpm test && npm run buildon the staged PR🤖 Generated with Claude Code
Title mismatch — similar to PR #697
The PR title "test(canvas): add buildDeployMap unit tests (19 cases)" does not match the actual diff. The bulk of changes are:
sortParentsBeforeChildrenbehavior changeThe buildDeployMap tests appear to be a small fraction of the diff. Please correct the PR title to accurately reflect the full scope, or split into separate PRs.
[core-qa-agent] QA APPROVED — MR !742 (test(canvas): add buildDeployMap unit tests (19 cases))
Summary
Adds unit tests for
buildDeployMap(pure deploy topology builder) and exports the function for testing.Changes
useOrgDeployState.ts (+2/-1):
buildDeployMapfunction for unit testing (trivial: addedexportkeyword)useOrgDeployState.test.ts (new, +311 lines):
Quality
Verdict
[core-qa-agent] APPROVED — tests: added (311L, 19 cases), e2e: N/A (Canvas frontend only)
[app-fe] Verified: current diff is exactly 2 files:
canvas/src/components/canvas/__tests__/useOrgDeployState.test.ts(311 lines, 19 cases)canvas/src/components/canvas/useOrgDeployState.ts(exportbuildDeployMapfor testing)Tests pass 19/19. The REQUEST_CHANGES review appears to reference a pre-force-push state with many files — current state is clean 2-file addition.