GithubHelp home page GithubHelp logo

react-simple-state-lab's Issues

Issue with sinon.spy in specs

I was getting this spec error:

`1)
has an event listener that, when clicked, calls this.setState() once (make sure you aren't setting state directly, but instead using the component's 'setState' method):

  AssertionError: expected false to equal true
  + expected - actual

  -false
  +true
  
  at Context.<anonymous> (test/1-Cell.test.js:52:36)

`

but I have a setState() method on my Cell component:

Screen Shot 2019-05-21 at 1 34 03 PM

It would appear that the sinon.spy is not working for this spec:

it("has an event listener that, when clicked, calls this.setState() once (make sure you aren't setting state directly, but instead using the component's 'setState' method)", () => { const setState = sinon.spy(Cell.prototype, 'setState'); cellWhite.find('div').simulate('click') expect(setState.calledOnce).to.equal(true); })

The resolution the technical helper and I came to was to comment out this spec.

Solution includes ColorSeclector component which isn't mentioned in the lab.

Link to Canvas

Issue Subtype

  • Master branch code
  • Solution branch code
  • Code tests
  • Layout/rendering issue
  • Instructions unclear
  • Other (explain below)

Describe the Issue

Source


Concern

(Optional) Proposed Solution

Is it possible to show a solution for those learning this code for the first time, to adhere to just "state" and "props" and use code that follows the instructions given in the lab? Please?

What OS Are You Using?

  • OS X
  • Windows
  • WSL
  • Linux
  • IllumiDesk

Any Additional Context?

Tests pass but the app doesnt work in the browser

Students are able to get the tests to pass but the app doesn't display in the browser.
I tried cloning the solution down to my system to test and that also did not work in the browser.

I don't have the bandwidth to look into it myself but if someone is able to check the recent PRs I know the lab has worked properly in the past, maybe they can locate the breaking change.

Syntax for GenRow and genMatrix

Syntax for the genRow and genMatrix use one line arrow notation. Lab asks the user to insert a console.log into the code to help understand. This will throw an error, recommend replacing the () after => with {} so two lines of code will not throw an error.

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.