refactor & fix regularize claim and prices Diff
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2020-09-29 13:28:02 +02:00
parent 40abd68734
commit 1e55632b94
2 changed files with 4 additions and 8 deletions

View File

@ -1,7 +1,6 @@
const app = require('vn-loopback/server/server');
// #2457 fix regularizeClaim unit test
xdescribe('regularizeClaim()', () => {
describe('regularizeClaim()', () => {
const claimFk = 1;
const pendentState = 1;
const resolvedState = 3;
@ -26,7 +25,6 @@ xdescribe('regularizeClaim()', () => {
done();
});
// #2457 fix regularizeClaim unit test (this one fails)
it('should send a chat message with value "Trash" and then change claim state to resolved', async() => {
const ctx = {
req: {
@ -46,9 +44,8 @@ xdescribe('regularizeClaim()', () => {
ticketFk: 1
});
claimEnds.forEach(async claimEnd => {
claimEnd.updateAttributes({claimDestinationFk: trashDestination});
});
for (claimEnd of claimEnds)
await claimEnd.updateAttributes({claimDestinationFk: trashDestination});
let claimBefore = await app.models.Claim.findById(claimFk);
await app.models.Claim.regularizeClaim(ctx, claimFk);

View File

@ -17,8 +17,7 @@ describe('sale priceDifference()', () => {
let result = await app.models.Ticket.priceDifference(httpCtx, ticketId, landed,
addressId, agencyModeId, zoneId, warehouseId);
expect(result.totalUnitPrice).toEqual(215.78);
expect(result.totalNewPrice).toEqual(215.78);
expect(result.totalUnitPrice).toEqual(result.totalNewPrice);
expect(result.totalDifference).toEqual(0);
});