Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions test/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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')
})
});
});
18 changes: 17 additions & 1 deletion test/media.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
});

});