salix/back/methods/sms/specs/send.spec.js

18 lines
596 B
JavaScript

const app = require('vn-loopback/server/server');
describe('sms send()', () => {
it('should not return status error', async() => {
const ctx = {req: {accessToken: {userId: 1}}};
const result = await app.models.Sms.send(ctx, '123456789', 'My SMS Body', {insert: true});
expect(result.status).toBeUndefined();
});
it('should not insert', async() => {
const ctx = {req: {accessToken: {userId: 1}}};
const result = await app.models.Sms.send(ctx, '123456789', 'My SMS Body', {insert: false});
expect(result).toBeUndefined();
});
});