Background
TeaQLRuntime.mergeRelatedEntityRoots recursively merges independently tracked entities into the aggregate root before persistence. Both to-one and collection relations need direct protection.
Scope
Add focused runtime tests using small parent/child entity fixtures and relation metadata. Ledger ordering is tracked separately.
Test cases
- A to-one related entity's changes are merged into the parent root.
- Each entity in a collection relation is merged into the parent root.
- Related entities are rebound to the parent root after merging.
- Nested relations are traversed recursively.
- An entity already sharing the target root is not merged twice.
- Missing descriptors and non-relation properties do not cause failures.
Acceptance criteria
- Tests verify observable mutation requests and shared-root identity.
- Tests do not invoke a real database.
- Parent, child, and nested-child fixtures are kept minimal and local to the test.
Background
TeaQLRuntime.mergeRelatedEntityRootsrecursively merges independently tracked entities into the aggregate root before persistence. Both to-one and collection relations need direct protection.Scope
Add focused runtime tests using small parent/child entity fixtures and relation metadata. Ledger ordering is tracked separately.
Test cases
Acceptance criteria