24 lines
824 B
JavaScript
24 lines
824 B
JavaScript
|
const app = require('../../../../../order/server/server');
|
||
|
|
||
|
describe('Model getSetValues()', () => {
|
||
|
it('should extend getSetValues properties to any model passed', () => {
|
||
|
let exampleModel = app.models.Order;
|
||
|
|
||
|
expect(exampleModel.getSetValues).toBeDefined();
|
||
|
});
|
||
|
|
||
|
it('should return an array of set values from model column sourceApp', async() => {
|
||
|
let result = await app.models.Order.getSetValues('sourceApp');
|
||
|
|
||
|
expect(result.length).toEqual(6);
|
||
|
expect(result[5].value).toEqual('TABLET_VN');
|
||
|
});
|
||
|
|
||
|
it('should return an array of set values from table column source_app', async() => {
|
||
|
let result = await app.models.Order.getSetValues('source_app');
|
||
|
|
||
|
expect(result.length).toEqual(6);
|
||
|
expect(result[5].value).toEqual('TABLET_VN');
|
||
|
});
|
||
|
});
|