From 99c70a533a3fed301ce3427d4b7e61558e0ee2fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Wed, 2 Oct 2024 14:25:27 +0200 Subject: [PATCH] fix: test --- db/dump/fixtures.before.sql | 2 +- .../monitor/back/methods/sales-monitor/salesFilter.js | 4 ++-- .../methods/sales-monitor/specs/salesFilter.spec.js | 4 ++-- .../ticket/back/methods/ticket/specs/filter.spec.js | 10 +++++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/db/dump/fixtures.before.sql b/db/dump/fixtures.before.sql index 63d395e86..550a79015 100644 --- a/db/dump/fixtures.before.sql +++ b/db/dump/fixtures.before.sql @@ -1076,7 +1076,7 @@ INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `pric (9, 1, 16, 'Ranged weapon longbow 200cm', 1, 103.49, 0, 0, 0, util.VN_CURDATE(), NULL), (10, 2, 16, 'Melee weapon combat fist 15cm', 10, 7.09, 0, 0, 0, util.VN_CURDATE(), NULL), (11, 1, 16, 'Ranged weapon longbow 200cm', 1, 103.49, 0, 0, 0, util.VN_CURDATE(), NULL), - (12, 4, 16, 'Melee weapon heavy shield 100cm', 20, 1.71, 0, 0, 0, util.VN_CURDATE(), 'hasItemLost'), + (12, 4, 16, 'Melee weapon heavy shield 100cm', 20, 1.71, 0, 0, 0, util.VN_CURDATE(), NULL), (13, 2, 8, 'Melee weapon combat fist 15cm', 10, 7.08, 0, 0, 0, util.VN_CURDATE(), 'hasItemLost'), (14, 1, 8, 'Ranged weapon longbow 200cm', 2, 103.49, 0, 0, 0, util.VN_CURDATE(), NULL), (15, 1, 19, 'Ranged weapon longbow 200cm', 1, 103.49, 0, 0, 0, util.VN_CURDATE(), NULL), diff --git a/modules/monitor/back/methods/sales-monitor/salesFilter.js b/modules/monitor/back/methods/sales-monitor/salesFilter.js index 4f81f59b9..36e2c40aa 100644 --- a/modules/monitor/back/methods/sales-monitor/salesFilter.js +++ b/modules/monitor/back/methods/sales-monitor/salesFilter.js @@ -288,7 +288,7 @@ module.exports = Self => { {'tp.hasRisk': true}, {'tp.hasTicketRequest': true}, {'tp.hasComponentLack': true}, - {'tp.isTaxDataChecked': false}, + {'tp.isTaxDataChecked': true}, {'tp.hasItemShortage': true}, {'tp.isTooLittle': true} ]}; @@ -298,7 +298,7 @@ module.exports = Self => { {'tp.hasRisk': false}, {'tp.hasTicketRequest': false}, {'tp.hasComponentLack': false}, - {'tp.isTaxDataChecked': true}, + {'tp.isTaxDataChecked': false}, {'tp.hasItemShortage': false}, {'tp.isTooLittle': false} ]}; diff --git a/modules/monitor/back/methods/sales-monitor/specs/salesFilter.spec.js b/modules/monitor/back/methods/sales-monitor/specs/salesFilter.spec.js index 908c446a6..1b4616de7 100644 --- a/modules/monitor/back/methods/sales-monitor/specs/salesFilter.spec.js +++ b/modules/monitor/back/methods/sales-monitor/specs/salesFilter.spec.js @@ -48,7 +48,7 @@ describe('SalesMonitor salesFilter()', () => { } }); - fit('should now return the tickets matching the problems on false', async() => { + it('should now return the tickets matching the problems on false', async() => { const tx = await models.SalesMonitor.beginTransaction({}); try { @@ -68,7 +68,7 @@ describe('SalesMonitor salesFilter()', () => { const filter = {}; const result = await models.SalesMonitor.salesFilter(ctx, filter, options); - expect(result.length).toEqual(4); + expect(result.length).toEqual(5); await tx.rollback(); } catch (e) { diff --git a/modules/ticket/back/methods/ticket/specs/filter.spec.js b/modules/ticket/back/methods/ticket/specs/filter.spec.js index 44bfbb7e3..d06d02f23 100644 --- a/modules/ticket/back/methods/ticket/specs/filter.spec.js +++ b/modules/ticket/back/methods/ticket/specs/filter.spec.js @@ -42,11 +42,11 @@ describe('ticket filter()', () => { const result = await models.Ticket.filter(ctx, filter, options); const hasProblemTicket = result.some(ticket => - ticket.isFreezed === true || - ticket.hasRisk === true || - ticket.hasTicketRequest === true || - ticket.hasRounding === true || - ticket.hasItemShortage === true + ticket.isFreezed == true || + ticket.hasRisk == true || + ticket.hasTicketRequest == true || + ticket.hasRounding == true || + ticket.hasItemShortage == true ); expect(hasProblemTicket).toBe(true);