mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Fixed loginByUsername unit test (#2975)
* Fixed loginByUsername unit test * Removed unused variable from WebClient login functions
This commit is contained in:
committed by
Joram Wilander
parent
d44067fb30
commit
2b1db2974a
@@ -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));
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user