fixed karma tests
gitea/salix/dev This commit looks good
Details
gitea/salix/dev This commit looks good
Details
This commit is contained in:
parent
eac9980ee3
commit
6573e61a7c
|
@ -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');
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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('');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue