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

Migrated BaseForm tests to @testing-library/react #1303

Merged
merged 7 commits into from
Feb 23, 2024
Merged

Conversation

piotrpospiech
Copy link
Collaborator

Is part of #1130

  • added new tests to BaseForm RTL suites
  • removed enzyme BaseForm tests

I cannot migrate most of BaseForm tests, because it was based on BaseForm context or state. RTL doesn't support testing these cases. I didn't find another aproach to test these cases.

Additional issue is with ignores synchronous errors test. Using RTL, error cannot be catched.

@github-actions github-actions bot added the Area: Core Affects the uniforms package label Feb 15, 2024
Copy link

codecov bot commented Feb 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1a6ca83) 94.66% compared to head (2588b61) 94.60%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1303      +/-   ##
==========================================
- Coverage   94.66%   94.60%   -0.06%     
==========================================
  Files         231      231              
  Lines        3821     3821              
  Branches     1029     1029              
==========================================
- Hits         3617     3615       -2     
  Misses         82       82              
- Partials      122      124       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@kestarumper kestarumper left a comment

Choose a reason for hiding this comment

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

I don't know about the other it(...)s but we definitely need to think that through.

I'm not sure how much we can count on the CodeCov code coverage.
If for example the autosave functionality is covered somewhere else (e.g. in a theme package) then that's fine, but we can't lose the tested functionalities at all.

packages/uniforms/__tests__/BaseForm.tsx Outdated Show resolved Hide resolved
packages/uniforms/__tests__/BaseForm.tsx Outdated Show resolved Hide resolved
packages/uniforms/__tests__/BaseForm.tsx Outdated Show resolved Hide resolved
Copy link
Member

@kestarumper kestarumper left a comment

Choose a reason for hiding this comment

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

Nice!
I haven't come up with any other tests so if nobody suggests anything we're good to go.

@kestarumper kestarumper merged commit 9ae8eb5 into master Feb 23, 2024
6 of 7 checks passed
@kestarumper kestarumper deleted the base-form-tests branch February 23, 2024 11:12
@kestarumper kestarumper linked an issue Apr 7, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Core Affects the uniforms package
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants