21 lines
518 B
JavaScript
21 lines
518 B
JavaScript
const models = require('vn-loopback/server/server').models;
|
|
|
|
describe('agency clone()', () => {
|
|
it('should clone a zone', async() => {
|
|
const tx = await models.Zone.beginTransaction({});
|
|
|
|
try {
|
|
const options = {transaction: tx};
|
|
const newZone = await models.Zone.clone(1, options);
|
|
|
|
expect(newZone.name).toEqual('Zone pickup A');
|
|
|
|
await tx.rollback();
|
|
} catch (e) {
|
|
await tx.rollback();
|
|
throw e;
|
|
}
|
|
});
|
|
});
|
|
|