2019-01-24 08:08:28 +00:00
|
|
|
const app = require('vn-loopback/server/server');
|
2018-10-15 09:43:57 +00:00
|
|
|
|
|
|
|
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');
|
|
|
|
});
|
|
|
|
});
|