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()', () => {
|
||||
it('should throw an error if the order given is not editable', async() => {
|
||||
let error;
|
||||
try {
|
||||
await app.models.Order.isEditable(2);
|
||||
} catch (e) {
|
||||
|
||||
await app.models.Order.isEditable(2)
|
||||
.catch(e => {
|
||||
error = e;
|
||||
}
|
||||
});
|
||||
|
||||
expect(error).toEqual(new UserError('This order is not editable'));
|
||||
});
|
||||
|
||||
it('should throw an error if the order given does not exists', async() => {
|
||||
let error;
|
||||
try {
|
||||
await app.models.Order.isEditable(99999);
|
||||
} catch (e) {
|
||||
|
||||
await app.models.Order.isEditable(99999)
|
||||
.catch(e => {
|
||||
error = e;
|
||||
}
|
||||
});
|
||||
|
||||
expect(error).toEqual(new UserError('This order is not editable'));
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue