From 534b50f51a65ccea3d282aee57041c9c3641c6ac Mon Sep 17 00:00:00 2001 From: guillermo Date: Thu, 14 Nov 2024 10:45:28 +0100 Subject: [PATCH] feat: refs #8151 Requested changes --- .../expedition/specs/moveExpeditions.spec.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/ticket/back/methods/expedition/specs/moveExpeditions.spec.js b/modules/ticket/back/methods/expedition/specs/moveExpeditions.spec.js index 2f0fd673c..9c91df5d6 100644 --- a/modules/ticket/back/methods/expedition/specs/moveExpeditions.spec.js +++ b/modules/ticket/back/methods/expedition/specs/moveExpeditions.spec.js @@ -1,6 +1,6 @@ const models = require('vn-loopback/server/server').models; -describe('ticket moveExpeditions()', () => { +fdescribe('ticket moveExpeditions()', () => { const ctx = beforeAll.getCtx(); it('should move the selected expeditions to new ticket', async() => { @@ -17,14 +17,13 @@ describe('ticket moveExpeditions()', () => { agencyModeId: 1, routeId: null, expeditionIds: [1, 2] - }; - + const newestTicketIdInFixtures = await models.Ticket.findOne({ + order: 'id DESC' + }, options); const ticket = await models.Expedition.moveExpeditions(ctx, options); - const newestTicketIdInFixtures = 27; - - expect(ticket.id).toBeGreaterThan(newestTicketIdInFixtures); + expect(ticket.id).toBeGreaterThan(newestTicketIdInFixtures.id); await tx.rollback(); } catch (e) { @@ -49,11 +48,12 @@ describe('ticket moveExpeditions()', () => { expeditionIds: [1, 2] }; + const newestTicketIdInFixtures = await models.Ticket.findOne({ + order: 'id DESC' + }, options); const ticket = await models.Expedition.moveExpeditions(myCtx, options); - const newestTicketIdInFixtures = 27; - - expect(ticket.id).toBeGreaterThan(newestTicketIdInFixtures); + expect(ticket.id).toBeGreaterThan(newestTicketIdInFixtures.id); const updatedTicket = await models.Ticket.findById(ticket.id, null, options); const packedState = await models.State.findOne({where: {code: 'PACKED'}}, options);