Repository navigation
Conversation
Replace the skipped findMany morph relation test with populated MANY_TO_ONE and ONE_TO_MANY cases, asserting both morph legs and their inverse relations.
|
🚀 Preview Environment Ready! Your preview environment is available at: https://configured-add-minolta-usual.trycloudflare.com This environment will automatically shut down after 5 hours. |
TODOs/FIXMEs:
|
Confidence Score: 5/5
[Low impact] This test-only PR appears safe to merge. SummaryReplaces the skipped morph-relation read suite with four populated integration tests.
Reviews (1) · Last reviewed commit: "Cover morph relation record reads in int..." · Reviewed by Greptile |
🤖 PR Review
🛡️ Security Review✅ No high-severity vulnerabilities detected. 🚦 Auto-approve✅ Eligible for auto-approval — low-complexity, no high-blast-radius paths.
Automated pre-review — human approval still required. |
🟡 Quality review · 1 finding
High-level — Test-only PR that re-enables the skipped morph-relation findMany integration suite with real records for MANY_TO_ONE and ONE_TO_MANY, reuses the existing createManyOperation/findManyOperationFactory/createMorphRelationBetweenObjects test utils, and has no product, architecture, build or deploy impact. 💬 1 inline comment on the diff. Reviewed against the |
| afterAll(async () => { | ||
| await deleteOneFieldMetadata({ | ||
| input: { idToDelete: morphFieldId }, | ||
| }).catch(() => {}); |
There was a problem hiding this comment.
🟡 Nit · Low-level · No silent failures or permissive fallbacks
The afterAll cleanup swallows every error from deleteOneFieldMetadata with .catch(() => {}), so a failed field deletion is silently ignored and can leave state behind without any signal.
Also on line 343.
CoreTeamTwenty
left a comment
There was a problem hiding this comment.
✅ Auto-approved — cleared automated quality and security review and is low-complexity.
- Quality: passed — 1 nit(s)
- Security: passed
- Auto-approve: passed — complexity low
Automated approval — a human still merges, and this is re-evaluated on every push.
Closes twentyhq/core-team-issues#1321
The
findMany morph relation recordsintegration test was skipped and never created records. This replaces it with populated cases for both relation directions, using objects created by the test itself so no seeder change is needed.owneron opportunity): each opportunity resolves the rightowner<Target>Idand nested target for both legs, the other leg isnull, an unowned record isnullon both, and each person/company lists its own opportunities through the inverse relation.stakeholderon opportunity): each opportunity's per-target connections return exactly its linked people and companies, and each person resolves back to its opportunity.Ran locally:
npx jest --config ./jest-integration.config.ts test/integration/metadata/suites/field-metadata/morph-relation/find-many-morph-relation-records.integration-spec.ts(4 passed).