adopted-ember-addons / ember-stripe-elements

A simple Ember wrapper for Stripe Elements
https://ember-stripe-elements.netlify.com
MIT License
19 stars 23 forks source link

Fix StripeMock to work with the stripeEventUtils helper #43

Closed jaswilli closed 2 years ago

jaswilli commented 2 years ago

Hi,

Forgive me if I'm missing something obvious here but it seems like StripeMock is not fully complete such that it's able to work with the stripeEventUtils helper: https://github.com/adopted-ember-addons/ember-stripe-elements/blob/8a6d281d4bf1ad5f78299c0afa30b0776192e52e/addon-test-support/index.js#L93-L101.

When StripeMock#elements is invoked via a call to the service's getActiveElements method, the dummy element object that is returned has an on method that does nothing and is missing the _emitEvent method used by stripeEventUtils.

After adding this rudimentary event emitter to the dummy element object I can get tests working when using stripeEventUtils.

st-h commented 2 years ago

published as 2.0.4