22 lines
680 B
JavaScript
22 lines
680 B
JavaScript
const app = require(`${servicesDir}/order/server/server`);
|
|
|
|
describe('order isEditable()', () => {
|
|
it('should return false when the given order is not editable', async() => {
|
|
let isEditable = await app.models.Order.isEditable(2);
|
|
|
|
expect(isEditable).toBeFalsy();
|
|
});
|
|
|
|
it('should return false when the given order doesnt exists', async() => {
|
|
let isEditable = await app.models.Order.isEditable(99999);
|
|
|
|
expect(isEditable).toBeFalsy();
|
|
});
|
|
|
|
it('should return true when the given order is editable', async() => {
|
|
let isEditable = await app.models.Order.isEditable(16);
|
|
|
|
expect(isEditable).toBeTruthy();
|
|
});
|
|
});
|