From 767a1b02d9d7810935b2508983709e174eb798fe Mon Sep 17 00:00:00 2001 From: gerard Date: Thu, 6 Sep 2018 16:18:17 +0200 Subject: [PATCH] Tarea #603 /item/getDiary.js Backend unit tests --- .../common/methods/item/specs/getDiary.spec.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 services/loopback/common/methods/item/specs/getDiary.spec.js diff --git a/services/loopback/common/methods/item/specs/getDiary.spec.js b/services/loopback/common/methods/item/specs/getDiary.spec.js new file mode 100644 index 000000000..6ebbbe004 --- /dev/null +++ b/services/loopback/common/methods/item/specs/getDiary.spec.js @@ -0,0 +1,11 @@ +const app = require(`${servicesDir}/item/server/server`); + +describe('item getShipped()', () => { + it('should return 3 entries, the first one with the property balance -100', async() => { + let params = {where: {itemFk: 1, warehouseFk: 2}}; + let result = await app.models.Item.getDiary(params); + + expect(result.length).toBe(3); + expect(result[0].balance).toBe(-100); + }); +});