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

Migrate core tests from Enzyme to React Testing Library #1193

Merged
merged 29 commits into from
Mar 8, 2023

Conversation

ErnestTeluk
Copy link
Contributor

@ErnestTeluk ErnestTeluk commented Nov 27, 2022

TASK:

  • Rewrite all core test from enzyme to rtl

TODO:

  • Fix ts error related with ref in <ValidateForm /> tests.
  • Rewrite the last describe in <ValidateForm /> tests.
  • Fix skipped tests in <AutoForm /> as in <ValidateForm />.
  • change 'test' to 'it'
  • get context from jest.fn (last call argument)
  • add to render rerenderWithProps fn with React.cloneElement.
  • rewrite <BaseForm />, connectedFields, <QuickForm />

@github-actions github-actions bot added Area: Core Affects the uniforms package Area: Infra Affects the repository itself (e.g., CI, dependencies) labels Nov 27, 2022
@github-actions github-actions bot removed the Area: Infra Affects the repository itself (e.g., CI, dependencies) label Nov 27, 2022
@codecov
Copy link

codecov bot commented Nov 27, 2022

Codecov Report

Merging #1193 (81f69df) into master (482d899) will decrease coverage by 0.08%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1193      +/-   ##
==========================================
- Coverage   98.39%   98.31%   -0.08%     
==========================================
  Files         231      231              
  Lines        3803     3803              
  Branches      998      998              
==========================================
- Hits         3742     3739       -3     
- Misses          6        8       +2     
- Partials       55       56       +1     
Impacted Files Coverage Δ
packages/uniforms/src/AutoForm.tsx 88.00% <0.00%> (-12.00%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ErnestTeluk ErnestTeluk changed the title Rewrite Uniforms core test from enzyme to rts Rewrite Uniforms core test from enzyme to rtl Nov 28, 2022
@github-actions github-actions bot added Area: Theme Affects some of the theme packages Theme: AntD Affects the uniforms-antd package Theme: Bootstrap 3 Affects the uniforms-bootstrap3 package Theme: Bootstrap 4 Affects the uniforms-bootstrap4 package Theme: Bootstrap 5 Affects the uniforms-bootstrap5 package Theme: Material-UI Affects the uniforms-material package Theme: MUI Affects the uniforms-mui package Theme: Semantic UI Affects the uniforms-semantic package Theme: Unstyled Affects the uniforms-unstyled package labels Nov 28, 2022
@ErnestTeluk ErnestTeluk changed the title Rewrite Uniforms core test from enzyme to rtl Rewrite uniforms core test from enzyme to rtl Nov 28, 2022
@github-actions github-actions bot added Area: Bridge Affects some of the bridge packages Bridge: GraphQL Affects the uniforms-bridge-graphql package labels Nov 28, 2022
packages/uniforms/__tests__/AutoForm.tsx Outdated Show resolved Hide resolved
packages/uniforms/__suites__/render.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@radekmie radekmie left a comment

Choose a reason for hiding this comment

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

I have skipped ValidatedForm for now, as there are already quite a few comments.

packages/uniforms/__suites__/render.tsx Outdated Show resolved Hide resolved
packages/uniforms/__suites__/render.tsx Outdated Show resolved Hide resolved
packages/uniforms/__suites__/render.tsx Outdated Show resolved Hide resolved
packages/uniforms/__suites__/render.tsx Outdated Show resolved Hide resolved
packages/uniforms/__tests__/AutoForm.tsx Outdated Show resolved Hide resolved
packages/uniforms/__tests__/AutoForm.tsx Outdated Show resolved Hide resolved
packages/uniforms/__tests__/AutoForm.tsx Show resolved Hide resolved
packages/uniforms/__tests__/AutoForm.tsx Outdated Show resolved Hide resolved
packages/uniforms/__tests__/useField.tsx Outdated Show resolved Hide resolved
packages/uniforms/__tests__/useField.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@radekmie radekmie left a comment

Choose a reason for hiding this comment

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

Last round. Also, if you could look into the dip in coverage, that'd be great.

packages/uniforms/__suites__/render.tsx Show resolved Hide resolved
packages/uniforms/__tests__/AutoForm.tsx Outdated Show resolved Hide resolved
packages/uniforms/__tests__/ValidatedForm.tsx Outdated Show resolved Hide resolved
packages/uniforms/__tests__/AutoForm.tsx Outdated Show resolved Hide resolved
@radekmie radekmie changed the title Rewrite uniforms core test from enzyme to rtl Migrate core tests from Enzyme to React Testing Library Feb 21, 2023
@radekmie radekmie added the Type: Feature New features and feature requests label Mar 8, 2023
Copy link
Contributor

@radekmie radekmie left a comment

Choose a reason for hiding this comment

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

OK, let's get this one closed. We'll improve tests later.

@radekmie radekmie merged commit 2294beb into master Mar 8, 2023
@radekmie radekmie deleted the enzyme-to-rts-core branch March 8, 2023 11:53
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 Type: Feature New features and feature requests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants