daniel-norris / neu_ui

Prototype and build projects faster using Neu UI - an open source React component library designed to neumorphic style. Built using React, Styled Components, Jest and Storybook.
https://ui-neu.netlify.app/
MIT License
24 stars 31 forks source link

Add tests for Toggle to fix request #70 #80

Closed rdhaundiyal-indeed closed 3 years ago

rdhaundiyal-indeed commented 3 years ago

Added unit tests for Toggle component.

Notes: I could only add basic tests like rendering works and the rendered structure is as expected. If you have any specific cases in mind, please mention them here and I will add them as well. Thanks.

rdhaundiyal-indeed commented 3 years ago

Done & verified coverage. However, the test needs to know internal details of the component because no external 'onClick' handler has been passed to it as props.

rdhaundiyal-indeed commented 3 years ago

Hi! I hope there's nothing pending on me.

daniel-norris commented 3 years ago

Hi @rdhaundiyal-indeed sorry for the delay in coming back to you. The past week has been crazy and it's been hard to find time in the evening to review PRs.

I'm afraid someone has submitted a PR which has refactored the Toggle component - you can see PR #92. Your tests are now failing on this PR I'm afraid. It just looks like, on a quick review, that they're failing when trying to traverse the DOM. Only because the refactor has changed the structure a little bit.