half test
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
e01d676bb1
commit
3e91929d0d
|
@ -59,4 +59,36 @@ describe('sale priceDifference()', () => {
|
||||||
|
|
||||||
expect(error).toEqual(new UserError(`The sales of this ticket can't be modified`));
|
expect(error).toEqual(new UserError(`The sales of this ticket can't be modified`));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should return ticket visible', async() => {
|
||||||
|
const tx = await models.Ticket.beginTransaction({});
|
||||||
|
|
||||||
|
try {
|
||||||
|
const options = {transaction: tx};
|
||||||
|
|
||||||
|
const tomorrow = new Date();
|
||||||
|
tomorrow.setDate(tomorrow.getDate() + 1);
|
||||||
|
|
||||||
|
const ctx = {req: {accessToken: {userId: 1106}}};
|
||||||
|
ctx.args = {
|
||||||
|
id: 11,
|
||||||
|
landed: tomorrow,
|
||||||
|
addressId: 122,
|
||||||
|
agencyModeId: 7,
|
||||||
|
zoneId: 3,
|
||||||
|
warehouseId: 1
|
||||||
|
};
|
||||||
|
|
||||||
|
const result = await models.Ticket.priceDifference(ctx, options);
|
||||||
|
console.log(result.items[0]);
|
||||||
|
|
||||||
|
expect(result.totalUnitPrice).toEqual(result.totalNewPrice);
|
||||||
|
expect(result.totalDifference).toEqual(0);
|
||||||
|
|
||||||
|
await tx.rollback();
|
||||||
|
} catch (e) {
|
||||||
|
await tx.rollback();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue