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 connectField tests to @testing-library/react #1301

Merged
merged 11 commits into from
Feb 23, 2024

Conversation

piotrpospiech
Copy link
Collaborator

@piotrpospiech piotrpospiech commented Feb 14, 2024

Is part of #1130

  • added connectField RTL tests
  • removed enzyme connectField tests

Main changes compare to enzyme tests:

  • removed from when rendered with label test following labelVariants:
const labelA = <span style={{ color: 'red' }}>Error</span>;
const labelB = <span style={{ color: 'green' }}>OK</span>;
    
['Props', labelB, 'Props'],
['', labelB, ''],
[labelA, '', labelA],
[labelA, 'Schema', labelA],
[labelA, labelB, labelA],
[labelA, undefined, labelA],
[undefined, labelB, labelB],
  • changed in the is able to set another field value test, tested value from object to string to have the same type in those two fields

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

codecov bot commented Feb 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1a6ca83) 94.66% compared to head (02d0e22) 94.66%.

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

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

kestarumper
kestarumper previously approved these changes Feb 15, 2024
[undefined, '', ''],
[undefined, 'Schema', 'Schema'],
[undefined, labelB, labelB],
[undefined, undefined, ''],
Copy link
Member

Choose a reason for hiding this comment

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

Why did you remove those cases?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I created Test component that use label as input props and it couldn't be rendered.

I changed it now to render label above input. Rendering label is based on rendering label in TextField in the uniforms-unstyled. I needed to change works with nested labels test after this change.

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.

Great work!

@kestarumper kestarumper merged commit 9d7cde0 into master Feb 23, 2024
7 checks passed
@kestarumper kestarumper deleted the connect-field-tests branch February 23, 2024 11:08
@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