captain-fact icon indicating copy to clipboard operation
captain-fact copied to clipboard

Add more tests

Open Betree opened this issue 7 years ago • 3 comments

Frontend doesn't have enough unit testing. These are the parts that should be tested in priority:

State

  • [ ] video_debate/comments/reducer.js
  • [ ] video_debate/comments/selectors.js
  • [ ] video_debate/statements/reducer.js
  • [ ] video_debate/statements/selectors.js
  • [ ] video_debate/video/reducer.js

Components

TODO

Betree avatar Aug 22 '18 18:08 Betree

I would like to work in this 👍

FacuRossi avatar Oct 04 '18 12:10 FacuRossi

Hey @FacuRossi a PR for these would be greatly appreciated :slightly_smiling_face:

You can get an example of how we test reducers with https://github.com/CaptainFact/captain-fact-frontend/blob/staging/app/state/video_debate/comments/tests/reducer.spec.js

Another example for components snapshots: https://github.com/CaptainFact/captain-fact-frontend/blob/staging/app/components/Utils/Message.jsx

Frontend test coverage is still way below what it should be, and overall very immature. If you want to add new libraries or bring your own practices feel free to suggest some. Adding a Storybook for example would be really useful.

Betree avatar Oct 04 '18 12:10 Betree

If you're wondering what this spapshotReducer function is, please get a look at https://github.com/CaptainFact/captain-fact-frontend/blob/staging/dev/tests_setup.js

Betree avatar Oct 04 '18 12:10 Betree