{"action":"created","issue":{"url":"https://api.github.com/repos/airbnb/enzyme/issues/134","repository_url":"https://api.github.com/repos/airbnb/enzyme","labels_url":"https://api.github.com/repos/airbnb/enzyme/issues/134/labels{/name}","comments_url":"https://api.github.com/repos/airbnb/enzyme/issues/134/comments","events_url":"https://api.github.com/repos/airbnb/enzyme/issues/134/events","html_url":"https://github.com/airbnb/enzyme/issues/134","id":128266982,"number":134,"title":"hasClass does not work on root ReactWrapper","user":{"login":"amccloud","id":38463,"avatar_url":"https://avatars.githubusercontent.com/u/38463?v=3","gravatar_id":"","url":"https://api.github.com/users/amccloud","html_url":"https://github.com/amccloud","followers_url":"https://api.github.com/users/amccloud/followers","following_url":"https://api.github.com/users/amccloud/following{/other_user}","gists_url":"https://api.github.com/users/amccloud/gists{/gist_id}","starred_url":"https://api.github.com/users/amccloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amccloud/subscriptions","organizations_url":"https://api.github.com/users/amccloud/orgs","repos_url":"https://api.github.com/users/amccloud/repos","events_url":"https://api.github.com/users/amccloud/events{/privacy}","received_events_url":"https://api.github.com/users/amccloud/received_events","type":"User","site_admin":false},"labels":[{"id":284995841,"url":"https://api.github.com/repos/airbnb/enzyme/labels/bug","name":"bug","color":"fc2929","default":true},{"id":284995844,"url":"https://api.github.com/repos/airbnb/enzyme/labels/help%20wanted","name":"help wanted","color":"159818","default":true},{"id":285505513,"url":"https://api.github.com/repos/airbnb/enzyme/labels/Mount","name":"Mount","color":"5319e7","default":false},{"id":285505634,"url":"https://api.github.com/repos/airbnb/enzyme/labels/Your%20First%20PR","name":"Your First PR","color":"0052cc","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-01-22T23:04:16Z","updated_at":"2016-12-21T13:38:42Z","closed_at":"2016-03-15T05:11:54Z","body":"I think this is because `MountedTraversal#instHasClassName` short circuits to false if the instance does not pass the `isDOMComponent` check. Could we relax the check?\n\nExample test case (React 0.14):\n\n``` javascript\nconst shallowComponent = shallow(<Video src=\"example.mp4\" />);\nconst mountComponent = mount(<Video src=\"example.mp4\" />);\n\n// From ShallowTraversal\n// Works!\nassert.equal(shallowComponent.node.props.className, 'Video');\n\n// Works!\nassert.isTrue(shallowComponent.hasClass('Video'));\n\n// Fails :( because isDOMComponent(mountComponent.node) is false\n// Would otherwise pass\nassert.isTrue(mountComponent.hasClass('Video'));\n\n// From MountedTraversal (without isDOMComponent check)\n// Works!\nassert.equal(findDOMNode(mountComponent.node).className, 'Video');\n\n// Works! ... but seems unnecessary\nassert.isTrue(mountComponent.find('.Video').hasClass('Video'));\n```\n"},"comment":{"url":"https://api.github.com/repos/airbnb/enzyme/issues/comments/268524780","html_url":"https://github.com/airbnb/enzyme/issues/134#issuecomment-268524780","issue_url":"https://api.github.com/repos/airbnb/enzyme/issues/134","id":268524780,"user":{"login":"bbnnt","id":7711,"avatar_url":"https://avatars.githubusercontent.com/u/7711?v=3","gravatar_id":"","url":"https://api.github.com/users/bbnnt","html_url":"https://github.com/bbnnt","followers_url":"https://api.github.com/users/bbnnt/followers","following_url":"https://api.github.com/users/bbnnt/following{/other_user}","gists_url":"https://api.github.com/users/bbnnt/gists{/gist_id}","starred_url":"https://api.github.com/users/bbnnt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbnnt/subscriptions","organizations_url":"https://api.github.com/users/bbnnt/orgs","repos_url":"https://api.github.com/users/bbnnt/repos","events_url":"https://api.github.com/users/bbnnt/events{/privacy}","received_events_url":"https://api.github.com/users/bbnnt/received_events","type":"User","site_admin":false},"created_at":"2016-12-21T13:38:42Z","updated_at":"2016-12-21T13:38:42Z","body":"does this https://github.com/airbnb/enzyme/pull/677/files/e9ede3e2eac83bc8af7e51058616ff11acc1da3f#diff-2f849fa739461853c70ddd193891074f (#677) close the issue ?"}}
{"actor":{"display_login":"bbnnt"}}