{"action":"created","issue":{"url":"https://api.github.com/repos/jquense/teaspoon/issues/25","repository_url":"https://api.github.com/repos/jquense/teaspoon","labels_url":"https://api.github.com/repos/jquense/teaspoon/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/jquense/teaspoon/issues/25/comments","events_url":"https://api.github.com/repos/jquense/teaspoon/issues/25/events","html_url":"https://github.com/jquense/teaspoon/issues/25","id":133324901,"number":25,"title":".find doesn't find appropriate elements from .dom() in some cases","user":{"login":"davejacobs","id":10695,"avatar_url":"https://avatars.githubusercontent.com/u/10695?v=3","gravatar_id":"","url":"https://api.github.com/users/davejacobs","html_url":"https://github.com/davejacobs","followers_url":"https://api.github.com/users/davejacobs/followers","following_url":"https://api.github.com/users/davejacobs/following{/other_user}","gists_url":"https://api.github.com/users/davejacobs/gists{/gist_id}","starred_url":"https://api.github.com/users/davejacobs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davejacobs/subscriptions","organizations_url":"https://api.github.com/users/davejacobs/orgs","repos_url":"https://api.github.com/users/davejacobs/repos","events_url":"https://api.github.com/users/davejacobs/events{/privacy}","received_events_url":"https://api.github.com/users/davejacobs/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-02-12T19:35:04Z","updated_at":"2016-02-16T19:52:04Z","closed_at":"2016-02-13T20:18:06Z","body":"I've run into a problem where `.find` doesn't return some elements that show up in `.dom()`. Specifically, it happens to me when the DOM changes during the test. Any idea why this is? Maybe `.find` is caching the initial state of the rendered component?\r\n\r\nI'd love to figure this out so I can introduce teaspoon into our codebase. (So far, trying out the library has been a great experience.)\r\n\r\nExample failing spec:\r\n\r\n```javascript\r\nimport React from 'react';\r\nimport t from 'teaspoon';\r\n\r\nclass ExampleComponent extends React.Component {\r\n  constructor(props) {\r\n    super(props);\r\n    this.state = { showText: false };\r\n  }\r\n\r\n  render() {\r\n    const textSpan =\r\n      this.state.showText ?\r\n        <span className='text' onClick={this.props.onClickText}>\r\n          Hidden Text\r\n        </span> :\r\n        null;\r\n\r\n    return (\r\n      <div>\r\n        <h1 className='header' onClick={this.handleHeaderClick.bind(this)}>\r\n          Show Text\r\n        </h1>\r\n        {textSpan}\r\n      </div>\r\n    );\r\n  }\r\n\r\n  handleHeaderClick() {\r\n    this.setState({ showText: true });\r\n  }\r\n}\r\n\r\ndescribe('ExampleComponent', () => {\r\n  it('when I click the hidden text, it fires its click handler', () => {\r\n    const clickSpy = jasmine.createSpy('click spy');\r\n\r\n    const component = t(\r\n      <ExampleComponent onClickText={clickSpy} />\r\n    ).render();\r\n\r\n    component.find('.header').trigger('click');\r\n    // Examining component.dom() here does show '.text', but\r\n    // querying for it returns 0 items.\r\n    component.find('.text').trigger('click');\r\n\r\n    expect(clickSpy).toHaveBeenCalled()\r\n  });\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/jquense/teaspoon/issues/comments/184851274","html_url":"https://github.com/jquense/teaspoon/issues/25#issuecomment-184851274","issue_url":"https://api.github.com/repos/jquense/teaspoon/issues/25","id":184851274,"user":{"login":"davejacobs","id":10695,"avatar_url":"https://avatars.githubusercontent.com/u/10695?v=3","gravatar_id":"","url":"https://api.github.com/users/davejacobs","html_url":"https://github.com/davejacobs","followers_url":"https://api.github.com/users/davejacobs/followers","following_url":"https://api.github.com/users/davejacobs/following{/other_user}","gists_url":"https://api.github.com/users/davejacobs/gists{/gist_id}","starred_url":"https://api.github.com/users/davejacobs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davejacobs/subscriptions","organizations_url":"https://api.github.com/users/davejacobs/orgs","repos_url":"https://api.github.com/users/davejacobs/repos","events_url":"https://api.github.com/users/davejacobs/events{/privacy}","received_events_url":"https://api.github.com/users/davejacobs/received_events","type":"User","site_admin":false},"created_at":"2016-02-16T19:52:03Z","updated_at":"2016-02-16T19:52:03Z","body":"Awesome, thanks!"}}