Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

fixes usage of waitFor to render component tests #84

Merged

Conversation

JakeLo123
Copy link
Collaborator

What is this PR and why do we need it?

Addressing issue #83. The component tests (buttons, and HOC tests) use waitFor to render components. This can cause unexpected behavior.

  • removing uses of AfterEach... jest.clearAllMocks() in tests that don't use mocks.
  • updating uses of toBeCalled() (deprecated) to toHaveBeenCalled()

Pre-Merge Checklist (if applicable)

  • Unit and Feature tests have been added/updated for logic changes, or there is a justifiable reason for not doing so.

@JakeLo123 JakeLo123 added the general issue not necessarily an observable bug, but needs change label Feb 15, 2024
@JakeLo123 JakeLo123 self-assigned this Feb 15, 2024
@JakeLo123 JakeLo123 linked an issue Feb 15, 2024 that may be closed by this pull request
@JakeLo123 JakeLo123 force-pushed the 83-correct-component-tests-usage-of-testing-library-and-async branch from 0e4bb3f to 4529d3a Compare February 15, 2024 17:04
Copy link
Collaborator

@BriDavidson BriDavidson left a comment

Choose a reason for hiding this comment

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

Screenshot 2024-02-16 at 11 56 20 AM I am seeing that 8 tests are getting skipped on this branch however not. much specification as to which ones are being skipped or why. Is this expected behavior with these changes? All tests appear to run on main

@JakeLo123
Copy link
Collaborator Author

I am seeing that 8 tests are getting skipped on this branch

that got fixed on this PR, so it's not an effect of this branch.

@dmackinn dmackinn merged commit 68ad56e into main Feb 22, 2024
2 checks passed
@dmackinn dmackinn deleted the 83-correct-component-tests-usage-of-testing-library-and-async branch February 22, 2024 19:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
general issue not necessarily an observable bug, but needs change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Correct component tests usage of testing-library and async
3 participants