This commit is contained in:
parent
7bcd4b53e5
commit
55ea445f02
|
@ -20,7 +20,7 @@ describe('sale updateDiscount()', () => {
|
|||
|
||||
afterAll(async done => {
|
||||
await originalSale.save();
|
||||
await createdSaleComponent.destroy();
|
||||
await app.models.SaleComponent.updateAll({componentFk: componentId, saleFk: originalSaleId}, {value: 0});
|
||||
await salesPersonMana.save();
|
||||
|
||||
done();
|
||||
|
@ -73,15 +73,6 @@ describe('sale updateDiscount()', () => {
|
|||
});
|
||||
|
||||
it('should update the discount if the salesPerson has mana', async() => {
|
||||
createdSaleComponent = await app.models.SaleComponent.findOne({
|
||||
where: {
|
||||
componentFk: componentId,
|
||||
saleFk: originalSaleId
|
||||
}
|
||||
});
|
||||
|
||||
expect(createdSaleComponent).toBeNull();
|
||||
|
||||
const ticketId = 8;
|
||||
const sales = [originalSaleId];
|
||||
const newDiscount = 100;
|
||||
|
@ -89,7 +80,7 @@ describe('sale updateDiscount()', () => {
|
|||
await app.models.Ticket.updateDiscount(ticketId, sales, newDiscount);
|
||||
|
||||
let updatedSale = await app.models.Sale.findById(originalSaleId);
|
||||
createdSaleComponent = await app.models.SaleComponent.findOne({
|
||||
let createdSaleComponent = await app.models.SaleComponent.findOne({
|
||||
where: {
|
||||
componentFk: componentId,
|
||||
saleFk: originalSaleId
|
||||
|
|
Loading…
Reference in New Issue