7152-devToTest_2414 #2228

Merged
alexm merged 636 commits from 7152-devToTest_2414 into test 2024-03-28 08:26:34 +00:00
3 changed files with 34 additions and 3 deletions
Showing only changes of commit 19edd7868e - Show all commits

View File

@ -0,0 +1,29 @@
const {models} = require('vn-loopback/server/server');
describe('mobileAppVersionControl getVersion()', () => {
const appName = 'delivery';
beforeAll(async() => {
ctx = {
req: {
accessToken: {},
headers: {origin: 'http://localhost'},
}
};
});
it('should get the version app', async() => {
ctx.req.accessToken.userId = 9;
const {version, versionBeta} = await models.MobileAppVersionControl.getVersion(ctx, appName);
expect(version).toEqual('9.2');
expect(versionBeta).toBeUndefined();
});
it('should get the beta version app', async() => {
const {version, versionBeta} = await models.MobileAppVersionControl.getVersion(ctx, appName);
ctx.req.accessToken.userId = 66;
expect(versionBeta).toBeDefined();
expect(version).toBeUndefined();
});
});

View File

@ -2716,10 +2716,10 @@ INSERT INTO `vn`.`chat` (`senderFk`, `recipient`, `dated`, `checkUserStatus`, `m
(1101, '@PetterParker', util.VN_CURDATE(), 0, 'Second test message', 0, 'pending');
INSERT INTO `vn`.`mobileAppVersionControl` (`appName`, `version`, `isVersionCritical`)
INSERT INTO `vn`.`mobileAppVersionControl` (`appName`, `version`, `isVersionCritical`,`versionBeta`)
VALUES
('delivery', '9.2', 0),
('warehouse', '8.1', 0);
('delivery', '9.2', 0,'9.7'),
('warehouse', '8.1', 0,'8.3');
INSERT INTO `vn`.`machine` (`plate`, `maker`, `model`, `warehouseFk`, `departmentFk`, `type`, `use`, `productionYear`, `workerFk`, `companyFk`)
VALUES
@ -3699,3 +3699,5 @@ UPDATE vn.sale
INSERT INTO machineWorkerConfig(maxHours)
VALUES(12);
INSERT INTO workerAppTester(workerFk) VALUES(66)