Merge pull request '2785-getBalance-tests' (#588) from 2785-getBalance-tests into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #588 Reviewed-by: Carlos Jimenez Ruiz <carlosjr@verdnatura.es>
This commit is contained in:
commit
b72357cb7d
|
@ -0,0 +1,31 @@
|
|||
const app = require('vn-loopback/server/server');
|
||||
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
|
||||
|
||||
describe('item_getBalance()', () => {
|
||||
it(`should return the item balance ordered by alert level`, async() => {
|
||||
let stmts = [];
|
||||
|
||||
let params = {
|
||||
warehouseFk: 1,
|
||||
itemFk: 1
|
||||
};
|
||||
|
||||
const conn = await app.models.Item.dataSource.connector;
|
||||
|
||||
stmts.push(new ParameterizedSQL('CALL vn.item_getBalance(?, ?)', [
|
||||
params.warehouseFk,
|
||||
params.itemFk
|
||||
]));
|
||||
|
||||
let sql = ParameterizedSQL.join(stmts, ';');
|
||||
let result = await conn.executeStmt(sql);
|
||||
let itemBalance = result[0];
|
||||
|
||||
expect(itemBalance[0].alertLevel).toBeGreaterThanOrEqual(itemBalance[1].alertLevel);
|
||||
expect(itemBalance[1].alertLevel).toBeGreaterThanOrEqual(itemBalance[2].alertLevel);
|
||||
expect(itemBalance[2].alertLevel).toBeGreaterThanOrEqual(itemBalance[3].alertLevel);
|
||||
expect(itemBalance[3].alertLevel).toBeGreaterThanOrEqual(itemBalance[4].alertLevel);
|
||||
expect(itemBalance[4].alertLevel).toBeGreaterThanOrEqual(itemBalance[5].alertLevel);
|
||||
expect(itemBalance[5].alertLevel).toBeGreaterThanOrEqual(itemBalance[6].alertLevel);
|
||||
});
|
||||
});
|
|
@ -9575,13 +9575,13 @@
|
|||
"dev": true
|
||||
},
|
||||
"jasmine-reporters": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/jasmine-reporters/-/jasmine-reporters-2.3.2.tgz",
|
||||
"integrity": "sha512-u/7AT9SkuZsUfFBLLzbErohTGNsEUCKaQbsVYnLFW1gEuL2DzmBL4n8v90uZsqIqlWvWUgian8J6yOt5Fyk/+A==",
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/jasmine-reporters/-/jasmine-reporters-2.4.0.tgz",
|
||||
"integrity": "sha512-jxONSrBLN1vz/8zCx5YNWQSS8iyDAlXQ5yk1LuqITe4C6iXCDx5u6Q0jfNtkKhL4qLZPe69fL+AWvXFt9/x38w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"mkdirp": "^0.5.1",
|
||||
"xmldom": "^0.1.22"
|
||||
"xmldom": "^0.5.0"
|
||||
}
|
||||
},
|
||||
"jasmine-spec-reporter": {
|
||||
|
@ -19907,7 +19907,7 @@
|
|||
},
|
||||
"globby": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/globby/-/globby-6.1.0.tgz",
|
||||
"integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -20470,9 +20470,9 @@
|
|||
"integrity": "sha1-+mv3YqYKQT+z3Y9LA8WyaSONMI8="
|
||||
},
|
||||
"xmldom": {
|
||||
"version": "0.1.31",
|
||||
"resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.31.tgz",
|
||||
"integrity": "sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ==",
|
||||
"version": "0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.5.0.tgz",
|
||||
"integrity": "sha512-Foaj5FXVzgn7xFzsKeNIde9g6aFBxTPi37iwsno8QvApmtg7KYrr+OPyRHcJF7dud2a5nGRBXK3n0dL62Gf7PA==",
|
||||
"dev": true
|
||||
},
|
||||
"xpath": {
|
||||
|
@ -20568,7 +20568,7 @@
|
|||
},
|
||||
"os-locale": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
|
||||
"integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
"html-webpack-plugin": "^4.0.0-beta.11",
|
||||
"identity-obj-proxy": "^3.0.0",
|
||||
"jasmine": "^3.6.3",
|
||||
"jasmine-reporters": "^2.3.2",
|
||||
"jasmine-reporters": "^2.4.0",
|
||||
"jasmine-spec-reporter": "^6.0.0",
|
||||
"jest": "^26.0.1",
|
||||
"jest-junit": "^8.0.0",
|
||||
|
|
Loading…
Reference in New Issue