diff --git a/modules/supplier/back/models/specs/supplier.spec.js b/modules/supplier/back/models/specs/supplier.spec.js index 1e8efb4b1..f317f1fb9 100644 --- a/modules/supplier/back/models/specs/supplier.spec.js +++ b/modules/supplier/back/models/specs/supplier.spec.js @@ -73,7 +73,7 @@ describe('loopback model Supplier', () => { await supplierTwo.updateAttribute('isPayMethodChecked', true, options); await supplierTwo.updateAttribute('payMethodFk', 5, options); - const result = await models.Supplier.findOne({where: {id: 442}}, options); + const result = await models.Supplier.findById(442, null, options); expect(result.isPayMethodChecked).toEqual(true); await tx.rollback(); @@ -91,7 +91,7 @@ describe('loopback model Supplier', () => { await supplierTwo.updateAttribute('isPayMethodChecked', true, options); await supplierTwo.updateAttribute('payMethodFk', 2, options); - const result = await models.Supplier.findOne({where: {id: 442}}, options); + const result = await models.Supplier.findById(442, null, options); expect(result.isPayMethodChecked).toEqual(false); await tx.rollback(); @@ -109,11 +109,11 @@ describe('loopback model Supplier', () => { await supplierTwo.updateAttribute('payMethodFk', 2, options); await supplierTwo.updateAttribute('isPayMethodChecked', true, options); await supplierTwo.updateAttribute('payDay', 5, options); - const firstResult = await models.Supplier.findOne({where: {id: 442}}, options); + const firstResult = await models.Supplier.findById(442, null, options); await supplierTwo.updateAttribute('isPayMethodChecked', true, options); await supplierTwo.updateAttribute('payDemFk', 1, options); - const secondResult = await models.Supplier.findOne({where: {id: 442}}, options); + const secondResult = await models.Supplier.findById(442, null, options); expect(firstResult.isPayMethodChecked).toEqual(false); expect(secondResult.isPayMethodChecked).toEqual(false);