Code Monkey home page Code Monkey logo

Comments (10)

SuperConfuserUser avatar SuperConfuserUser commented on August 28, 2024 6

Ok, so I changed the variable declarations from "let" to "var" with the exact same code. Then, it passed. Maybe capybara doesn't like newer ES6 features.

from return-string-data-lab-v-000.

atxrenegade avatar atxrenegade commented on August 28, 2024 2

I've had this same issue in previous labs. It's incredibly misleading to teach student NEVER TO USE VAR, and then require it to pass tests written in legacy code.

from return-string-data-lab-v-000.

SuperConfuserUser avatar SuperConfuserUser commented on August 28, 2024 1

Same here. Lab is working in browser but fails at ./spec/features/product_feature_spec.rb:14

from return-string-data-lab-v-000.

katrpilar avatar katrpilar commented on August 28, 2024 1

Tried to debug this issue for a long time and the only solution is to comment out the tests as mentioned above.

from return-string-data-lab-v-000.

Naomi-Dennis avatar Naomi-Dennis commented on August 28, 2024 1

The bug is still there.

The test will pass if all JavaScript code is PRE es6.

For example, if you're using let instead of var, or the defining an anonymous function like this:
(arg) => { return arg } instead of like this: function(arg){ return arg} the test will fail.

I think this is happening because Rails doesn't have an official way of reading ES6 JavaScript. The common way is to process JavaScript with the sprockets gem, but even that is still in beta and doesn't have an official release (as of April 2019, it doesn't really work with Rails). You can read more about it here: Sprockets & ES6

TL;DR: Don't use ES6 JavaScript for this lab. Use legacy JavaScript only!

from return-string-data-lab-v-000.

justinddaniel avatar justinddaniel commented on August 28, 2024

This continues to be an issue if my recent screenshare with a student is any indication. User unenlightened above appears to have hit on the solution, though the reasons why are mysterious. Perhaps something to do with the way click_button in the test interprets ES6 syntax?

from return-string-data-lab-v-000.

yehudamakarov avatar yehudamakarov commented on August 28, 2024

from return-string-data-lab-v-000.

justinddaniel avatar justinddaniel commented on August 28, 2024

Hi Yehuda! I would love to figure it out, it is just a matter of finding a decent block of time. I suspect that poring through the docs on how the click_button test method works will help us find the answer.

from return-string-data-lab-v-000.

yehudamakarov avatar yehudamakarov commented on August 28, 2024

from return-string-data-lab-v-000.

 avatar commented on August 28, 2024

I'm also having an issue with this lab. It looks like the test is not responding to the "click_button" method, as the error message I'm getting seems to indicate that "expect(page).to have_content product.description" is running while the truncated message is still on the page: Failure/Error: expect(page).to have_content product.description
expected to find text "This is a test description with more text than should be there." in "Flatiron Widgets Store\nTest Product\nThis is a test description ...\nMore Info"

from return-string-data-lab-v-000.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.