Skip to content

Commit

Permalink
update tests to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
d-telnyx committed Feb 2, 2021
1 parent 17aebce commit 5c90452
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
28 changes: 22 additions & 6 deletions test/resources/Outbound.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,29 @@ describe('Outbound list', function() {
}

it('Sends the correct request', function() {
return telnyx.outboundVoiceProfiles.create({billing_group_id: '6a09cdc3-8948-47f0-aa62-74ac943d6c58', concurrent_call_limit: 10})
return telnyx.outboundVoiceProfiles.create({
billing_group_id: '6a09cdc3-8948-47f0-aa62-74ac943d6c58',
concurrent_call_limit: 10,
name: 'name'
})
.then(responseFn);
})

it('Sends the correct request [with specified auth]', function() {
return telnyx.outboundVoiceProfiles.create({billing_group_id: '6a09cdc3-8948-47f0-aa62-74ac943d6c58', concurrent_call_limit: 10}, TEST_AUTH_KEY)
return telnyx.outboundVoiceProfiles.create({
billing_group_id: '6a09cdc3-8948-47f0-aa62-74ac943d6c58',
concurrent_call_limit: 10,
name: 'name'
}, TEST_AUTH_KEY)
.then(responseFn);
});

it('Sends the correct request [with specified auth in options]', function() {
return telnyx.outboundVoiceProfiles.create({billing_group_id: '6a09cdc3-8948-47f0-aa62-74ac943d6c58', concurrent_call_limit: 10}, {api_key: TEST_AUTH_KEY})
return telnyx.outboundVoiceProfiles.create({
billing_group_id: '6a09cdc3-8948-47f0-aa62-74ac943d6c58',
concurrent_call_limit: 10,
name: 'name'
}, {api_key: TEST_AUTH_KEY})
.then(responseFn);
});
});
Expand Down Expand Up @@ -77,7 +89,7 @@ describe('Outbound list', function() {
}

it('Sends the correct request', function() {
return telnyx.outboundVoiceProfiles.create({billing_group_id: '6a09cdc3-8948-47f0-aa62-74ac943d6c58'})
return telnyx.outboundVoiceProfiles.create({billing_group_id: '6a09cdc3-8948-47f0-aa62-74ac943d6c58', name: 'name'})
.then(function(response) {
const outboundVoiceProfiles = response.data;
return outboundVoiceProfiles.del()
Expand All @@ -103,10 +115,14 @@ describe('Outbound list', function() {
}

it('Sends the correct request', function() {
return telnyx.outboundVoiceProfiles.create({billing_group_id: '6a09cdc3-8948-47f0-aa62-74ac943d6c58', concurrent_call_limit: 10})
return telnyx.outboundVoiceProfiles.create({
billing_group_id: '6a09cdc3-8948-47f0-aa62-74ac943d6c58',
concurrent_call_limit: 10,
name: 'name'
})
.then(function(response) {
const ip = response.data;
return ip.update({billing_group_id: '6a09cdc3-8948-47f0-aa62-74ac943d6c59' ,concurrent_call_limit: 12})
return ip.update({billing_group_id: '6a09cdc3-8948-47f0-aa62-74ac943d6c59', concurrent_call_limit: 12})
.then(responseFn);
})
});
Expand Down
8 changes: 4 additions & 4 deletions test/resources/SimCardGroups.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var TEST_AUTH_KEY = utils.getUserTelnyxKey();
describe('SimCardGroups Resource', function() {
describe('retrieve', function() {
function responseFn(response) {
expect(response.data).to.include.keys(['id', 'name', 'data_enabled', 'data_limit', 'consumed_data']);
expect(response.data).to.include.keys(['id', 'name', 'data_limit', 'consumed_data']);
expect(response.data).to.include({record_type: 'sim_card_group'});
expect(response.data.consumed_data).to.include.keys(['amount', 'unit']);
}
Expand All @@ -26,7 +26,7 @@ describe('SimCardGroups Resource', function() {

describe('create', function() {
function responseFn(response) {
expect(response.data).to.include.keys(['id', 'name', 'data_enabled', 'data_limit', 'consumed_data']);
expect(response.data).to.include.keys(['id', 'name', 'data_limit', 'consumed_data']);
expect(response.data).to.include({record_type: 'sim_card_group'});
expect(response.data.consumed_data).to.include.keys(['amount', 'unit']);
}
Expand All @@ -49,7 +49,7 @@ describe('SimCardGroups Resource', function() {

describe('list', function() {
function responseFn(response) {
expect(response.data[0]).to.include.keys(['id', 'name', 'data_enabled', 'data_limit', 'consumed_data']);
expect(response.data[0]).to.include.keys(['id', 'name', 'data_limit', 'consumed_data']);
expect(response.data[0]).to.include({record_type: 'sim_card_group'});
expect(response.data[0].consumed_data).to.include.keys(['amount', 'unit']);
}
Expand All @@ -68,7 +68,7 @@ describe('SimCardGroups Resource', function() {
describe('Nested', function() {
function responseFn(response) {
if (response.data) {
expect(response.data).to.include.keys(['id', 'name', 'data_enabled', 'data_limit', 'consumed_data']);
expect(response.data).to.include.keys(['id', 'name', 'data_limit', 'consumed_data']);
expect(response.data).to.include({record_type: 'sim_card_group'});
expect(response.data.consumed_data).to.include.keys(['amount', 'unit']);
}
Expand Down

0 comments on commit 5c90452

Please sign in to comment.