This PR adds server testing to the application to ensure proper server response when registering, logging in, and logging out a user. Minor modifications were made to the server.js file to export a reference to the server and account for a testing configuration.
Tests are added for three endpoints:
/register
a new user can be registered
a duplicate user cannot be registered
/login
a user can login
an error is returned for invalid credentials
/logout
that the status back from the logout endpoint is 200
This PR also:
abstracts the Login form into its own component.
adds tests for that login form to ensure
the login form does not render when the user is logged in
the logout button does render when the user is logged in
an error message is displayed when authentication fails
logout method is called when the logout button is clicked.
Reviewer note: I'm pretty green with writing server tests.
Opening a PR to resolve #61
This PR adds server testing to the application to ensure proper server response when registering, logging in, and logging out a user. Minor modifications were made to the
server.js
file to export a reference to the server and account for a testing configuration.Tests are added for three endpoints:
/register
/login
/logout
This PR also:
Reviewer note: I'm pretty green with writing server tests.