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

Unit test components #22

Open
2 of 9 tasks
luizbaldi opened this issue Oct 9, 2020 · 4 comments
Open
2 of 9 tasks

Unit test components #22

luizbaldi opened this issue Oct 9, 2020 · 4 comments
Labels
good first issue Good for newcomers testing Test related improvements

Comments

@luizbaldi
Copy link
Contributor

luizbaldi commented Oct 9, 2020

In order to have a stable codebase, we need to properly unit test our core UI components.

For doing so, we're using the react-native-testing-library, which encourages best practices when testing React Native components.

List of components that need to be tested:

Definition of done

  • We don't wanna test implementation details here, so when writing tests we should focus on how the component behaves, so when props or method names change, the test must still pass
  • Don't worry so much about testing coverage, it's just a metric and the important thing is to cover how the component is being actually used
  • Avoid testing using snapshots, but if you really wanna use them, please read this article before

Each component should have a separate PR, If you decide to start writing tests for some of the components listed above, please drop a comment on this issue so we can keep track of everything :)

@luizbaldi luizbaldi added good first issue Good for newcomers testing Test related improvements labels Oct 9, 2020
@chrismolina159
Copy link

Hello, I would like to give this a try! Would I be able to try with the Avatar component? I'm new to unit testing, but I am interested in giving it a shot

@luizbaldi
Copy link
Contributor Author

@chrismolina159 Of course! The Avatar component is a good one to start, you can basically check if style properties are being properly used.

Feel free to also refactor the component if you think there's something to improve, thanks :)

@chrismolina159
Copy link

Hello @luizbaldi unfortunately I cannot work on this right now, so feel free to unassign me from the Avatar component. Best of luck!

@luizbaldi
Copy link
Contributor Author

@chrismolina159 All good, thanks for notifying! If you ever want to contribute we'll be here :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers testing Test related improvements
Projects
None yet
Development

No branches or pull requests

2 participants