[RJSFFormWrapper] Fix hideRootObjectTitle baseline assertion#1631
Conversation
The canonical import-design uiSchema already carries root label suppression, so the baseline test must remove that flag before asserting the default RJSF title. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: jamieplu <179417684+jamieplu@users.noreply.github.com>
There was a problem hiding this comment.
Code Review
This pull request updates the test suite in hideRootObjectTitle.test.tsx by introducing a helper to strip the label option from ui:options and updating a test case to use this modified schema. The reviewer identified a TypeScript compilation error where destructuring is performed on a variable of type object and provided a suggestion to cast it to Record<string, unknown>.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| return importDesignUiSchema; | ||
| } | ||
|
|
||
| const { label: _label, ...otherOptions } = existingOptions; |
There was a problem hiding this comment.
Destructuring properties from a variable of type object (which existingOptions is refined to after the typeof and Array.isArray checks) will cause a TypeScript compilation error because object has no known properties. Casting existingOptions to Record<string, unknown> (similar to how it is done in hideRootObjectTitle.ts) resolves this type-checking issue.
| const { label: _label, ...otherOptions } = existingOptions; | |
| const { label: _label, ...otherOptions } = existingOptions as Record<string, unknown>; |
There was a problem hiding this comment.
Pull request overview
This PR updates the hideRootObjectTitle test to account for the canonical importDesign uiSchema already suppressing the root label/title, by deriving a baseline uiSchema variant that removes only the root ui:options.label flag before asserting RJSF’s default root title behavior.
Changes:
- Add a
rootTitleVisibleUiSchemaderived from the canonical import-design uiSchema with root label suppression removed. - Update the baseline assertion to render with
rootTitleVisibleUiSchemainstead of the canonical uiSchema.
| const { label: _label, ...otherOptions } = existingOptions; | ||
| return { | ||
| ...importDesignUiSchema, | ||
| 'ui:options': otherOptions | ||
| }; |
Notes for Reviewers
This PR fixes the hideRootObjectTitle test regression caused by the canonical import-design uiSchema already carrying root label suppression. The baseline assertion now removes only that flag before verifying the default RJSF root title.
Signed commits