From 82fba82f2d884ff40b9b4f3df7187379869f1100 Mon Sep 17 00:00:00 2001 From: Bernat Date: Mon, 1 Oct 2018 14:57:51 +0200 Subject: [PATCH] update fixtures and fix test --- services/db/install/dump/fixtures.sql | 16 +++++++--------- .../sale/specs/getClaimableFromTicket.spec.js | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/services/db/install/dump/fixtures.sql b/services/db/install/dump/fixtures.sql index 0add47ad9..e39a6e0e2 100644 --- a/services/db/install/dump/fixtures.sql +++ b/services/db/install/dump/fixtures.sql @@ -850,16 +850,16 @@ INSERT INTO `vn`.`clientSample`(`id`, `clientFk`, `typeFk`, `created`, `workerFk INSERT INTO `vn`.`claim`(`id`, `ticketCreated`, `claimStateFk`, `observation`, `clientFk`, `workerFk`, `responsibility`, `isChargedToMana`, `created` ) VALUES - ( 1, CURDATE(), 1, 'observation one' , 101, 18, 1, 0, CURDATE()), - ( 2, CURDATE(), 2, 'observation two' , 101, 18, 2, 0, CURDATE()), - ( 3, CURDATE(), 3, 'observation three' , 101, 18, 3, 0, CURDATE()); + ( 1, CURDATE(), 1, 'observation one' , 101, 18, 1, 0, CURDATE()), + ( 2, CURDATE(), 2, 'observation two' , 101, 18, 2, 0, CURDATE()), + ( 3, DATE_ADD(CURDATE(), INTERVAL -5 DAY), 3, 'observation three' , 101, 18, 3, 0, CURDATE()); INSERT INTO `vn`.`claimBeginning`(`id`, `claimFk`, `saleFk`, `quantity`) VALUES - ( 1, 1, 1, 5), - ( 2, 1, 2, 4), - ( 3, 2, 5, 10), - ( 4, 3, 6, 5); + ( 1, 1, 7, 5), + ( 2, 1, 8, 4), + ( 3, 2, 10, 10), + ( 4, 3, 6, 5); INSERT INTO `vn`.`claimDevelopment`(`id`, `claimFk`, `claimResponsibleFk`, `workerFk`, `claimReasonFk`, `claimResultFk`, `claimRedeliveryFk`, `claimDestinationFk`) VALUES @@ -873,8 +873,6 @@ INSERT INTO `hedera`.`tpvMerchant`(`id`, `description`, `companyFk`, `bankFk`, ` ( 1, 'Arkham Bank', 442, 1, 'h12387193H10238'), ( 2, 'NewYork Bank', 442, 1, '7981ugsgd1hsdad'); - - INSERT INTO `hedera`.`tpvTransaction`(`id`,`merchantFk`, `clientFk`,`receiptFk`, `amount`, `response`, `errorCode`, `status`, `created`) VALUES (1, 1, 101, NULL, 2000, NULL, 'SIS0042', 'ok', CURDATE()), diff --git a/services/loopback/common/methods/sale/specs/getClaimableFromTicket.spec.js b/services/loopback/common/methods/sale/specs/getClaimableFromTicket.spec.js index fbcb0a4b3..4de841bd6 100644 --- a/services/loopback/common/methods/sale/specs/getClaimableFromTicket.spec.js +++ b/services/loopback/common/methods/sale/specs/getClaimableFromTicket.spec.js @@ -5,6 +5,6 @@ describe('sale getClaimableFromTicket()', () => { let claimableFromTicket = await app.models.Sale.getClaimableFromTicket(16); expect(claimableFromTicket[0].concept).toBe('Gem of Time'); - expect(claimableFromTicket.length).toBe(4); + expect(claimableFromTicket.length).toBe(3); }); });