-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
fix: enzyme testing replaced by react tester #36026
base: master
Are you sure you want to change the base?
Conversation
Thanks for the pull request, @jciasenza! This repository is currently maintained by @openedx/wg-maintenance-edx-platform. Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! It's awesome to see enzyme tests replaced!
Would it be possible to use userEvent
instead of fireEvent
for these? It is recommended by testing-library
, and the differences are described here: https://testing-library.com/docs/user-event/intro/#differences-from-fireevent
fireEvent
dispatches DOM events, whereasuser-event
simulates full interactions, which may fire multiple events and do additional checks along the way.
A lot of the time moving to userEvent
from fireEvent
is very straightforward. It looks like that is likely the case with here.
Hi @brian-smith-tcril, I'll try it and let you know!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jciasenza , it looks like the edited test case is failing. If you click into "Javascript tests / JS" check below, you should be able to see how it is failing. If you have a development environment set up, you could also run the tests locally with jest
.
It looks like the error is
so I think adding the testing library packages as dev dependencies should resolve this. |
Yes @brian-smith-tcril , that is the error but apparently the version of React is 16 and I am looking for the compatible version for @testing-library/react and @testing-library/user-event |
From https://www.npmjs.com/package/@testing-library/react/v/14.3.1
|
Replaced enzyme display dropdown on toggling dropdown test in Main file for react-renderer tests.
I made PR of this issue #35245
And Testing OK
If something needs to be modified, let me know, thank you!!!
Atte
Juan Carlos (Aulasneo)
Developer Checklist
Test suites passing
Documentation and test plan updated, if applicable
Received code-owner approving review