mirror of
https://github.com/donl/plivo-node.git
synced 2026-05-25 22:07:10 -06:00
36 lines
No EOL
1.3 KiB
JavaScript
36 lines
No EOL
1.3 KiB
JavaScript
import {
|
|
Client
|
|
} from '../lib/rest/client-test';
|
|
import {
|
|
PlivoGenericResponse
|
|
} from '../lib/base.js';
|
|
import assert from 'assert';
|
|
import sinon from 'sinon';
|
|
|
|
let client = new Client('sampleid', 'sammpletoken', 'sampleproxy');
|
|
|
|
describe('campaign', function () {
|
|
it('should get campaign', function () {
|
|
return client.campaign.get("CMPT4EP")
|
|
.then(function (response) {
|
|
assert.equal(response.campaign.campaignId, "CMPT4EP")
|
|
})
|
|
});
|
|
|
|
it('list campaign', function () {
|
|
return client.campaign.list()
|
|
.then(function (response) {
|
|
assert.equal(response.campaigns.length, 2)
|
|
})
|
|
});
|
|
|
|
it('create campaign', function () {
|
|
return client.campaign.create("B8OD95Z","campaign name sssample","INSURANCE","MIXED",[
|
|
"CUSTOMER_CARE",
|
|
"2FA"
|
|
],"sample description text should 40 character",false,false,false,false,true,true,true,"sample1 should be 20 minimum character","sample2 should be 20 minimum character", "message_flow should be 40 minimum character", "help_message should be 20 minimum character", "optout_message should be 20 minimum character")
|
|
.then(function (campaign) {
|
|
assert.equal(campaign.campaignId, 'CFSOBZQ')
|
|
})
|
|
});
|
|
}); |