{"action":"created","issue":{"url":"https://api.github.com/repos/airbnb/enzyme/issues/1077","repository_url":"https://api.github.com/repos/airbnb/enzyme","labels_url":"https://api.github.com/repos/airbnb/enzyme/issues/1077/labels{/name}","comments_url":"https://api.github.com/repos/airbnb/enzyme/issues/1077/comments","events_url":"https://api.github.com/repos/airbnb/enzyme/issues/1077/events","html_url":"https://github.com/airbnb/enzyme/issues/1077","id":251112395,"number":1077,"title":"Find() Does Not Find Parent, It's Finding Child in render()","user":{"login":"dschinkel","id":338798,"avatar_url":"https://avatars3.githubusercontent.com/u/338798?v=4","gravatar_id":"","url":"https://api.github.com/users/dschinkel","html_url":"https://github.com/dschinkel","followers_url":"https://api.github.com/users/dschinkel/followers","following_url":"https://api.github.com/users/dschinkel/following{/other_user}","gists_url":"https://api.github.com/users/dschinkel/gists{/gist_id}","starred_url":"https://api.github.com/users/dschinkel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dschinkel/subscriptions","organizations_url":"https://api.github.com/users/dschinkel/orgs","repos_url":"https://api.github.com/users/dschinkel/repos","events_url":"https://api.github.com/users/dschinkel/events{/privacy}","received_events_url":"https://api.github.com/users/dschinkel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-18T00:59:37Z","updated_at":"2017-08-19T23:58:50Z","closed_at":null,"body":"this is a bit weird.  When I debug, tab ends up being a shallow wrapper which is fine and expected.  But.. when I look at the nodes array in WebStorm of the shallow wrapper, it's always returning the <Search /> component, not <HeaderSearch />.  Why??  I'm shallow rendering HeaderSearch, not Search!\r\n\r\nvideo: https://youtu.be/yyhxWI6oLPA\r\n\r\n```\r\nimport { expect, shallow, React } from 'test/test.helpers';\r\nimport { fakeStore } from 'test/test.doubles';\r\nimport HeaderSearch from 'app/components/Header/HeaderSearch/index';\r\n\r\ndescribe('Header Search Category Tab', () => {\r\n\r\n  describe('Successful', () => {\r\n\r\n    describe('displayed as fourth category', () => {\r\n\r\n      it('contains search', () => {\r\n        const search = shallow(<HeaderSearch store={fakeStore()} />).dive().find('.ft-search');\r\n        expect(search).to.exist;\r\n      })\r\n    })\r\n  })\r\n})\r\n```\r\n\r\n**Container**\r\n\r\nI'm giving the bare minimal, the **...** means \"there is code here\":\r\n```\r\nexport class HeaderSearch extends Component {\r\n  constructor() {\r\n    ...\r\n  }\r\n\r\n  render() {\r\n    ...\r\n    return (\r\n       <Search />\r\n    );\r\n  }\r\n}\r\n\r\nfunction mapStateToProps(state) {\r\n  return {\r\n    ...\r\n  };\r\n}\r\n\r\nconst TimeoutHeaderSearch = ReactTimeout(connect(mapStateToProps, {\r\n  ...\r\n})(HeaderSearch));\r\n\r\nTimeoutHeaderSearch.fetchData = ({ store }) => store.dispatch(fetchSearch());\r\n```\r\n\r\nHere's the debug showing what was returned\r\n\r\n![screen shot 2017-08-18 at 2 56 09 am](https://user-images.githubusercontent.com/338798/29449610-030c8cea-83c1-11e7-8498-687140e888a6.png)\r\n"},"comment":{"url":"https://api.github.com/repos/airbnb/enzyme/issues/comments/323554576","html_url":"https://github.com/airbnb/enzyme/issues/1077#issuecomment-323554576","issue_url":"https://api.github.com/repos/airbnb/enzyme/issues/1077","id":323554576,"user":{"login":"ljharb","id":45469,"avatar_url":"https://avatars1.githubusercontent.com/u/45469?v=4","gravatar_id":"","url":"https://api.github.com/users/ljharb","html_url":"https://github.com/ljharb","followers_url":"https://api.github.com/users/ljharb/followers","following_url":"https://api.github.com/users/ljharb/following{/other_user}","gists_url":"https://api.github.com/users/ljharb/gists{/gist_id}","starred_url":"https://api.github.com/users/ljharb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ljharb/subscriptions","organizations_url":"https://api.github.com/users/ljharb/orgs","repos_url":"https://api.github.com/users/ljharb/repos","events_url":"https://api.github.com/users/ljharb/events{/privacy}","received_events_url":"https://api.github.com/users/ljharb/received_events","type":"User","site_admin":false},"created_at":"2017-08-19T23:58:50Z","updated_at":"2017-08-19T23:58:50Z","body":"For one, .exist won't ever be false, because .find always returns a wrapper.\r\n\r\nInstead, assert on the length of the wrapper, and what it contains."}}
{"actor":{"display_login":"ljharb"}}