This commit is contained in:
parent
dc897854a4
commit
d149dcf3bd
|
@ -41,7 +41,7 @@ module.exports = Self => {
|
||||||
relation: 'claimDestination',
|
relation: 'claimDestination',
|
||||||
fields: ['addressFk']
|
fields: ['addressFk']
|
||||||
},
|
},
|
||||||
where: {claimFk: claimFk}
|
where: {claimFk}
|
||||||
}, myOptions);
|
}, myOptions);
|
||||||
|
|
||||||
for (let claimEnd of claimEnds) {
|
for (let claimEnd of claimEnds) {
|
||||||
|
|
|
@ -55,7 +55,7 @@ describe('claim regularizeClaim()', () => {
|
||||||
expect(trashTicket.addressFk).toEqual(trashAddress);
|
expect(trashTicket.addressFk).toEqual(trashAddress);
|
||||||
expect(claimBefore.claimStateFk).toEqual(pendentState);
|
expect(claimBefore.claimStateFk).toEqual(pendentState);
|
||||||
expect(claimAfter.claimStateFk).toEqual(resolvedState);
|
expect(claimAfter.claimStateFk).toEqual(resolvedState);
|
||||||
expect(chatModel.send).toHaveBeenCalledWith(ctx, '@jvp_equipo', 'Trash');
|
expect(chatModel.send).toHaveBeenCalledWith(ctx, '@es5_equipo', 'Trash');
|
||||||
expect(chatModel.send).toHaveBeenCalledTimes(4);
|
expect(chatModel.send).toHaveBeenCalledTimes(4);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
@ -80,7 +80,7 @@ describe('claim regularizeClaim()', () => {
|
||||||
|
|
||||||
await models.Claim.regularizeClaim(ctx, claimId, options);
|
await models.Claim.regularizeClaim(ctx, claimId, options);
|
||||||
|
|
||||||
expect(chatModel.send).toHaveBeenCalledWith(ctx, '@jvp_equipo', 'Bueno');
|
expect(chatModel.send).toHaveBeenCalledWith(ctx, '@es5_equipo', 'Bueno');
|
||||||
expect(chatModel.send).toHaveBeenCalledTimes(4);
|
expect(chatModel.send).toHaveBeenCalledTimes(4);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
@ -105,7 +105,7 @@ describe('claim regularizeClaim()', () => {
|
||||||
|
|
||||||
await models.Claim.regularizeClaim(ctx, claimId, options);
|
await models.Claim.regularizeClaim(ctx, claimId, options);
|
||||||
|
|
||||||
expect(chatModel.send).toHaveBeenCalledWith(ctx, '@jvp_equipo', 'Bueno');
|
expect(chatModel.send).toHaveBeenCalledWith(ctx, '@es5_equipo', 'Bueno');
|
||||||
expect(chatModel.send).toHaveBeenCalledTimes(4);
|
expect(chatModel.send).toHaveBeenCalledTimes(4);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
|
|
@ -16,8 +16,8 @@ describe('Client Model', () => {
|
||||||
const ctx = {req: activeCtx};
|
const ctx = {req: activeCtx};
|
||||||
const chatModel = models.Chat;
|
const chatModel = models.Chat;
|
||||||
const instance = {id: 1101, name: 'Bruce Banner'};
|
const instance = {id: 1101, name: 'Bruce Banner'};
|
||||||
const previousDepartmetnId = 80; // jvp_equipo
|
const previousDepartmetnId = 80; // es5_equipo
|
||||||
const currentDepartmetnId = 94; // jes_equipo
|
const currentDepartmetnId = 94; // es2_equipo
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||||
|
@ -31,8 +31,8 @@ describe('Client Model', () => {
|
||||||
|
|
||||||
await models.Client.notifyAssignment(instance, previousDepartmetnId, currentDepartmetnId);
|
await models.Client.notifyAssignment(instance, previousDepartmetnId, currentDepartmetnId);
|
||||||
|
|
||||||
expect(chatModel.send).toHaveBeenCalledWith(ctx, '@jvp_equipo', `Client assignment has changed`);
|
expect(chatModel.send).toHaveBeenCalledWith(ctx, '@es5_equipo', `Client assignment has changed`);
|
||||||
expect(chatModel.send).toHaveBeenCalledWith(ctx, '@jes_equipo', `Client assignment has changed`);
|
expect(chatModel.send).toHaveBeenCalledWith(ctx, '@es2_equipo', `Client assignment has changed`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should call to the Chat send() method for the previous worker', async() => {
|
it('should call to the Chat send() method for the previous worker', async() => {
|
||||||
|
@ -40,7 +40,7 @@ describe('Client Model', () => {
|
||||||
|
|
||||||
await models.Client.notifyAssignment(instance, null, currentDepartmetnId);
|
await models.Client.notifyAssignment(instance, null, currentDepartmetnId);
|
||||||
|
|
||||||
expect(chatModel.send).toHaveBeenCalledWith(ctx, '@jes_equipo', `Client assignment has changed`);
|
expect(chatModel.send).toHaveBeenCalledWith(ctx, '@es2_equipo', `Client assignment has changed`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should call to the Chat send() method for the current worker', async() => {
|
it('should call to the Chat send() method for the current worker', async() => {
|
||||||
|
@ -48,7 +48,7 @@ describe('Client Model', () => {
|
||||||
|
|
||||||
await models.Client.notifyAssignment(instance, previousDepartmetnId, null);
|
await models.Client.notifyAssignment(instance, previousDepartmetnId, null);
|
||||||
|
|
||||||
expect(chatModel.send).toHaveBeenCalledWith(ctx, '@jvp_equipo', `Client assignment has changed`);
|
expect(chatModel.send).toHaveBeenCalledWith(ctx, '@es5_equipo', `Client assignment has changed`);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue