Removed sms excluded tests
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
7d2e11863f
commit
30912bd5e9
|
@ -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);
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -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:
|
|
||||||
`<xtratelecom-sms-response>
|
|
||||||
<sms>
|
|
||||||
<codigo>
|
|
||||||
${code}
|
|
||||||
</codigo>
|
|
||||||
<descripcion>
|
|
||||||
Envio en procesamiento
|
|
||||||
</descripcion>
|
|
||||||
<messageId>
|
|
||||||
1
|
|
||||||
</messageId>
|
|
||||||
</sms>
|
|
||||||
<procesoId>
|
|
||||||
444328681
|
|
||||||
</procesoId>
|
|
||||||
</xtratelecom-sms-response>`
|
|
||||||
}
|
|
||||||
}]);
|
|
||||||
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');
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -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);
|
|
||||||
});
|
|
||||||
});
|
|
Loading…
Reference in New Issue