From 6573e61a7c8d63acd834155b883e9a1517dd4334 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Tue, 16 Apr 2019 08:21:20 +0200 Subject: [PATCH] fixed karma tests --- modules/client/back/methods/sms/specs/send.spec.js | 2 +- modules/client/front/sms/index.spec.js | 4 ++-- modules/ticket/front/sale/index.spec.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/client/back/methods/sms/specs/send.spec.js b/modules/client/back/methods/sms/specs/send.spec.js index 0045b148a..475e9fc1c 100644 --- a/modules/client/back/methods/sms/specs/send.spec.js +++ b/modules/client/back/methods/sms/specs/send.spec.js @@ -8,7 +8,7 @@ const app = require('vn-loopback/server/server'); describe('sms send()', () => { it('should should return the expected message and status code', async() => { let ctx = {req: {accessToken: {userId: 1}}}; - let result = await app.models.Sms.send(ctx, null, 'Invalid', 'My SMS Body'); + let result = await app.models.Sms.send(ctx, 101, 'Invalid', 'My SMS Body'); expect(result.statusCode).toEqual(200); expect(result.status).toEqual('Envio en procesamiento'); diff --git a/modules/client/front/sms/index.spec.js b/modules/client/front/sms/index.spec.js index e8f530025..a1f18c23f 100644 --- a/modules/client/front/sms/index.spec.js +++ b/modules/client/front/sms/index.spec.js @@ -17,8 +17,8 @@ describe('Client', () => { describe('onResponse()', () => { it('should perform a POST query and show a success snackbar', () => { - let params = {recipient: 111111111, message: 'My SMS'}; - controller.sms = {recipient: 111111111, message: 'My SMS'}; + let params = {destinationFk: 101, destination: 111111111, message: 'My SMS'}; + controller.sms = {destinationFk: 101, destination: 111111111, message: 'My SMS'}; spyOn(controller.vnApp, 'showMessage'); $httpBackend.when('POST', `/client/api/Sms/send`, params).respond(200, params); diff --git a/modules/ticket/front/sale/index.spec.js b/modules/ticket/front/sale/index.spec.js index 113e29c80..23bc4b809 100644 --- a/modules/ticket/front/sale/index.spec.js +++ b/modules/ticket/front/sale/index.spec.js @@ -180,7 +180,7 @@ describe('Ticket', () => { controller.showSMSDialog(); expect(controller.$scope.sms.open).toHaveBeenCalledWith(); - expect(controller.newSMS.recipient).toEqual(111111111); + expect(controller.newSMS.destination).toEqual(111111111); expect(controller.newSMS.message).not.toEqual(''); }); });