salix/back/methods/user-config/specs/getUserConfig.spec.js

22 lines
652 B
JavaScript

const models = require('vn-loopback/server/server').models;
describe('userConfig getUserConfig()', () => {
const ctx = beforeAll.getCtx();
it(`should return the configuration data of a given user`, async() => {
const tx = await models.Item.beginTransaction({});
const options = {transaction: tx};
try {
const result = await models.UserConfig.getUserConfig(ctx, options);
expect(result.warehouseFk).toEqual(1);
expect(result.companyFk).toEqual(442);
await tx.rollback();
} catch (e) {
await tx.rollback();
throw e;
}
});
});