techishiring-website
techishiring-website copied to clipboard
Write test suite for project
Feature Request
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I have an issue when [...]
Once #29 is completed, we will need to add a test for the project.
Describe the solution you'd like A clear and concise description of what you want to happen. Add any considered drawbacks.
Things to test:
lib folder:
- utils: capitalize, verify-email
- api: Not sure how to test this yet
pages folder:
I honestly don't know how to test Next.js components so I'd need to look that up.
components folder:
How should I test React Components
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Specifically for the components folder, I'm considering adding unit tests for each component in the folder or adding Cypress and testing flows through the application itself. I'm more knowledgeable on unit tests but I think Cypress will be a great learning experience and potentially better for testing components that mainly focuses on display.
Teachability, Documentation, Adoption, Migration Strategy If you can, explain how users will be able to use this and possibly write out a version the docs. Maybe a screenshot or design?
will do this later
This was from the description of issue #41 that I'd like to reflect here.
As of right now, this issue will remain vague as I don't have a great idea on how I want to structure the test suite. The application is mostly split between separating markup (display logic) from business logic. Because of that, I'm not sure if it'd add much value to test the display logic through unit tests. The business logic seems like a no-brainer for now but I'd like some time to think about and get opinions on what's the best way to write tests that'll add value to the project.
Suggestion
- unit test utility functions (capitalize, verify-email...)
- end-to-end test of each page (about, contact...)
Suggestion
- unit test utility functions (capitalize, verify-email...)
- end-to-end test of each page (about, contact...)
Definitely think that's the play for now. Also if we do end up changing specific components then we don't have to completely rewrite tests, at least I think we don't have to!
Also if we do end up changing specific components then we don't have to completely rewrite tests, at least I think we don't have to!
Yeah, I think we can even test components with storybook :thinking: I'll look into it