3430-ticket_step-two ticket without negatives #823
|
@ -80,10 +80,11 @@ describe('sale priceDifference()', () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const result = await models.Ticket.priceDifference(ctx, options);
|
const result = await models.Ticket.priceDifference(ctx, options);
|
||||||
console.log(result.items[0]);
|
const firstItem = result.items[0];
|
||||||
|
const secondtItem = result.items[1];
|
||||||
|
|
||||||
expect(result.totalUnitPrice).toEqual(result.totalNewPrice);
|
expect(firstItem.visible).toEqual(445);
|
||||||
expect(result.totalDifference).toEqual(0);
|
expect(secondtItem.visible).toEqual(1980);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -64,5 +64,22 @@ describe('Ticket', () => {
|
||||||
expect(controller.totalPriceDifference).toEqual(0.3);
|
expect(controller.totalPriceDifference).toEqual(0.3);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
fdescribe('ticketHaveNegatives()', () => {
|
||||||
|
it('should show if ticket have any negative', () => {
|
||||||
|
controller.ticket = {
|
||||||
|
sale: {
|
||||||
|
items: [{
|
||||||
|
quantity: 2,
|
||||||
|
visible: 1
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
controller.ticketHaveNegatives();
|
||||||
|
|
||||||
|
expect(controller.haveNegatives).toEqual(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue