---
id: TST-MBR-STR-010
title: Tree workflow order and refusal decisions
kind: unit
product_area: membership
module: structure
revision: 1
status: draft
source_sha:
  services-membership: 5994c270e8a37a30f848e99ba5b5ee6b87c08893
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
repository: services-membership
files:
  - modules/structure/tests/unit/services/tree-edits.spec.ts
implements:
  - ATS-MBR-STR-002-03
  - ATS-MBR-STR-002-05
  - ATS-MBR-STR-002-06
  - ATS-MBR-STR-002-09
  - ATS-MBR-STR-002-10
  - ATS-MBR-STR-003-01
  - ATS-MBR-STR-003-05
  - ATS-MBR-STR-004-02
  - ATS-MBR-STR-004-05
environment: mock
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 1
isolation: Literal inputs and temporary fixtures created by this suite.
evidence:
  - 'services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts'
bindings:
  - scenario: ATS-MBR-STR-002-03
    source: >-
      services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits › move
      › refuses an inactive parent
    provenance: test
  - scenario: ATS-MBR-STR-002-05
    source: >-
      services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits › move
      › refuses a move that would put the subtree at the depth cap, before any write
    provenance: test
  - scenario: ATS-MBR-STR-002-05
    source: >-
      services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits › move
      › refuses the whole edit when the rebuilt tree reaches depth 32 (a cycle past validation)
    provenance: test
  - scenario: ATS-MBR-STR-002-06
    source: >-
      services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits › move
      › records the history from the tenant’s business date
    provenance: test
  - scenario: ATS-MBR-STR-002-09
    source: >-
      services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits › move
      › locks, validates against the current closure, changes the parent, records history, rebuilds,
      updates depths and checks the cap, in that order
    provenance: test
  - scenario: ATS-MBR-STR-002-10
    source: >-
      services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits › move
      › states membership.unit.reparented with the old and the new parent and the business date
    provenance: test
  - scenario: ATS-MBR-STR-002-10
    source: >-
      services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits › move
      › builds the reparented payload from the move and the transaction’s attribution
    provenance: test
  - scenario: ATS-MBR-STR-003-01
    source: >-
      services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits › merge
      › refuses a survivor below the merged unit
    provenance: test
  - scenario: ATS-MBR-STR-003-05
    source: >-
      services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits › merge
      › refuses the whole merge 409 affiliations_not_movable before any write when the plan refuses
    provenance: test
  - scenario: ATS-MBR-STR-004-02
    source: >-
      services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits ›
      delete › refuses 409 unit_has_affiliations while an affiliation names the unit, before deleting
    provenance: test
  - scenario: ATS-MBR-STR-004-05
    source: >-
      services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts#the tree edits ›
      delete › deletes a unit no affiliation and nothing else names
    provenance: test
invocation: 'npm run test:unit'
coverage_limit: >-
  Bindings identify the concrete cases executed in this file. A compound specification may also depend on
  other registered suites or remain partly proposed; registration is not a passing execution result.
provenance: test
source:
  - 'services-membership:modules/structure/tests/unit/services/tree-edits.spec.ts'
---

# Tree workflow order and refusal decisions

## Verification Boundary

This suite evaluates local implementation decisions or declarations with controlled inputs. Tree workflow order and refusal decisions defines the scope of its examples.

## What This Suite Proves

The suite executes the concrete examples named by its binding ledger. Those examples contribute to the linked capability or feature scenarios within the boundary of the test assertions.

## What It Does Not Prove

Registration supplies no fresh execution result or deployed conformance verdict. Browser behavior, deployed infrastructure and unasserted variants require separate evidence.

## Real Dependencies and Test Doubles

The tree workflow is real; a recording in-memory store and controlled execution context supply persistence and transaction observations.

## Must Not Be Doubled

The calculation, declaration or workflow decision under examination stays real; replacing it would remove the suite’s verification purpose.
