Add tests for login method success and error paths