refs #4928 findById

This commit is contained in:
Alexandre Riera 2022-12-16 12:50:09 +01:00
parent 522000cd04
commit b72cb64bf8
1 changed files with 4 additions and 4 deletions

View File

@ -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);