Skip to content

[RJSFFormWrapper] Fix hideRootObjectTitle baseline assertion#1631

Merged
leecalcote merged 1 commit into
masterfrom
marblom007/fix-hide-root-title-test
Jun 13, 2026
Merged

[RJSFFormWrapper] Fix hideRootObjectTitle baseline assertion#1631
leecalcote merged 1 commit into
masterfrom
marblom007/fix-hide-root-title-test

Conversation

@jamieplu

Copy link
Copy Markdown
Contributor

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

  • Yes, I signed my commits.

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>
Copilot AI review requested due to automatic review settings June 13, 2026 03:49
@leecalcote leecalcote merged commit 11f3c2a into master Jun 13, 2026
4 of 6 checks passed
@leecalcote leecalcote deleted the marblom007/fix-hide-root-title-test branch June 13, 2026 03:50

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
const { label: _label, ...otherOptions } = existingOptions;
const { label: _label, ...otherOptions } = existingOptions as Record<string, unknown>;

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 rootTitleVisibleUiSchema derived from the canonical import-design uiSchema with root label suppression removed.
  • Update the baseline assertion to render with rootTitleVisibleUiSchema instead of the canonical uiSchema.

Comment on lines +87 to +91
const { label: _label, ...otherOptions } = existingOptions;
return {
...importDesignUiSchema,
'ui:options': otherOptions
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants