WIP: 6802-Clientes-gestionados-por-equipos #2516

Draft
carlosap wants to merge 6 commits from 6802-Clientes-gestionados-por-equipos into dev
3 changed files with 10 additions and 10 deletions
Showing only changes of commit d149dcf3bd - Show all commits

View File

@ -41,7 +41,7 @@ module.exports = Self => {
relation: 'claimDestination',
fields: ['addressFk']
},
where: {claimFk: claimFk}
where: {claimFk}
}, myOptions);
for (let claimEnd of claimEnds) {

View File

@ -55,7 +55,7 @@ describe('claim regularizeClaim()', () => {
expect(trashTicket.addressFk).toEqual(trashAddress);
expect(claimBefore.claimStateFk).toEqual(pendentState);
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);
await tx.rollback();
@ -80,7 +80,7 @@ describe('claim regularizeClaim()', () => {
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);
await tx.rollback();
@ -105,7 +105,7 @@ describe('claim regularizeClaim()', () => {
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);
await tx.rollback();

View File

@ -16,8 +16,8 @@ describe('Client Model', () => {
const ctx = {req: activeCtx};
const chatModel = models.Chat;
const instance = {id: 1101, name: 'Bruce Banner'};
const previousDepartmetnId = 80; // jvp_equipo
const currentDepartmetnId = 94; // jes_equipo
const previousDepartmetnId = 80; // es5_equipo
const currentDepartmetnId = 94; // es2_equipo
beforeEach(() => {
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
@ -31,8 +31,8 @@ describe('Client Model', () => {
await models.Client.notifyAssignment(instance, previousDepartmetnId, currentDepartmetnId);
expect(chatModel.send).toHaveBeenCalledWith(ctx, '@jvp_equipo', `Client assignment has changed`);
expect(chatModel.send).toHaveBeenCalledWith(ctx, '@jes_equipo', `Client assignment has changed`);
expect(chatModel.send).toHaveBeenCalledWith(ctx, '@es5_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() => {
@ -40,7 +40,7 @@ describe('Client Model', () => {
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() => {
@ -48,7 +48,7 @@ describe('Client Model', () => {
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`);
});
});