diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-05-12 07:44:06 -0400 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-05-12 07:44:06 -0400 |
commit | 2b1db2974a9bf0b801ba00c9a7c689cf92fe139d (patch) | |
tree | 0567b2343770db1393ddd4903d830cbd21a1408d /webapp | |
parent | d44067fb3031c53fddb5730df727126145ab1089 (diff) | |
download | chat-2b1db2974a9bf0b801ba00c9a7c689cf92fe139d.tar.gz chat-2b1db2974a9bf0b801ba00c9a7c689cf92fe139d.tar.bz2 chat-2b1db2974a9bf0b801ba00c9a7c689cf92fe139d.zip |
Fixed loginByUsername unit test (#2975)
* Fixed loginByUsername unit test
* Removed unused variable from WebClient login functions
Diffstat (limited to 'webapp')
-rw-r--r-- | webapp/tests/client_user.test.jsx | 11 | ||||
-rw-r--r-- | webapp/utils/web_client.jsx | 4 |
2 files changed, 7 insertions, 8 deletions
diff --git a/webapp/tests/client_user.test.jsx b/webapp/tests/client_user.test.jsx index 2b3b1b89a..621be6c6a 100644 --- a/webapp/tests/client_user.test.jsx +++ b/webapp/tests/client_user.test.jsx @@ -113,7 +113,6 @@ describe('Client.User', function() { it('loginByUsername', function(done) { var client = TestHelper.createClient(); - client.enableLogErrorsToConsole(false); // Disabling since this unit test causes an error var user = TestHelper.fakeUser(); client.createUser( user, @@ -122,13 +121,13 @@ describe('Client.User', function() { user.username, user.password, null, - function() { - done(new Error()); + function(data) { + assert.equal(data.id.length > 0, true); + assert.equal(data.email, user.email); + done(); }, function(err) { - // should error out because logging in by username is disabled by default - assert.equal(err.id, 'store.sql_user.get_for_login.app_error'); - done(); + done(new Error(err.message)); } ); }, diff --git a/webapp/utils/web_client.jsx b/webapp/utils/web_client.jsx index 642e523b7..c7e4bd306 100644 --- a/webapp/utils/web_client.jsx +++ b/webapp/utils/web_client.jsx @@ -53,7 +53,7 @@ class WebClientClass extends Client { } }, (err) => { - this.track('api', 'api_users_login_fail', name, 'login_id', loginId); + this.track('api', 'api_users_login_fail', '', 'login_id', loginId); if (error) { error(err); } @@ -75,7 +75,7 @@ class WebClientClass extends Client { } }, (err) => { - this.track('api', 'api_users_login_fail', name, 'login_id', loginId); + this.track('api', 'api_users_login_fail', '', 'login_id', loginId); if (error) { error(err); } |