25 lines
724 B
JavaScript
25 lines
724 B
JavaScript
const models = require('vn-loopback/server/server').models;
|
|
|
|
describe('client sendSms()', () => {
|
|
const ctx = beforeAll.getCtx();
|
|
it('should now send a message and log it', async() => {
|
|
const tx = await models.Client.beginTransaction({});
|
|
|
|
try {
|
|
const options = {transaction: tx};
|
|
const id = 1101;
|
|
const destination = 222222222;
|
|
const message = 'this is the message created in a test';
|
|
|
|
const sms = await models.Client.sendSms(ctx, id, destination, message, options);
|
|
|
|
expect(sms).toBeDefined();
|
|
|
|
await tx.rollback();
|
|
} catch (e) {
|
|
await tx.rollback();
|
|
throw e;
|
|
}
|
|
});
|
|
});
|