{"action":"created","issue":{"url":"https://api.github.com/repos/airbnb/enzyme/issues/368","repository_url":"https://api.github.com/repos/airbnb/enzyme","labels_url":"https://api.github.com/repos/airbnb/enzyme/issues/368/labels{/name}","comments_url":"https://api.github.com/repos/airbnb/enzyme/issues/368/comments","events_url":"https://api.github.com/repos/airbnb/enzyme/issues/368/events","html_url":"https://github.com/airbnb/enzyme/pull/368","id":153546728,"number":368,"title":"[RFC] shallow wrapper .simulate() SyntheticEvent and event propagation","user":{"login":"nfcampos","id":56902,"avatar_url":"https://avatars.githubusercontent.com/u/56902?v=3","gravatar_id":"","url":"https://api.github.com/users/nfcampos","html_url":"https://github.com/nfcampos","followers_url":"https://api.github.com/users/nfcampos/followers","following_url":"https://api.github.com/users/nfcampos/following{/other_user}","gists_url":"https://api.github.com/users/nfcampos/gists{/gist_id}","starred_url":"https://api.github.com/users/nfcampos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfcampos/subscriptions","organizations_url":"https://api.github.com/users/nfcampos/orgs","repos_url":"https://api.github.com/users/nfcampos/repos","events_url":"https://api.github.com/users/nfcampos/events{/privacy}","received_events_url":"https://api.github.com/users/nfcampos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-05-06T21:59:38Z","updated_at":"2016-05-08T17:14:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/airbnb/enzyme/pulls/368","html_url":"https://github.com/airbnb/enzyme/pull/368","diff_url":"https://github.com/airbnb/enzyme/pull/368.diff","patch_url":"https://github.com/airbnb/enzyme/pull/368.patch"},"body":"What do you guys think about this? I just added an empty React SyntheticEvent as the first argument that `.simulate` calls event handlers with.\r\nThis provides the regular event methods (`stopPropagation` and friends) by default but still allows the user to replace them eg. with spies, exactly the same way they do now.\r\n\r\n## todo\r\n- [ ] make propagation tests tree be deeper\r\n  - [ ] assert that event handlers for other events aren't called neither on target node nor on parents\r\n- [ ] test that it successfully skips over intermediate nodes without event handler\r\n- [ ] test propagation when clicking on a 'composite' node\r\n- [ ] assert presence of `stopPropagation` and friends on event object passed to event handlers\r\n- [ ] guard with `this.single`\r\n  - [ ] test that it throws with more than one node\r\n  - [ ] test that it works with forEach on multiple nodes\r\n- [ ] add propagation tests for SFCs\r\n- [ ] add propagation tests for createClass?"},"comment":{"url":"https://api.github.com/repos/airbnb/enzyme/issues/comments/217734216","html_url":"https://github.com/airbnb/enzyme/pull/368#issuecomment-217734216","issue_url":"https://api.github.com/repos/airbnb/enzyme/issues/368","id":217734216,"user":{"login":"nfcampos","id":56902,"avatar_url":"https://avatars.githubusercontent.com/u/56902?v=3","gravatar_id":"","url":"https://api.github.com/users/nfcampos","html_url":"https://github.com/nfcampos","followers_url":"https://api.github.com/users/nfcampos/followers","following_url":"https://api.github.com/users/nfcampos/following{/other_user}","gists_url":"https://api.github.com/users/nfcampos/gists{/gist_id}","starred_url":"https://api.github.com/users/nfcampos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfcampos/subscriptions","organizations_url":"https://api.github.com/users/nfcampos/orgs","repos_url":"https://api.github.com/users/nfcampos/repos","events_url":"https://api.github.com/users/nfcampos/events{/privacy}","received_events_url":"https://api.github.com/users/nfcampos/received_events","type":"User","site_admin":false},"created_at":"2016-05-08T17:14:00Z","updated_at":"2016-05-08T17:14:00Z","body":"> what about the capture phase? do we want to simulate onClickCapture?\r\n\r\nIf you think it's worth it, I can add that, it's doable, do you think it's worth it?"}}