frontendstudygroup / frontendstudygroup.github.io

Web application for the frontend study group from WomenWhoCode Frontend track.
https://frontendstudygroup.github.io/
17 stars 17 forks source link

Create unit tests for Resources component #48

Open sunithapatel opened 2 years ago

sunithapatel commented 2 years ago

Create unit tests for the Resources component.

Feel free to list out test scenarios here first for feedback if you like.

IngridFuentes commented 2 years ago

Hey @sunithapatel I want to learn how to create unit tests!! Can I work on this with some guidance? Like if you know a good documentation to start. Thanks!

princiya commented 2 years ago

@IngridFuentes good one. we are using react-testing-library. https://testing-library.com/docs/react-testing-library/intro/ So this is a good place to get started. Feel free to ask more questions.

princiya commented 2 years ago

some useful keywords which will help you with searching useful documentation around this are:

IngridFuentes commented 2 years ago

@princiya Thank you! I'll take a look

Priyami commented 2 years ago
TestCases
princiya commented 2 years ago

@Priyami how did you arrive at the above table? are you doing some manual testing too?

Also, can you and @IngridFuentes sync on this issue. Since @IngridFuentes too has claimed the issue, I believe she too has some ideas or doing some work. It's better for both of you to talk & coordinate before create PRs to avoid any duplicate work.

Priyami commented 2 years ago

From the above table, we could do manual testing for the Resouce component. so far, I have got five test cases as per the click event functionality on that page. This is a sample table. I would say, we could make each test case automated by the react-testing library or jest.

princiya commented 2 years ago

@Priyami thanks for clarifying. I don't think we have capacity for manual testing, or I am not sure who would take turn to run manual tests. If you have thoughts on this, feel free to brainstorm. But otherwise, using this template to write automated unit test cases for react-testing-library is a great idea. @IngridFuentes based on how far you are into exploring this unit testing topic, feel free to use this template or come up with your own test cases. @Priyami incase you plan to write any test cases using react-testing-library, please coordinate with @IngridFuentes . Happy testing :) 🎉

IngridFuentes commented 2 years ago

Yes, I have a few test cases written, so if you want to show me what you have, so we don't do the same @Priyami :)