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

24 lines
818 B
JavaScript
Raw Normal View History

2018-12-21 11:50:28 +00:00
const app = require(`${serviceRoot}/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');
});
});