getUserConfig now gets default company and warehouse with dynamic code #632

Merged
joan merged 3 commits from 2923_getUserConfig_default_warehouse_and_company into dev 2021-05-25 09:15:27 +00:00
1 changed files with 4 additions and 4 deletions
Showing only changes of commit ec86e908e1 - Show all commits

View File

@ -2,9 +2,9 @@ const app = require('vn-loopback/server/server');
describe('userConfig getUserConfig()', () => {
it(`should return the configuration data of a given user`, async() => {
await app.models.UserConfig.getUserConfig({req: {accessToken: {userId: 9}}})
.then(response => {
expect(response.warehouseFk).toEqual(1);
});
const result = await app.models.UserConfig.getUserConfig({req: {accessToken: {userId: 9}}});
expect(result.warehouseFk).toEqual(1);
expect(result.companyFk).toEqual(442);
});
});