refs #6213 newSuplierSpec
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
55b53c86c4
commit
cdf0951a1b
|
@ -124,4 +124,22 @@ describe('loopback model Supplier', () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('after save observer', () => {
|
||||||
|
fit('should update the account attribute when a new supplier is created', async() => {
|
||||||
|
const tx = await models.Supplier.beginTransaction({});
|
||||||
|
const options = {transaction: tx};
|
||||||
|
|
||||||
|
try {
|
||||||
|
const newSupplier = await models.Supplier.create({id: '6969', name: 'Alfred Pennyworth'}, options);
|
||||||
|
const fetchedSupplier = await models.Supplier.findById(newSupplier.id, null, options);
|
||||||
|
|
||||||
|
expect(fetchedSupplier.account).toEqual('4100006969');
|
||||||
|
await tx.rollback();
|
||||||
|
} catch (e) {
|
||||||
|
await tx.rollback();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue