From 40212d3462d9f49a7c5a929b75f1ca642885403b Mon Sep 17 00:00:00 2001 From: Jonathan Niles Date: Thu, 1 Oct 2020 10:39:17 +0100 Subject: [PATCH] fix(stock): integration test errors Make the integration tests pass by fixing a bug in the CMM calculation. --- test/integration/stock/stock.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/integration/stock/stock.js b/test/integration/stock/stock.js index 3568dd745c..449f9112af 100644 --- a/test/integration/stock/stock.js +++ b/test/integration/stock/stock.js @@ -76,8 +76,7 @@ describe('(/stock/) The Stock HTTP API', () => { // (report) render all stock exit it( - `GET /reports/stock/lots?renderer=json - returns exits for all depots`, + `GET /reports/stock/lots?renderer=json returns exits for all depots`, async () => { const res = await agent.get(`/reports/stock/lots?renderer=json`); expect(res.body.rows.length).to.equal(23); @@ -171,11 +170,12 @@ describe('(/stock/) The Stock HTTP API', () => { helpers.api.listed(res, 4); expect(res.body[1].quantity).to.equal(140); - expect(res.body[1].avg_consumption).to.equal(15); - expect(res.body[1].S_SEC).to.equal(15); - expect(res.body[1].S_MIN).to.equal(30); - expect(res.body[1].S_MAX).to.equal(30); - expect(res.body[1].S_MONTH).to.equal(9); + expect(res.body[1].avg_consumption).to.equal(8); + + expect(res.body[1].S_SEC).to.equal(8); + expect(res.body[1].S_MIN).to.equal(16); + expect(res.body[1].S_MAX).to.equal(16); + expect(res.body[1].S_MONTH).to.equal(17); expect(res.body[2].quantity).to.equal(180300); expect(res.body[2].avg_consumption).to.equal(49916.67);