Adding unit tests for credentials.registerEndpoint

we should also test that `res.body` does not have the property `pswd` - to make sure we don't start leaking passwords in the response.