From c312374c3e497c64c9ffdd87f7142805cdfe1920 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Fri, 5 Apr 2019 13:58:50 +0200 Subject: [PATCH] added sms back unit test --- .../client/back/methods/sms/specs/send.spec.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 modules/client/back/methods/sms/specs/send.spec.js diff --git a/modules/client/back/methods/sms/specs/send.spec.js b/modules/client/back/methods/sms/specs/send.spec.js new file mode 100644 index 000000000..75361ba02 --- /dev/null +++ b/modules/client/back/methods/sms/specs/send.spec.js @@ -0,0 +1,16 @@ +const app = require('vn-loopback/server/server'); + +/** + * ¡Importante! + * Envio SMS de prueba a servicio real Masmovil. No llega a enviarse + * por destinatario inválido, pero puede llegar a fallar. + */ +fdescribe('sms send()', () => { + it('should call the send method', async() => { + let ctx = {req: {accessToken: {userId: 1}}}; + let result = await app.models.Sms.send(ctx, null, 'Invalid', 'My SMS Body'); + + expect(result.statusCode).toEqual(200); + expect(result.status).toEqual('Envio en procesamiento'); + }); +});