The fact that we don't have unit tests for the authentication flow is a major piece of technical debt. This makes many different pieces of the system difficult to upgrade because it is difficult to know whether or not a change is going to break auth. Even when we're careful, the fact that we're missing unit tests mean that we break the authentication flow in ways we don't intend (or don't foresee). Good unit testing should be able to catch many of these errors.
Writing unit tests for the current AuthModal seems hard -- the authResponse generation logic is embedded in the react component's behavior. The easiest approach would be to:
Move most of the logic out of the react component's componentWillReceiveProps, completeAuthResponse and login functions -- we should be able to test that logic without making react component tests
The fact that we don't have unit tests for the authentication flow is a major piece of technical debt. This makes many different pieces of the system difficult to upgrade because it is difficult to know whether or not a change is going to break auth. Even when we're careful, the fact that we're missing unit tests mean that we break the authentication flow in ways we don't intend (or don't foresee). Good unit testing should be able to catch many of these errors.
Writing unit tests for the current AuthModal seems hard -- the authResponse generation logic is embedded in the react component's behavior. The easiest approach would be to:
componentWillReceiveProps
,completeAuthResponse
andlogin
functions -- we should be able to test that logic without making react component tests