From 368772dad203c5f7d997b99a2ef5f2ea66bee3cd Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Fri, 18 Sep 2020 20:24:08 +0100 Subject: [PATCH] Add another missing method to StripeJS mock Our Angular code calls this method in some tests and expects a Promise object with a hash describing a payment method. --- spec/support/fixtures/stripejs-mock.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spec/support/fixtures/stripejs-mock.js b/spec/support/fixtures/stripejs-mock.js index 9ce9c4b935..6c0a534107 100644 --- a/spec/support/fixtures/stripejs-mock.js +++ b/spec/support/fixtures/stripejs-mock.js @@ -22,6 +22,22 @@ window.Stripe = () => { }; return { + createPaymentMethod: () => { + return new Promise(resolve => { + resolve({ + paymentMethod: { + id: "pm_123", + card: { + brand: 'visa', + last4: fetchLastFour(), + exp_month: "10", + exp_year: "2050" + } + } + }); + }); + }, + elements: () => { return { create: (type, options) => new Element()