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

Clean up a few things in tests #3139

Merged
merged 8 commits into from
Jan 24, 2024
Merged

Clean up a few things in tests #3139

merged 8 commits into from
Jan 24, 2024

Conversation

grahamalama
Copy link
Contributor

  • remove unused mocks
  • use typescript with our test utils module, and make camelCase while we're at it
  • Delete duplicate createComponent util
  • Tweak renderWithProvider to look like what's suggested in testing-library / redux docs
  • instead of doing
const node = render(<Component />)
expect(node.query(...))

do

render(<Component />)
expect(screen.query(...))

as is demonstrated throughout the Testing Library docs

Copy link
Contributor

@alexcottner alexcottner left a comment

Choose a reason for hiding this comment

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

Did a little reading and it looks like this is the more correct way of doing things. Are we intentionally leaving the re-render logic in there for authForm tests for now? I am curious as to how replacing that would look.

@grahamalama
Copy link
Contributor Author

Are we intentionally leaving the re-render logic in there for authForm tests for now? I am curious as to how replacing that would look.

Yeah, for now I only did replacements where dropping in screen was relatively straightforward. There were a few special cases that probably deserve to be looked at in another PR

@grahamalama grahamalama merged commit 1120b91 into master Jan 24, 2024
6 checks passed
@grahamalama grahamalama deleted the cleanup-tests branch January 24, 2024 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants