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

22 lines
652 B
JavaScript
Raw Normal View History

const models = require('vn-loopback/server/server').models;
2018-10-08 09:03:28 +00:00
describe('userConfig getUserConfig()', () => {
2024-06-14 06:39:57 +00:00
const ctx = beforeAll.getCtx();
2018-10-08 09:03:28 +00:00
it(`should return the configuration data of a given user`, async() => {
const tx = await models.Item.beginTransaction({});
const options = {transaction: tx};
2021-05-25 07:25:22 +00:00
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;
}
2018-10-08 09:03:28 +00:00
});
});