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

test pure wont pass any more #19

Closed
anyayunli opened this issue Mar 15, 2017 · 2 comments
Closed

test pure wont pass any more #19

anyayunli opened this issue Mar 15, 2017 · 2 comments

Comments

@anyayunli
Copy link

anyayunli commented Mar 15, 2017

it('renders as a pure component', () => {
  const pair = ['Trainspotting', '28 Days Later'];
  const component = renderIntoDocument(
    <Voting pair={pair} />
  );

  let firstButton = scryRenderedDOMComponentsWithTag(component,   'button')[0];
  expect(firstButton.textContent).to.equal('Trainspotting');

  pair[0] = 'Sunshine';
  const component2 = renderIntoDocument(
    <Voting pair={pair} />
  );
  firstButton = scryRenderedDOMComponentsWithTag(component2, 'button')[0];
  expect(firstButton.textContent).to.equal('Trainspotting');
});

at least in my test, expect(firstButton.textContent).to.equal('Sunshine');
I guess here we should use a immuatable list

@Jedeu
Copy link

Jedeu commented Mar 27, 2017

@anyayunli you are correct. If you follow along with the remaining sections until Writing The UI for The Results Screen And Handling Routing, you will see how he goes about using an immutable list and making the tests pass.

@anyayunli
Copy link
Author

close, looks like this repo is not actively maintained now

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

No branches or pull requests

2 participants