-
Notifications
You must be signed in to change notification settings - Fork 158
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
component tests linting fixes #1311
Conversation
@@ -18,3 +18,5 @@ export function setupComponent(jsx, options = {}) { | |||
...render(jsx) | |||
} | |||
} | |||
|
|||
export * from '@testing-library/react' |
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.
@goosewobbler I think the changes to use screen
throughout the tests based on the linting rules make sense, but we still want to call setupUser()
before ever render to make sure we're using a new instance of the user object each time.
I updated this file to be more in line with the recommended way to use a setup file based on these docs:
https://testing-library.com/docs/react-testing-library/setup
https://testing-library.com/docs/user-event/intro#writing-tests-with-userevent
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.
I think one more improvement would be to export the setupComponent
method as render
and always use that in every test as suggested in the docs. I updated this test file as a sample of how it can look when everything is put together: test/app/dash/Accounts/Add/AddPhrase/index.test.js
Closing in favour of #1334 |
Fixing linting issues in the components tests and some associated refactoring