Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element does not get assigned #564

Open
joshm1204 opened this issue Jul 1, 2019 · 0 comments
Open

Element does not get assigned #564

joshm1204 opened this issue Jul 1, 2019 · 0 comments
Labels

Comments

@joshm1204
Copy link

joshm1204 commented Jul 1, 2019

I apologize ahead of time if this is not the right place for this. Stackoverflow gets no response when posting issues with teaspoon-jasmine.

I can not get Stripe.JS to load.

describe("Helpers.Stripe.PaymentElement", function() {
  var PaymentElement;
  var html = `some HTML code`
   
describe("constructor", function(){
    beforeAll(function(){
      var head = document.getElementsByTagName('head')[0];
      var body = document.getElementsByTagName('body')[0];
      var tag = document.createElement('script');
      tag.setAttribute('type', 'text/javascript');
      tag.setAttribute('src', 'https://js.stripe.com/v3/');
      head.appendChild(tag);
      body.insertAdjacentHTML('afterend', html);
      
      PaymentElement = new Helpers.Stripe.PaymentElement();
    });

    describe("with defaults", function(){
      it("should define stripe", function(){
        expect(paymentElement.stripe).toBeDefined();
      });
    });
  });
});

I see an error:

ReferenceError: Can't find variable: Stripe in http://localhost:3000/assets/helpers/stripe/payment_element.self-36d1893424989c427cba11744bfc4fd5283eb212d58bb5174386dfd8973.js?body=1?body=1 (line 9)

So it seems that Stripe is not loading from the script tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants