From 30912bd5e9c9fd9b335ce1461a32f7aef69a8097 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Tue, 16 Jun 2020 15:11:24 +0200 Subject: [PATCH] Removed sms excluded tests --- .../back/methods/client/specs/sendSms.spec.js | 28 -------------- modules/client/back/methods/sms/send.spec.js | 38 ------------------- .../back/methods/ticket/specs/sendSms.spec.js | 28 -------------- 3 files changed, 94 deletions(-) delete mode 100644 modules/client/back/methods/client/specs/sendSms.spec.js delete mode 100644 modules/client/back/methods/sms/send.spec.js delete mode 100644 modules/ticket/back/methods/ticket/specs/sendSms.spec.js diff --git a/modules/client/back/methods/client/specs/sendSms.spec.js b/modules/client/back/methods/client/specs/sendSms.spec.js deleted file mode 100644 index e38a1408c..000000000 --- a/modules/client/back/methods/client/specs/sendSms.spec.js +++ /dev/null @@ -1,28 +0,0 @@ -const app = require('vn-loopback/server/server'); - -// #2294 - TLS version error -xdescribe('client sendSms()', () => { - let createdLog; - - afterAll(async done => { - await app.models.ClientLog.destroyById(createdLog.id); - - done(); - }); - - it('should send a message and log it', async() => { - let ctx = {req: {accessToken: {userId: 9}}}; - let id = 101; - let destination = 222222222; - let message = 'this is the message created in a test'; - - let sms = await app.models.Client.sendSms(ctx, id, destination, message); - - logId = sms.logId; - - createdLog = await app.models.ClientLog.findById(logId); - let json = JSON.parse(JSON.stringify(createdLog.newInstance)); - - expect(json.message).toEqual(message); - }); -}); diff --git a/modules/client/back/methods/sms/send.spec.js b/modules/client/back/methods/sms/send.spec.js deleted file mode 100644 index 4a81b3e24..000000000 --- a/modules/client/back/methods/sms/send.spec.js +++ /dev/null @@ -1,38 +0,0 @@ -const app = require('vn-loopback/server/server'); -const soap = require('soap'); - -// #2294 - TLS version error -xdescribe('sms send()', () => { - it('should return the expected message and status code', async() => { - const code = 200; - const smsConfig = await app.models.SmsConfig.findOne(); - const soapClient = await soap.createClientAsync(smsConfig.uri); - spyOn(soap, 'createClientAsync').and.returnValue(soapClient); - spyOn(soapClient, 'sendSMSAsync').and.returnValue([{ - result: { - $value: - ` - - - ${code} - - - Envio en procesamiento - - - 1 - - - - 444328681 - - ` - } - }]); - let ctx = {req: {accessToken: {userId: 1}}}; - let result = await app.models.Sms.send(ctx, 105, 'destination', 'My SMS Body'); - - expect(result.statusCode).toEqual(200); - expect(result.status).toContain('Fake response'); - }); -}); diff --git a/modules/ticket/back/methods/ticket/specs/sendSms.spec.js b/modules/ticket/back/methods/ticket/specs/sendSms.spec.js deleted file mode 100644 index 8dedb59f8..000000000 --- a/modules/ticket/back/methods/ticket/specs/sendSms.spec.js +++ /dev/null @@ -1,28 +0,0 @@ -const app = require('vn-loopback/server/server'); - -// #2294 - TLS version error -xdescribe('ticket sendSms()', () => { - let logId; - - afterAll(async done => { - await app.models.TicketLog.destroyById(logId); - - done(); - }); - - it('should send a message and log it', async() => { - let ctx = {req: {accessToken: {userId: 9}}}; - let id = 11; - let destination = 222222222; - let message = 'this is the message created in a test'; - - let sms = await app.models.Ticket.sendSms(ctx, id, destination, message); - - logId = sms.logId; - - let createdLog = await app.models.TicketLog.findById(logId); - let json = JSON.parse(JSON.stringify(createdLog.newInstance)); - - expect(json.message).toEqual(message); - }); -});