2020-06-17 12:00:04 +00:00
|
|
|
const app = require('vn-loopback/server/server');
|
|
|
|
const soap = require('soap');
|
|
|
|
|
2020-12-31 10:17:42 +00:00
|
|
|
describe('sms send()', () => {
|
2020-06-17 12:00:04 +00:00
|
|
|
it('should return the expected message and status code', async() => {
|
|
|
|
const code = 200;
|
2021-04-16 10:40:41 +00:00
|
|
|
spyOn(soap, 'createClientAsync').and.returnValue('a so fake client');
|
2020-06-17 12:00:04 +00:00
|
|
|
let ctx = {req: {accessToken: {userId: 1}}};
|
|
|
|
let result = await app.models.Sms.send(ctx, 105, 'destination', 'My SMS Body');
|
|
|
|
|
2021-04-16 10:40:41 +00:00
|
|
|
expect(result.statusCode).toEqual(code);
|
2020-06-17 12:00:04 +00:00
|
|
|
expect(result.status).toContain('Fake response');
|
|
|
|
});
|
|
|
|
});
|