Integration-Testing JavaScript with Capybara
Let's learn about integration-testing in JavaScript.
JavaScript integration test difficulty
Nearly every Rails site uses JavaScript for something, and often JavaScript is a critical part of the user experience on sites. However, many sites don’t test their JavaScript in meaningful ways.
Part of the reason is that JavaScript can be difficult to test. Interactions and logic are often dependent on user interaction or the specific state of the elements on the page, which can be hard to set up for testing. The JavaScript frameworks don’t often support easy unit testing. The tools are changing very quickly. The tools we use in this chapter may seem quaint if not downright antiquated by reading this.
That said, some ...