Skip to content
This repository has been archived by the owner on Nov 27, 2020. It is now read-only.

React components not loading #899

Closed
abelta opened this issue Jul 6, 2017 · 1 comment
Closed

React components not loading #899

abelta opened this issue Jul 6, 2017 · 1 comment

Comments

@abelta
Copy link

abelta commented Jul 6, 2017

I'm using an rSpec + Capybara + Poltergeist setup to do integration tests for my React components (with react-on-rails gem).
All of my tests are failing so far because they seem to be executed at a time when the React components haven't loaded yet and I'm debugging and not getting any errors about React or ES6 not being present.
This is what my rails_helper.rb looks like (partially)

Capybara.javascript_driver = :poltergeist

Capybara.register_driver :poltergeist do |app|
    options = {
              js_errors: true,
              timeout: 500, # adjusts timeout in ms
              debug: true,
              phantomjs_options: %w{--ignore-ssl-errors=yes --ssl-protocol=TLSv1}
              }
  Capybara::Poltergeist::Driver.new(app, options)
end

I know components are not loaded for a test because I've seen it in the screenshots I get with save_screenshot.
Is there a known way to do this?

@twalpole
Copy link
Contributor

twalpole commented Jul 6, 2017

Make 100% sure your code is being transpiled to ES5 (or not using any JS features beyond that). Unfortunately PhantomJS may silently just not run JS if it fails at parse time (using JS features like let etc - #823 ). Beyond that you'd need to show an actual test that fails. Closing for now we can reopen if more info is provided and this is actually an issue with Poltergeist.

@twalpole twalpole closed this as completed Jul 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants