salix/modules/client/back/methods/sms/send.spec.js

15 lines
552 B
JavaScript
Raw Normal View History

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