diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 28b8e9181..08f6643e7 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -814,7 +814,7 @@ INSERT INTO `vn`.`item`(`id`, `typeFk`, `size`, `inkFk`, `stems`, `originFk`, `d (14, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 4, 'VT'), (15, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB'), (16, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB'), - (71, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'VT'); + (71, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'VT'); -- Update the taxClass after insert of the items UPDATE `vn`.`itemTaxCountry` SET `taxClassFk` = 2 diff --git a/modules/item/back/methods/item/specs/activeWithBuyer.spec.js b/modules/item/back/methods/item/specs/activeWithBuyer.spec.js index f894e431a..58860c204 100644 --- a/modules/item/back/methods/item/specs/activeWithBuyer.spec.js +++ b/modules/item/back/methods/item/specs/activeWithBuyer.spec.js @@ -2,13 +2,23 @@ const models = require('vn-loopback/server/server').models; describe('Worker activeWithBuyer', () => { it('should return the buyers in itemType as result', async() => { - const filter = {}; - const result = await models.Item.activeWithBuyer(filter); - const firstWorker = result[0]; - const secondWorker = result[1]; + const tx = await models.Item.beginTransaction({}); - expect(result.length).toEqual(2); - expect(firstWorker.nickname).toEqual('logisticBossNick'); - expect(secondWorker.nickname).toEqual('buyerNick'); + try { + const options = {transaction: tx}; + const filter = {}; + const result = await models.Item.activeWithBuyer(filter, options); + const firstWorker = result[0]; + const secondWorker = result[1]; + + expect(result.length).toEqual(2); + expect(firstWorker.nickname).toEqual('logisticBossNick'); + expect(secondWorker.nickname).toEqual('buyerNick'); + + await tx.rollback(); + } catch (e) { + await tx.rollback(); + throw e; + } }); }); diff --git a/modules/item/front/search-panel/index.html b/modules/item/front/search-panel/index.html index 425df3d4f..29b2a24fc 100644 --- a/modules/item/front/search-panel/index.html +++ b/modules/item/front/search-panel/index.html @@ -41,6 +41,7 @@