From 1fb3620ce86cac7a29c747cbd3cf8cb831aa1983 Mon Sep 17 00:00:00 2001 From: Michael Bromley Date: Tue, 11 May 2021 17:03:12 +0200 Subject: [PATCH] test(core): Fix e2e test for postgres --- packages/core/e2e/order.e2e-spec.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/core/e2e/order.e2e-spec.ts b/packages/core/e2e/order.e2e-spec.ts index 9a33d91e0f..e452b68105 100644 --- a/packages/core/e2e/order.e2e-spec.ts +++ b/packages/core/e2e/order.e2e-spec.ts @@ -1924,7 +1924,11 @@ describe('Orders resolver', () => { expect(order.state).toBe('PaymentSettled'); expect(order.payments?.length).toBe(2); - expect(omit(order.payments![1], ['id'])).toEqual({ + expect( + omit(order.payments?.find(p => p.method === singleStageRefundablePaymentMethod.code)!, [ + 'id', + ]), + ).toEqual({ amount: orderTotalWithTax - PARTIAL_PAYMENT_AMOUNT, metadata: {}, method: singleStageRefundablePaymentMethod.code, @@ -2042,7 +2046,7 @@ describe('Orders resolver', () => { SettlePayment.Mutation, SettlePayment.Variables >(SETTLE_PAYMENT, { - id: order.payments![0].id, + id: order.payments!.find(p => p.method === partialPaymentMethod.code)!.id, }); paymentGuard.assertSuccess(settlePayment);