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 TextInput related components tests from Enzyme to React Testing Library #853

Closed
nataliepina opened this issue Oct 24, 2022 · 5 comments · Fixed by #857
Closed

Comments

@nataliepina
Copy link
Collaborator

Description

This issue is related to refactoring the TextInput.test.tsx, TextInputWithButtons.test.tsx, Textarea.test.tsx and TextInputWithBadges.test.tsx files.

We've recently been migrating our tests from Jest + Enzyme to Jest + testing-library/react to support a full migration to React 18.

You may refer to this previous PR beginning the migration for code examples - #771. Or you can find many code examples throughout other component tests using react testing library within the codebase.

Acceptance Criteria

Refactor the test to use React Testing Library instead of Enzyme (which is no longer supported with React 18).

More information: Migrate from Enzyme

How to Contribute

Please review the contributing documentation beforehand.

Steps to Contribute:

  1. Fork the repository.
  2. Clone it to your local system.
  3. Create a new branch.
  4. Make your changes. Make sure that tests are still passing. To update snapshot tests, run npm run test -- -u and include the updated tests in your commit.
  5. Commit your changes. When committing prefix your commit message with the appropriate conventional commit type. For example, refactor: <component_name> tests.
  6. Push up your changes. In GitHub, click the compare & pull request button to begin drafting your pull request.
  7. Fill out the pull request form and attach the "ready for review" label when complete.
@taksuparth
Copy link
Contributor

@nataliepina I can pick this up

@nataliepina
Copy link
Collaborator Author

Sounds good! Thanks for all your help with testing improvements @taksuparth.

@taksuparth
Copy link
Contributor

@nataliepina do let me know if there are more challenging and new items in your planned release which I can pick it up

@nataliepina
Copy link
Collaborator Author

@nataliepina do let me know if there are more challenging and new items in your planned release which I can pick it up

We definitely have some things in the works. We're nearly done with the big migration from class components and enzyme refactoring. There are many more improvements in the pipeline. I'll add some more challenging issues here shortly. Thanks!

@github-actions
Copy link

🎉 This issue has been resolved in version 11.2.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants