Skip to content
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

Refactor: remove unnecessary indirectness in get default form state test #4462

Merged
merged 10 commits into from
Jan 24, 2025

Conversation

x0k
Copy link
Contributor

@x0k x0k commented Jan 22, 2025

Reasons for making this change

In a recent release, excessive indirectness was added to the test, making it less readable and harder to extend.

I have regrouped the tests as follows:

  • object schemas
    • [test case]
      • getDefaultFormState
      • computeDefaults
      • getDefaultBasedOnSchemaType
      • getObjectDefaults
      • (with additional options)
        • getDefaultFormState
        • computeDefaults
        • getDefaultBasedOnSchemaType
        • getObjectDefaults
  • array schemas
    • [test case]
      • getDefaultFormState
      • computeDefaults
      • getDefaultBasedOnSchemaType
      • getArrayDefaults
      • (with additional options)
        • getDefaultFormState
        • computeDefaults
        • getDefaultBasedOnSchemaType
        • getArrayDefaults

All tests are passed “as is” (except one, see below), but I've left a few notes in the code in obscure places.

I made a change to one test to make it more explicit, see b49e7a3

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests. I've run npx nx run-many --target=build --exclude=@rjsf/docs && npm run test:update to update snapshots, if needed.
    • I've updated docs if needed
    • I've updated the changelog with a description of the PR
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

@heath-freenome heath-freenome merged commit 5a3537e into rjsf-team:main Jan 24, 2025
5 checks passed
@x0k x0k deleted the get-default-state-test-refactoring branch January 24, 2025 21:04
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.

2 participants