{"action":"created","comment":{"url":"https://api.github.com/repos/airbnb/enzyme/pulls/comments/87515872","pull_request_review_id":8127042,"id":87515872,"diff_hunk":"@@ -151,3 +154,21 @@ export function getTextFromNode(node) {\n     .join('')\n     .replace(/\\s+/, ' ');\n }\n+\n+export const findRefInOwnedChildren = (node, ref, isRootNode) => {","path":"src/ShallowTraversal.js","position":15,"original_position":15,"commit_id":"50c8314699b5bdc4bac7f8faaf26d8b7c8cedcd2","original_commit_id":"50c8314699b5bdc4bac7f8faaf26d8b7c8cedcd2","user":{"login":"ljharb","id":45469,"avatar_url":"https://avatars.githubusercontent.com/u/45469?v=3","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},"body":"this being exported, having `isRootNode` be provideable by the consumer seems brittle. Could we split this up into separate functions, so that the recursion implementation details are hidden?","created_at":"2016-11-11T00:22:07Z","updated_at":"2016-11-11T00:22:24Z","html_url":"https://github.com/airbnb/enzyme/pull/672#discussion_r87515872","pull_request_url":"https://api.github.com/repos/airbnb/enzyme/pulls/672","_links":{"self":{"href":"https://api.github.com/repos/airbnb/enzyme/pulls/comments/87515872"},"html":{"href":"https://github.com/airbnb/enzyme/pull/672#discussion_r87515872"},"pull_request":{"href":"https://api.github.com/repos/airbnb/enzyme/pulls/672"}}},"pull_request":{"url":"https://api.github.com/repos/airbnb/enzyme/pulls/672","id":93217728,"html_url":"https://github.com/airbnb/enzyme/pull/672","diff_url":"https://github.com/airbnb/enzyme/pull/672.diff","patch_url":"https://github.com/airbnb/enzyme/pull/672.patch","issue_url":"https://api.github.com/repos/airbnb/enzyme/issues/672","number":672,"state":"open","locked":false,"title":"Add string-refs support with shallowWrapper","user":{"login":"yormi","id":6423588,"avatar_url":"https://avatars.githubusercontent.com/u/6423588?v=3","gravatar_id":"","url":"https://api.github.com/users/yormi","html_url":"https://github.com/yormi","followers_url":"https://api.github.com/users/yormi/followers","following_url":"https://api.github.com/users/yormi/following{/other_user}","gists_url":"https://api.github.com/users/yormi/gists{/gist_id}","starred_url":"https://api.github.com/users/yormi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yormi/subscriptions","organizations_url":"https://api.github.com/users/yormi/orgs","repos_url":"https://api.github.com/users/yormi/repos","events_url":"https://api.github.com/users/yormi/events{/privacy}","received_events_url":"https://api.github.com/users/yormi/received_events","type":"User","site_admin":false},"body":"In response to https://github.com/airbnb/enzyme/issues/361 and my own need :)\r\n\r\nI find it extremely useful to have a unique, local-scoped, way to identify my React Element.\r\n\r\nWorks as expected `shallowWrapper.ref('stringRef') => ShallowWrapper` or throws if more than one element has the wanted ref.","created_at":"2016-11-10T19:46:57Z","updated_at":"2016-11-11T00:22:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5e88c2105af69401df1d5694d42ad327c01fb540","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/airbnb/enzyme/pulls/672/commits","review_comments_url":"https://api.github.com/repos/airbnb/enzyme/pulls/672/comments","review_comment_url":"https://api.github.com/repos/airbnb/enzyme/pulls/comments{/number}","comments_url":"https://api.github.com/repos/airbnb/enzyme/issues/672/comments","statuses_url":"https://api.github.com/repos/airbnb/enzyme/statuses/50c8314699b5bdc4bac7f8faaf26d8b7c8cedcd2","head":{"label":"yormi:master","ref":"master","sha":"50c8314699b5bdc4bac7f8faaf26d8b7c8cedcd2","user":{"login":"yormi","id":6423588,"avatar_url":"https://avatars.githubusercontent.com/u/6423588?v=3","gravatar_id":"","url":"https://api.github.com/users/yormi","html_url":"https://github.com/yormi","followers_url":"https://api.github.com/users/yormi/followers","following_url":"https://api.github.com/users/yormi/following{/other_user}","gists_url":"https://api.github.com/users/yormi/gists{/gist_id}","starred_url":"https://api.github.com/users/yormi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yormi/subscriptions","organizations_url":"https://api.github.com/users/yormi/orgs","repos_url":"https://api.github.com/users/yormi/repos","events_url":"https://api.github.com/users/yormi/events{/privacy}","received_events_url":"https://api.github.com/users/yormi/received_events","type":"User","site_admin":false},"repo":{"id":73407367,"name":"enzyme","full_name":"yormi/enzyme","owner":{"login":"yormi","id":6423588,"avatar_url":"https://avatars.githubusercontent.com/u/6423588?v=3","gravatar_id":"","url":"https://api.github.com/users/yormi","html_url":"https://github.com/yormi","followers_url":"https://api.github.com/users/yormi/followers","following_url":"https://api.github.com/users/yormi/following{/other_user}","gists_url":"https://api.github.com/users/yormi/gists{/gist_id}","starred_url":"https://api.github.com/users/yormi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yormi/subscriptions","organizations_url":"https://api.github.com/users/yormi/orgs","repos_url":"https://api.github.com/users/yormi/repos","events_url":"https://api.github.com/users/yormi/events{/privacy}","received_events_url":"https://api.github.com/users/yormi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yormi/enzyme","description":"JavaScript Testing utilities for React","fork":true,"url":"https://api.github.com/repos/yormi/enzyme","forks_url":"https://api.github.com/repos/yormi/enzyme/forks","keys_url":"https://api.github.com/repos/yormi/enzyme/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yormi/enzyme/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yormi/enzyme/teams","hooks_url":"https://api.github.com/repos/yormi/enzyme/hooks","issue_events_url":"https://api.github.com/repos/yormi/enzyme/issues/events{/number}","events_url":"https://api.github.com/repos/yormi/enzyme/events","assignees_url":"https://api.github.com/repos/yormi/enzyme/assignees{/user}","branches_url":"https://api.github.com/repos/yormi/enzyme/branches{/branch}","tags_url":"https://api.github.com/repos/yormi/enzyme/tags","blobs_url":"https://api.github.com/repos/yormi/enzyme/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yormi/enzyme/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yormi/enzyme/git/refs{/sha}","trees_url":"https://api.github.com/repos/yormi/enzyme/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yormi/enzyme/statuses/{sha}","languages_url":"https://api.github.com/repos/yormi/enzyme/languages","stargazers_url":"https://api.github.com/repos/yormi/enzyme/stargazers","contributors_url":"https://api.github.com/repos/yormi/enzyme/contributors","subscribers_url":"https://api.github.com/repos/yormi/enzyme/subscribers","subscription_url":"https://api.github.com/repos/yormi/enzyme/subscription","commits_url":"https://api.github.com/repos/yormi/enzyme/commits{/sha}","git_commits_url":"https://api.github.com/repos/yormi/enzyme/git/commits{/sha}","comments_url":"https://api.github.com/repos/yormi/enzyme/comments{/number}","issue_comment_url":"https://api.github.com/repos/yormi/enzyme/issues/comments{/number}","contents_url":"https://api.github.com/repos/yormi/enzyme/contents/{+path}","compare_url":"https://api.github.com/repos/yormi/enzyme/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yormi/enzyme/merges","archive_url":"https://api.github.com/repos/yormi/enzyme/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yormi/enzyme/downloads","issues_url":"https://api.github.com/repos/yormi/enzyme/issues{/number}","pulls_url":"https://api.github.com/repos/yormi/enzyme/pulls{/number}","milestones_url":"https://api.github.com/repos/yormi/enzyme/milestones{/number}","notifications_url":"https://api.github.com/repos/yormi/enzyme/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yormi/enzyme/labels{/name}","releases_url":"https://api.github.com/repos/yormi/enzyme/releases{/id}","deployments_url":"https://api.github.com/repos/yormi/enzyme/deployments","created_at":"2016-11-10T17:58:41Z","updated_at":"2016-11-10T17:58:42Z","pushed_at":"2016-11-10T22:24:33Z","git_url":"git://github.com/yormi/enzyme.git","ssh_url":"git@github.com:yormi/enzyme.git","clone_url":"https://github.com/yormi/enzyme.git","svn_url":"https://github.com/yormi/enzyme","homepage":"http://airbnb.io/enzyme/","size":1715,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"airbnb:master","ref":"master","sha":"c97512d1ae03de8e50dfc49dbc9dbfc681401e49","user":{"login":"airbnb","id":698437,"avatar_url":"https://avatars.githubusercontent.com/u/698437?v=3","gravatar_id":"","url":"https://api.github.com/users/airbnb","html_url":"https://github.com/airbnb","followers_url":"https://api.github.com/users/airbnb/followers","following_url":"https://api.github.com/users/airbnb/following{/other_user}","gists_url":"https://api.github.com/users/airbnb/gists{/gist_id}","starred_url":"https://api.github.com/users/airbnb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/airbnb/subscriptions","organizations_url":"https://api.github.com/users/airbnb/orgs","repos_url":"https://api.github.com/users/airbnb/repos","events_url":"https://api.github.com/users/airbnb/events{/privacy}","received_events_url":"https://api.github.com/users/airbnb/received_events","type":"Organization","site_admin":false},"repo":{"id":45942274,"name":"enzyme","full_name":"airbnb/enzyme","owner":{"login":"airbnb","id":698437,"avatar_url":"https://avatars.githubusercontent.com/u/698437?v=3","gravatar_id":"","url":"https://api.github.com/users/airbnb","html_url":"https://github.com/airbnb","followers_url":"https://api.github.com/users/airbnb/followers","following_url":"https://api.github.com/users/airbnb/following{/other_user}","gists_url":"https://api.github.com/users/airbnb/gists{/gist_id}","starred_url":"https://api.github.com/users/airbnb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/airbnb/subscriptions","organizations_url":"https://api.github.com/users/airbnb/orgs","repos_url":"https://api.github.com/users/airbnb/repos","events_url":"https://api.github.com/users/airbnb/events{/privacy}","received_events_url":"https://api.github.com/users/airbnb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/airbnb/enzyme","description":"JavaScript Testing utilities for React","fork":false,"url":"https://api.github.com/repos/airbnb/enzyme","forks_url":"https://api.github.com/repos/airbnb/enzyme/forks","keys_url":"https://api.github.com/repos/airbnb/enzyme/keys{/key_id}","collaborators_url":"https://api.github.com/repos/airbnb/enzyme/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/airbnb/enzyme/teams","hooks_url":"https://api.github.com/repos/airbnb/enzyme/hooks","issue_events_url":"https://api.github.com/repos/airbnb/enzyme/issues/events{/number}","events_url":"https://api.github.com/repos/airbnb/enzyme/events","assignees_url":"https://api.github.com/repos/airbnb/enzyme/assignees{/user}","branches_url":"https://api.github.com/repos/airbnb/enzyme/branches{/branch}","tags_url":"https://api.github.com/repos/airbnb/enzyme/tags","blobs_url":"https://api.github.com/repos/airbnb/enzyme/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/airbnb/enzyme/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/airbnb/enzyme/git/refs{/sha}","trees_url":"https://api.github.com/repos/airbnb/enzyme/git/trees{/sha}","statuses_url":"https://api.github.com/repos/airbnb/enzyme/statuses/{sha}","languages_url":"https://api.github.com/repos/airbnb/enzyme/languages","stargazers_url":"https://api.github.com/repos/airbnb/enzyme/stargazers","contributors_url":"https://api.github.com/repos/airbnb/enzyme/contributors","subscribers_url":"https://api.github.com/repos/airbnb/enzyme/subscribers","subscription_url":"https://api.github.com/repos/airbnb/enzyme/subscription","commits_url":"https://api.github.com/repos/airbnb/enzyme/commits{/sha}","git_commits_url":"https://api.github.com/repos/airbnb/enzyme/git/commits{/sha}","comments_url":"https://api.github.com/repos/airbnb/enzyme/comments{/number}","issue_comment_url":"https://api.github.com/repos/airbnb/enzyme/issues/comments{/number}","contents_url":"https://api.github.com/repos/airbnb/enzyme/contents/{+path}","compare_url":"https://api.github.com/repos/airbnb/enzyme/compare/{base}...{head}","merges_url":"https://api.github.com/repos/airbnb/enzyme/merges","archive_url":"https://api.github.com/repos/airbnb/enzyme/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/airbnb/enzyme/downloads","issues_url":"https://api.github.com/repos/airbnb/enzyme/issues{/number}","pulls_url":"https://api.github.com/repos/airbnb/enzyme/pulls{/number}","milestones_url":"https://api.github.com/repos/airbnb/enzyme/milestones{/number}","notifications_url":"https://api.github.com/repos/airbnb/enzyme/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/airbnb/enzyme/labels{/name}","releases_url":"https://api.github.com/repos/airbnb/enzyme/releases{/id}","deployments_url":"https://api.github.com/repos/airbnb/enzyme/deployments","created_at":"2015-11-10T21:45:38Z","updated_at":"2016-11-10T23:08:07Z","pushed_at":"2016-11-11T00:20:14Z","git_url":"git://github.com/airbnb/enzyme.git","ssh_url":"git@github.com:airbnb/enzyme.git","clone_url":"https://github.com/airbnb/enzyme.git","svn_url":"https://github.com/airbnb/enzyme","homepage":"http://airbnb.io/enzyme/","size":2720,"stargazers_count":7193,"watchers_count":7193,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":530,"mirror_url":null,"open_issues_count":117,"forks":530,"open_issues":117,"watchers":7193,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/airbnb/enzyme/pulls/672"},"html":{"href":"https://github.com/airbnb/enzyme/pull/672"},"issue":{"href":"https://api.github.com/repos/airbnb/enzyme/issues/672"},"comments":{"href":"https://api.github.com/repos/airbnb/enzyme/issues/672/comments"},"review_comments":{"href":"https://api.github.com/repos/airbnb/enzyme/pulls/672/comments"},"review_comment":{"href":"https://api.github.com/repos/airbnb/enzyme/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/airbnb/enzyme/pulls/672/commits"},"statuses":{"href":"https://api.github.com/repos/airbnb/enzyme/statuses/50c8314699b5bdc4bac7f8faaf26d8b7c8cedcd2"}}}}
{"actor":{"display_login":"ljharb"}}