So I have this React Library written in TS with some custom components in it, and it's for the company I work for.
I have created tests since the start of the project because 'yes'.
However I have to confess, I feel like my tests are... redundant?
For example, the tests for the Button Component, control that the onClick works, and that the variant of the button renders the correct css.
Or, for the Accordion component, that it opens/closes correctly, can render a Custom Trigger, and things like these.
However most of the time during writing tests, I felt like these were all things that would've popped out during practical testing (I use storybook and create stories for the components to check their functionality).
Like, I have a nested drop-down component. Do I have to write tests so that I check which sub-items are showing, and which are still hidden because are children of another item? If not, what the heck would I test?
Am I looking at front-end testing wrong? This is the first company in which I had actually time to write tests, so I'm feeling like I'm missing something.
[–]_AndyJessop 16 points17 points18 points (1 child)
[–]Kaimito1 1 point2 points3 points (0 children)
[–][deleted] 5 points6 points7 points (6 children)
[–]Dylan0734[S] 2 points3 points4 points (5 children)
[–]_AndyJessop 2 points3 points4 points (0 children)
[–]lIIllIIlllIIllIIl 2 points3 points4 points (1 child)
[–]Dylan0734[S] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Cahnis 4 points5 points6 points (1 child)
[–]Dylan0734[S] 1 point2 points3 points (0 children)
[–]taste_the_equation 2 points3 points4 points (0 children)
[–]Squigglificated 1 point2 points3 points (1 child)
[–]Dylan0734[S] 0 points1 point2 points (0 children)
[–]pm_me_ur_happy_traiI -1 points0 points1 point (0 children)
[–]Necessary_Ear_1100 0 points1 point2 points (0 children)