diff --git a/test/accounts.js b/test/accounts.js index 64f4ea1b..56b0aba9 100644 --- a/test/accounts.js +++ b/test/accounts.js @@ -81,6 +81,13 @@ describe('Account', function () { }) }); + it('should throw error for update subAccount via interface', function () { + return client.subAccounts.update() + .catch(function(errorResponse) { + assert.equal(errorResponse, 'Error: Missing mandatory field: id') + }) + }); + it('list subAccounts', function () { return client.subAccounts.list() .then(function(accounts) { @@ -94,4 +101,11 @@ describe('Account', function () { assert.equal(accounts, true) }) }); + + it('Should throw error for delete subAccounts via interface', function () { + return client.subAccounts.delete() + .catch(function(errorResponse) { + assert.equal(errorResponse, 'Error: Missing mandatory field: id') + }) + }); }); diff --git a/test/media.js b/test/media.js index 14676c54..80e3d0d4 100644 --- a/test/media.js +++ b/test/media.js @@ -11,16 +11,32 @@ let client = new Client('sampleid', 'sammpletoken', 'sampleproxy'); describe('MediaInterface', function () { - it('list media via interface', function () { + it('list media via interface', function () { return client.media.list() .then(function (res) { assert.notEqual(res.length, 0) }) }); + + it(' should throw error for list media via interface', function () { + return client.media.list('id') + .catch(function(errorResponse) { + assert.equal(errorResponse, 'ReferenceError: id is not defined') + }) + }); + it('should get media', function () { return client.media.get('0178eb8a-461a-4fd1-bc37-13eebfdc0676') .then(function (res) { assert.equal(res.mediaId, '0178eb8a-461a-4fd1-bc37-13eebfdc0676') }) }); + + it('should throw error for get media', function () { + return client.media.get() + .catch(function(errorResponse) { + assert.equal(errorResponse, 'Error: Missing mandatory field: media_id') + }) + }); + });