Fixed a TS overload error in admin-x-framework tinybird tests#29079
Conversation
The AppProvider test wrapper passed `children` positionally to React.createElement, but AppProviderProps.children is required, not optional. TypeScript's createElement overload resolution can't reconcile a required children field supplied positionally, so tsc fails these test files. Moved children into the props object instead. This slipped through because CI scopes unit tests to Nx-affected projects, and nothing in admin-x-framework's dependency graph was touched by the @types/react catalog bump that started tripping this overload, so the project's test:unit target never re-ran to catch it.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughChangesThis change updates test wrapper code in two unit test files ( Sequence Diagram(s)Not applicable — this change is limited to test wrapper prop wiring and does not alter runtime call sequences. Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run @tryghost/admin-x-settings:test:acceptance |
✅ Succeeded | 11m 41s | View ↗ |
nx run-many --target=build --projects=tag:publi... |
✅ Succeeded | <1s | View ↗ |
nx run @tryghost/admin:build |
✅ Succeeded | 4m 11s | View ↗ |
nx run-many -t test:unit -p @tryghost/admin-x-f... |
✅ Succeeded | 3m 56s | View ↗ |
nx run ghost-admin:test |
✅ Succeeded | 2m 49s | View ↗ |
nx run-many -t lint -p @tryghost/admin-x-framew... |
✅ Succeeded | 1m 31s | View ↗ |
nx run @tryghost/activitypub:test:acceptance |
✅ Succeeded | 52s | View ↗ |
nx run ghost:build:assets |
✅ Succeeded | 2s | View ↗ |
nx run ghost:build:tsc |
✅ Succeeded | 6s | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-07-03 17:22:29 UTC

Summary
admin-x-framework'stest:typeswas failing onuse-tinybird-query.test.tsanduse-tinybird-token.test.tsx: the test wrapper passedchildrenpositionally toReact.createElement(AppProvider, {...}, children), butAppProviderProps.childrenis a required (non-optional) prop. TS'screateElement<P>overload resolution can't reconcile a positional child with a requiredchildrenfield inP, so it falls through to a stricter overload and errors.childreninto the props object at all three call sites.test:unitis scoped to Nx---affectedprojects, and nothing inadmin-x-framework's dependency graph was touched by the@types/reactcatalog bump that started tripping this overload, so the project'stest:types/test:unittarget never re-ran to surface it.Test plan
pnpm --filter @tryghost/shade --filter @tryghost/admin-x-design-system build(rebuild workspace deps)cd apps/admin-x-framework && pnpm test—tsc --noEmitclean, 30 test files / 436 tests passingpnpm lintinapps/admin-x-frameworkclean