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

Testing/extend component unit tests #490

Merged
merged 31 commits into from
Aug 18, 2020
Merged

Conversation

s-pic
Copy link
Collaborator

@s-pic s-pic commented Jul 19, 2020

Description

Adds a first unit-test for complex React-Component, the <AutoCompleteGeocoder/>.
This proves that the chosen libaries (react-testing-library) and msw work well for us.

Fixes #FixMyBerlin/fixmy.platform#341

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Ran new unit tests

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

s-pic added 24 commits May 3, 2020 20:48
react-testing-library is not able to detect that the ancestor element
of the element containing the text has overflow=hidden applied.
Cypress is way smarter here.

https://github.com/testing-library/jest-dom/#tobevisible
https://docs.cypress.io/guides/core-concepts/interacting-with-elements.html#Additionally-an-element-is-considered-hidden-if
…ponent_unit_tests

# Conflicts:
#	package-lock.json
#	package.json
@s-pic s-pic marked this pull request as ready for review July 23, 2020 18:18
s-pic and others added 4 commits July 23, 2020 20:34
…ponent_unit_tests

# Conflicts:
#	package-lock.json
The problem can be solved by importing node-fetch here. Even better
would be to use `ky-universal` but that
would require further refactoring.
@cafca
Copy link
Collaborator

cafca commented Aug 10, 2020

Running the tests takes 15s for me. This seems quite slow doesn't it? @s-pic Do you know what takes so much time?

@s-pic
Copy link
Collaborator Author

s-pic commented Aug 16, 2020

When I ran the tests it took 6 seconds. Anyhow I lowered the configured debounce time so now it is less than a second.

@cafca cafca merged commit 9863c5f into develop Aug 18, 2020
@cafca cafca deleted the testing/extend_component_unit_tests branch August 18, 2020 13:09
@s-pic s-pic mentioned this pull request Sep 3, 2020
14 tasks
@s-pic s-pic mentioned this pull request Oct 6, 2020
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