Skip to content

Commit

Permalink
test(stock): fix stock tests
Browse files Browse the repository at this point in the history
Fixes the stock tests for getting the stock in a depot.
  • Loading branch information
jniles committed Mar 4, 2022
1 parent af969ac commit 426618d
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions test/integration-stock/depots.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,6 @@ describe('(/depots) The depots API ', () => {
// mock today's date
const [today] = new Date().toISOString().split('T');

it('GET /depots/:uuid/stock returns the stock in a depot', async () => {
const res = await agent.get(`/depots/${principal}/stock`).query({ date : today });
helpers.api.listed(res, 3);

// check the quantites of each individual article
const [ampicilline, oxytocine, quinine] = res.body;
expect(ampicilline.quantity).to.equal(0);
expect(oxytocine.quantity).to.equal(14110);
expect(quinine.quantity).to.equal(360);
});

let WAC_FROM_PROCEDURE;
let WAC_FROM_STOCK_SHEET;

Expand Down Expand Up @@ -227,4 +216,16 @@ describe('(/depots) The depots API ', () => {
})
.catch(helpers.handler);
});

it('GET /depots/:uuid/stock returns the stock in a depot', async () => {
const res = await agent.get(`/depots/${principal}/stock`).query({ date : today });
helpers.api.listed(res, 3);

// check the quantites of each individual article
const [oxytocineLotA, oxytocineLotB, quinine] = res.body;

expect(oxytocineLotA.quantity).to.equal(9110);
expect(oxytocineLotB.quantity).to.equal(5000);
expect(quinine.quantity).to.equal(360);
});
});

0 comments on commit 426618d

Please sign in to comment.