I have a React application comprising mostly functional components. I haven't built it as a test-driven project because I don't know Javascript testing, but I would like to add some tests now. Because all the components are linked to the app state through redux, the tests must mock the redux store as well as test the component.
What I need is an example test suit for a single page that includes the technique for mocking the redux store as well as the basic tests for form actions. The app is built with create-react-app and therefore has Jest preinstalled. I will provide access to the Github repo for the project.
The following code is an example app only with two pages. One is a form that allows you to save a domain string to a database. The other is a table that displays the saved domains. The app is built with yarn/create-react-app etc.
The tests I need added must do the following:
1) use Jest
2) mock the redux store actions and props in both pages
3) test the submit action on the form
4) test the response dialog box on the form for both success and failure.
Please review and confirm