dec0dOS / zero-ui

ZeroUI - ZeroTier Controller Web UI - is a web user interface for a self-hosted ZeroTier network controller.
GNU General Public License v3.0
912 stars 146 forks source link

chore: implement tests for the frontend #135

Open davidlag0 opened 1 year ago

davidlag0 commented 1 year ago

@dec0dOS This is an issue to track the enablement of unit testing for the frontend portion of the codebase. I started working to enable them with Jest and React Testing Library. I ran into issues that seemed related to ESM (EcmaScript Modules) so at that moment I thought it would be easier to upgrade to React 18 to get access to a more recent version of Jest through react-scripts. However, it would seem safer to have unit tests in place to provide more confidence of not breaking anything with the upgrade to React 18 so I would like to revisit how Jest can be configured to work with the current codebase before the upgrade to React 18.

davidlag0 commented 1 year ago

I got tests working this morning with the HomeLoggedOutcomponent. I'll work from smaller components to larger ones that encapsulate them. I need to build more tests for HomeLoggedOut to fully test the component. My initial goal was to get the testing process and commands to work first without errors or warnings. I'll submit pull requests as I move along.