{"action":"created","issue":{"url":"https://api.github.com/repos/airbnb/enzyme/issues/669","repository_url":"https://api.github.com/repos/airbnb/enzyme","labels_url":"https://api.github.com/repos/airbnb/enzyme/issues/669/labels{/name}","comments_url":"https://api.github.com/repos/airbnb/enzyme/issues/669/comments","events_url":"https://api.github.com/repos/airbnb/enzyme/issues/669/events","html_url":"https://github.com/airbnb/enzyme/issues/669","id":188257158,"number":669,"title":"Assertion based on attribute or get attribute from element.","user":{"login":"ilacyero","id":1781538,"avatar_url":"https://avatars.githubusercontent.com/u/1781538?v=3","gravatar_id":"","url":"https://api.github.com/users/ilacyero","html_url":"https://github.com/ilacyero","followers_url":"https://api.github.com/users/ilacyero/followers","following_url":"https://api.github.com/users/ilacyero/following{/other_user}","gists_url":"https://api.github.com/users/ilacyero/gists{/gist_id}","starred_url":"https://api.github.com/users/ilacyero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilacyero/subscriptions","organizations_url":"https://api.github.com/users/ilacyero/orgs","repos_url":"https://api.github.com/users/ilacyero/repos","events_url":"https://api.github.com/users/ilacyero/events{/privacy}","received_events_url":"https://api.github.com/users/ilacyero/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-09T14:14:19Z","updated_at":"2016-11-09T15:09:34Z","closed_at":null,"body":"Hi I am testing a image component and I tried to verify its src attribute, I couldn't find any option to assert the attribute or get the value of attribute, my workaround is:\r\n```\r\n    expect(component.find('img').html()).toContain(IMAGE_PATH);\r\n```\r\nIt works but I really prefer to have a way to assert or get the attribute:\r\n```\r\n    expect(component.find('img').attr('src')).toEqual(IMAGE_PATH);\r\n    expect(component.find('img')).hasAttr('src', IMAGE_PATH);\r\n```"},"comment":{"url":"https://api.github.com/repos/airbnb/enzyme/issues/comments/259436633","html_url":"https://github.com/airbnb/enzyme/issues/669#issuecomment-259436633","issue_url":"https://api.github.com/repos/airbnb/enzyme/issues/669","id":259436633,"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},"created_at":"2016-11-09T15:09:34Z","updated_at":"2016-11-09T15:09:34Z","body":"`expect(component.find('img').findWhere({ src: IMAGE_PATH })).to.have.lengthOf(1)`?"}}
{"actor":{"display_login":"ljharb"}}