salix/loopback/common/methods/vn-model/specs/getSetValues.spec.js

24 lines
815 B
JavaScript
Raw Normal View History

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