diff --git a/test/sanity-check/api/oauth-test.js b/test/sanity-check/api/oauth-test.js index c06dc556..53712229 100644 --- a/test/sanity-check/api/oauth-test.js +++ b/test/sanity-check/api/oauth-test.js @@ -24,6 +24,7 @@ const oauthClient = client.oauth({ describe('OAuth Authentication API Test', () => { it('should login with credentials', done => { client.login({ email: process.env.EMAIL, password: process.env.PASSWORD }, { include_orgs: true, include_orgs_roles: true, include_stack_roles: true, include_user_settings: true }).then((response) => { + authtoken = response.user.authtoken expect(response.notice).to.be.equal('Login Successful.', 'Login success messsage does not match.') done() }) @@ -32,7 +33,7 @@ describe('OAuth Authentication API Test', () => { it('should get Current user info test', done => { client.getUser().then((user) => { - authtoken = user.authtoken + expect(user.uid).not.to.be(undefined) done() }) .catch(done) diff --git a/test/sanity-check/api/user-test.js b/test/sanity-check/api/user-test.js index 8010834d..ff1a3574 100644 --- a/test/sanity-check/api/user-test.js +++ b/test/sanity-check/api/user-test.js @@ -50,6 +50,7 @@ describe('Contentstack User Session api Test', () => { client.login({ email: process.env.EMAIL, password: process.env.PASSWORD }, { include_orgs: true, include_orgs_roles: true, include_stack_roles: true, include_user_settings: true }).then((response) => { loggedinUserID = response.user.uid jsonWrite(response.user, 'loggedinuser.json') + authtoken = response.user.authtoken expect(response.notice).to.be.equal('Login Successful.', 'Login success messsage does not match.') done() }) @@ -58,7 +59,6 @@ describe('Contentstack User Session api Test', () => { it('should get Current user info test', done => { client.getUser().then((user) => { - authtoken = user.authtoken expect(user.uid).to.be.equal(loggedinUserID) done() })