molecule-core/canvas/src
Molecule AI Core-FE ffd0729b8a test(canvas): add buildDeployMap coverage — 19 cases (#742 follow-up)
buildDeployMap is the pure tree-computation core inside useOrgDeployState.
Export it and add isolated tests covering:

  §1  Empty projections → empty map
  §2  Single node, no parent, non-provisioning → unlocked root
  §3  Single node, no parent, provisioning → deploying root
  §4  Single node with existing parent → non-root, unlocked
  §5  parentId points to absent node → treated as root
  §6  Root (non-provisioning) + child → both unlocked
  §7  Root (provisioning) + child → root deploying, child locked
  §8  Three-level tree: provisioning grandparent → parent → child
  §9  DeletingIds on non-root → isLockedChild=true
  §10 DeletingIds on root → root locked, child unlocked
  §11 Two independent roots, only one provisioning
  §12 Root with 2 provisioning descendants → count=2
  §13 Non-root with provisioning status → isActivelyProvisioning=true
  §14 Deep 5-level chain, no provisioning → all unlocked
  §15 Deleting + provisioning: deleting takes isLockedChild
  §16 Child of provisioning root → isLockedChild=true
  §17 Deep chain (5 levels), no provisioning → all unlocked
  §18 Deep chain, middle node provisioning → single deploying root
  §19 parentId → ghost parent → treated as root

Key insight from §18: findRoot walks the parent chain via byId only, so
a node's subtree root is determined by which parent in byId is absent.
A provisioning node nested deep in a tree contributes to its nearest
byId-ancestor's provCount, not its own.

Issue: #742 (buildDeployMap unit tests, #2071 follow-up).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-13 06:22:20 +00:00
..
__tests__ fix(canvas): include NEXT_PUBLIC_PLATFORM_URL in CSP connect-src 2026-04-20 12:55:03 -07:00
app fix(canvas/test): resolve ~80 test failures across 17 test files (#299) 2026-05-11 08:14:55 +00:00
components test(canvas): add buildDeployMap coverage — 19 cases (#742 follow-up) 2026-05-13 06:22:20 +00:00
hooks fix(deploy-modal): snap provider radio when model resolves to a provider 2026-05-02 19:01:13 -07:00
lib fix(canvas/test): use string keys in TIER_CONFIG toHaveProperty calls (#440) 2026-05-11 12:15:29 +00:00
store fix(canvas/test): resolve ~80 test failures across 17 test files (#299) 2026-05-11 08:14:55 +00:00
stores initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
styles fix(canvas/test): resolve ~80 test failures across 17 test files (#299) 2026-05-11 08:14:55 +00:00
types feat(canvas): audit trail visualization panel (issue #753) 2026-04-17 16:03:28 +00:00
middleware.ts feat(router): /cp/* reverse-proxy to CP + same-origin canvas fetches 2026-04-20 13:01:40 -07:00