now-u / now-u-campaigns

now-u website
https://now-u.com
2 stars 6 forks source link

Feature/tests #100

Closed stellenberger closed 4 years ago

stellenberger commented 4 years ago

Description

Please include a brief summary of what the issue is and what has been done to solve it?

Added an example component, and example CSS (which is empty), and example child component, and example unit/function tests for the example component.

There is a problem that it is difficult to isolate unit tests completely when using Functional components in React, as you will not be able to access its functions without exporting them. If we use Class based components, then we can unit test without a problem. I have put the solution for unit testing class based components, but it is commented out (as the example is a functional component)

Fixes #99

Checklist: