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

22 lines
675 B
JavaScript
Raw Permalink Normal View History

const models = require('vn-loopback/server/server').models;
2018-10-08 09:03:28 +00:00
describe('userConfig getUserConfig()', () => {
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 ctx = {req: {accessToken: {userId: 9}}};
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
});
});