small refactor
This commit is contained in:
parent
4fff408e68
commit
a6be927a1f
|
@ -4,22 +4,22 @@ const UserError = require('vn-loopback/common/helpers').UserError;
|
||||||
describe('order isEditable()', () => {
|
describe('order isEditable()', () => {
|
||||||
it('should throw an error if the order given is not editable', async() => {
|
it('should throw an error if the order given is not editable', async() => {
|
||||||
let error;
|
let error;
|
||||||
try {
|
|
||||||
await app.models.Order.isEditable(2);
|
await app.models.Order.isEditable(2)
|
||||||
} catch (e) {
|
.catch(e => {
|
||||||
error = e;
|
error = e;
|
||||||
}
|
});
|
||||||
|
|
||||||
expect(error).toEqual(new UserError('This order is not editable'));
|
expect(error).toEqual(new UserError('This order is not editable'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should throw an error if the order given does not exists', async() => {
|
it('should throw an error if the order given does not exists', async() => {
|
||||||
let error;
|
let error;
|
||||||
try {
|
|
||||||
await app.models.Order.isEditable(99999);
|
await app.models.Order.isEditable(99999)
|
||||||
} catch (e) {
|
.catch(e => {
|
||||||
error = e;
|
error = e;
|
||||||
}
|
});
|
||||||
|
|
||||||
expect(error).toEqual(new UserError('This order is not editable'));
|
expect(error).toEqual(new UserError('This order is not editable'));
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue