From d8428377ae58afbcea5a228de2736282f4062e29 Mon Sep 17 00:00:00 2001 From: Martijn Date: Tue, 5 Mar 2024 13:08:53 +0100 Subject: [PATCH] feat(payments-plugin): fixed e2e tests --- .../payments-plugin/e2e/mollie-payment.e2e-spec.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/payments-plugin/e2e/mollie-payment.e2e-spec.ts b/packages/payments-plugin/e2e/mollie-payment.e2e-spec.ts index e644a6fcbf..5f07c7c4c0 100644 --- a/packages/payments-plugin/e2e/mollie-payment.e2e-spec.ts +++ b/packages/payments-plugin/e2e/mollie-payment.e2e-spec.ts @@ -622,8 +622,10 @@ describe('Handle pay-later methods', () => { expect(order.state).toBe('PaymentSettled'); }); - it('Should add an unusable Mollie paymentMethod (missing redirectUrl)', async () => { - const { createPaymentMethod } = await adminClient.query< + it('Should fail to add payment method without redirect url', async () => { + let error = '' + try { + const { createPaymentMethod } = await adminClient.query< CreatePaymentMethodMutation, CreatePaymentMethodMutationVariables >(CREATE_PAYMENT_METHOD, { @@ -647,6 +649,9 @@ describe('Handle pay-later methods', () => { ], }, }); - expect(createPaymentMethod.code).toBe(mockData.methodCodeBroken); + } catch(e: any) { + error = e.message + } + expect(error).toBe('The argument "redirectUrl" is required'); }); });