2018-08-14 09:52:10 +00:00
|
|
|
const app = require(`${servicesDir}/order/server/server`);
|
2018-08-07 13:48:55 +00:00
|
|
|
|
|
|
|
describe('order isEditable()', () => {
|
2018-09-17 13:10:46 +00:00
|
|
|
it('should return false when the given order is not editable', async() => {
|
|
|
|
let isEditable = await app.models.Order.isEditable(2);
|
2018-08-17 07:29:00 +00:00
|
|
|
|
2018-09-17 13:10:46 +00:00
|
|
|
expect(isEditable).toBeFalsy();
|
2018-08-07 13:48:55 +00:00
|
|
|
});
|
|
|
|
|
2018-09-17 13:10:46 +00:00
|
|
|
it('should return false when the given order doesnt exists', async() => {
|
|
|
|
let isEditable = await app.models.Order.isEditable(99999);
|
|
|
|
|
|
|
|
expect(isEditable).toBeFalsy();
|
|
|
|
});
|
2018-08-17 07:29:00 +00:00
|
|
|
|
2018-09-17 13:10:46 +00:00
|
|
|
it('should return true when the given order is editable', async() => {
|
2018-10-03 06:12:34 +00:00
|
|
|
let isEditable = await app.models.Order.isEditable(16);
|
2018-08-07 13:48:55 +00:00
|
|
|
|
2018-09-17 13:10:46 +00:00
|
|
|
expect(isEditable).toBeTruthy();
|
2018-08-07 13:48:55 +00:00
|
|
|
});
|
|
|
|
});
|