-
Notifications
You must be signed in to change notification settings - Fork 0
Fix Storybook tests by providing SchemaRendererContext #259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Storybook tests by providing SchemaRendererContext #259
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
b754c2a
into
copilot/update-crm-app-to-msw-mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes failing Storybook tests for the page and object-grid JSON stories by ensuring the runtime schema context is provided via SchemaRendererProvider from @object-ui/react, matching patterns used in other stories.
Changes:
- Updated
page.stories.tsxandobject-grid.stories.tsxto importSchemaRendererandSchemaRendererProviderfrom@object-ui/reactinstead of the localSchemaRenderer. - Wrapped the stories’ render functions in
SchemaRendererProviderwith adataSourceprop (an empty object), so nested components that calluseDataScope()/useSchemaContext()no longer throw.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
packages/components/src/stories-json/page.stories.tsx |
Switches to the @object-ui/react SchemaRenderer and wraps it in SchemaRendererProvider to provide context for nested components like data-table. |
packages/components/src/stories-json/object-grid.stories.tsx |
Uses SchemaRenderer/SchemaRendererProvider from @object-ui/react and wraps the shared renderStory helper so object-grid stories run under a proper schema context. |
|
✅ All checks passed!
|
Storybook tests for
object-gridandpagecomponents were failing because they used the localSchemaRendererwhich doesn't provide context, but their child components (ObjectGrid,data-table) calluseDataScope()→useSchemaContext().Changes
Updated imports in affected stories:
Wrapped renderers with provider:
Files modified:
packages/components/src/stories-json/object-grid.stories.tsxpackages/components/src/stories-json/page.stories.tsxThis follows the pattern already established in
packages/components/src/stories/MockedData.stories.tsxandCRMApp.stories.tsx.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.