From 2b1db2974a9bf0b801ba00c9a7c689cf92fe139d Mon Sep 17 00:00:00 2001
From: Harrison Healey <harrisonmhealey@gmail.com>
Date: Thu, 12 May 2016 07:44:06 -0400
Subject: Fixed loginByUsername unit test (#2975)

* Fixed loginByUsername unit test

* Removed unused variable from WebClient login functions
---
 webapp/tests/client_user.test.jsx | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

(limited to 'webapp/tests/client_user.test.jsx')

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));
                     }
                 );
             },
-- 
cgit v1.2.3-1-g7c22

