2018-08-07 13:48:55 +00:00
|
|
|
const app = require(`../../../../server/server`);
|
|
|
|
|
2018-09-17 11:13:33 +00:00
|
|
|
xdescribe('order removes()', () => {
|
2018-08-07 13:48:55 +00:00
|
|
|
it('should throw an error if rows property is empty', async() => {
|
|
|
|
let error;
|
|
|
|
try {
|
|
|
|
await app.models.OrderRow.removes({rows: []});
|
|
|
|
} catch (e) {
|
|
|
|
error = e;
|
|
|
|
}
|
|
|
|
|
|
|
|
expect(error).toEqual(new Error('There is nothing delete'));
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should throw an error if the row selected is not editable', async() => {
|
|
|
|
let error;
|
|
|
|
try {
|
|
|
|
await app.models.OrderRow.removes({rows: [2]});
|
|
|
|
} catch (e) {
|
|
|
|
error = e;
|
|
|
|
}
|
|
|
|
|
|
|
|
expect(error).toEqual(new Error('This order is not editable'));
|
|
|
|
});
|
|
|
|
});
|