fixed karma tests
gitea/salix/dev This commit looks good Details

This commit is contained in:
Joan Sanchez 2019-04-16 08:21:20 +02:00
parent eac9980ee3
commit 6573e61a7c
3 changed files with 4 additions and 4 deletions

View File

@ -8,7 +8,7 @@ const app = require('vn-loopback/server/server');
describe('sms send()', () => { describe('sms send()', () => {
it('should should return the expected message and status code', async() => { it('should should return the expected message and status code', async() => {
let ctx = {req: {accessToken: {userId: 1}}}; 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.statusCode).toEqual(200);
expect(result.status).toEqual('Envio en procesamiento'); expect(result.status).toEqual('Envio en procesamiento');

View File

@ -17,8 +17,8 @@ describe('Client', () => {
describe('onResponse()', () => { describe('onResponse()', () => {
it('should perform a POST query and show a success snackbar', () => { it('should perform a POST query and show a success snackbar', () => {
let params = {recipient: 111111111, message: 'My SMS'}; let params = {destinationFk: 101, destination: 111111111, message: 'My SMS'};
controller.sms = {recipient: 111111111, message: 'My SMS'}; controller.sms = {destinationFk: 101, destination: 111111111, message: 'My SMS'};
spyOn(controller.vnApp, 'showMessage'); spyOn(controller.vnApp, 'showMessage');
$httpBackend.when('POST', `/client/api/Sms/send`, params).respond(200, params); $httpBackend.when('POST', `/client/api/Sms/send`, params).respond(200, params);

View File

@ -180,7 +180,7 @@ describe('Ticket', () => {
controller.showSMSDialog(); controller.showSMSDialog();
expect(controller.$scope.sms.open).toHaveBeenCalledWith(); expect(controller.$scope.sms.open).toHaveBeenCalledWith();
expect(controller.newSMS.recipient).toEqual(111111111); expect(controller.newSMS.destination).toEqual(111111111);
expect(controller.newSMS.message).not.toEqual(''); expect(controller.newSMS.message).not.toEqual('');
}); });
}); });