small refactor

This commit is contained in:
Carlos Jimenez 2018-08-17 09:29:00 +02:00
parent 4fff408e68
commit a6be927a1f
1 changed files with 8 additions and 8 deletions

View File

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