diff options
Diffstat (limited to 'webapp')
-rw-r--r-- | webapp/client/client.jsx | 9 | ||||
-rw-r--r-- | webapp/tests/client_user.test.jsx | 15 |
2 files changed, 24 insertions, 0 deletions
diff --git a/webapp/client/client.jsx b/webapp/client/client.jsx index 0c4e04524..1bbd750c3 100644 --- a/webapp/client/client.jsx +++ b/webapp/client/client.jsx @@ -974,6 +974,15 @@ export default class Client { end(this.handleResponse.bind(this, 'getByUsername', success, error)); } + getByEmail(email, success, error) { + request. + get(`${this.getUsersRoute()}/email/${email}`). + set(this.defaultHeaders). + type('application/json'). + accept('application/json'). + end(this.handleResponse.bind(this, 'getByEmail', success, error)); + } + login(loginId, password, mfaToken, success, error) { this.doLogin({login_id: loginId, password, token: mfaToken}, success, error); diff --git a/webapp/tests/client_user.test.jsx b/webapp/tests/client_user.test.jsx index 3af29661a..741f494bb 100644 --- a/webapp/tests/client_user.test.jsx +++ b/webapp/tests/client_user.test.jsx @@ -51,6 +51,21 @@ describe('Client.User', function() { }); }); + it('getByEmail', function(done) { + TestHelper.initBasic(() => { + TestHelper.basicClient().getByEmail( + TestHelper.basicUser().email, + function(data) { + assert.equal(data.email, TestHelper.basicUser().email); + done(); + }, + function(err) { + done(new Error(err.message)); + } + ); + }); + }); + it('getInitialLoad', function(done) { TestHelper.initBasic(() => { TestHelper.basicClient().getInitialLoad( |