fixed unit test for upsertFixedPrice

This commit is contained in:
Carlos Jimenez Ruiz 2021-01-20 14:39:23 +01:00
parent f7cca6638a
commit fe04f00c28
1 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@ describe('upsertFixedPrice()', () => {
originalItem = await app.models.Item.findById(originalFixedPrice.itemFk);
});
beforeAll(async() => {
afterAll(async() => {
await originalFixedPrice.save();
await originalItem.save();
});
@ -19,7 +19,7 @@ describe('upsertFixedPrice()', () => {
it(`should toggle the hasMinPrice boolean if there's a minPrice and update the rest of the data`, async() => {
const ctx = {args: {
id: fixedPriceId,
itemFk: 1,
itemFk: originalFixedPrice.itemFk,
warehouseFk: 1,
rate2: 100,
rate3: 300,
@ -41,7 +41,7 @@ describe('upsertFixedPrice()', () => {
it(`should toggle the hasMinPrice boolean if there's no minPrice and update the rest of the data`, async() => {
const ctx = {args: {
id: fixedPriceId,
itemFk: 1,
itemFk: originalFixedPrice.itemFk,
warehouseFk: 1,
rate2: 2.5,
rate3: 2,