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

test: changes to jest tests to remove console warnings #1499

Merged
merged 8 commits into from
Feb 5, 2021

Conversation

jenniferarnesen
Copy link
Collaborator

@jenniferarnesen jenniferarnesen commented Feb 1, 2021

Changes in this PR are are refactoring and jest test improvements:
Refactor:

  • replace windowHeight redux prop with the WindowDimensions context (all components needing window width/height now use the context)

Testing:

  • EditBar.spec: use async/act to trigger useEffect and mocked api request - removes error about api request (tests still passed but there was a console error)
  • EditDashboard.spec: mock the EditBar and focus on EditDashboard functionality
  • Dashboard: use testing-library and test the default component export, which results in mapStateToProps also getting covered by the tests
  • Named functions for mocks - removes warning

@jenniferarnesen jenniferarnesen enabled auto-merge (squash) February 1, 2021 12:06
@jenniferarnesen jenniferarnesen merged commit c9ed0f6 into master Feb 5, 2021
@jenniferarnesen jenniferarnesen deleted the test/test-warning-fixes branch February 5, 2021 13:51
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 31.10.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants