{"action":"opened","issue":{"url":"https://api.github.com/repos/eddyerburgh/avoriaz/issues/48","repository_url":"https://api.github.com/repos/eddyerburgh/avoriaz","labels_url":"https://api.github.com/repos/eddyerburgh/avoriaz/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/eddyerburgh/avoriaz/issues/48/comments","events_url":"https://api.github.com/repos/eddyerburgh/avoriaz/issues/48/events","html_url":"https://github.com/eddyerburgh/avoriaz/issues/48","id":234237910,"number":48,"title":"Testing whether an event handler is called","user":{"login":"mattixittam","id":2349560,"avatar_url":"https://avatars3.githubusercontent.com/u/2349560?v=3","gravatar_id":"","url":"https://api.github.com/users/mattixittam","html_url":"https://github.com/mattixittam","followers_url":"https://api.github.com/users/mattixittam/followers","following_url":"https://api.github.com/users/mattixittam/following{/other_user}","gists_url":"https://api.github.com/users/mattixittam/gists{/gist_id}","starred_url":"https://api.github.com/users/mattixittam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattixittam/subscriptions","organizations_url":"https://api.github.com/users/mattixittam/orgs","repos_url":"https://api.github.com/users/mattixittam/repos","events_url":"https://api.github.com/users/mattixittam/events{/privacy}","received_events_url":"https://api.github.com/users/mattixittam/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-07T14:53:56Z","updated_at":"2017-06-07T14:53:56Z","closed_at":null,"body":"I'd like to test whether an event handler is called. I thought this would work, but it doesn't:\r\n```\r\nit('handles the input event', () => {\r\n    const wrapper = mount(UiInput)\r\n    const handleInput = sinon.spy(wrapper.vm, 'handleInput')\r\n\r\n    wrapper.find('input')[0].dispatch('input')\r\n\r\n    expect(handleInput).to.be.calledOnce\r\n})\r\n```\r\n(handleInput is a method on the UiInput component, and is bound by @input=\"handleInput\" on the input element)\r\n\r\nIt is called 0 times. If I call the handler directly instead of dispatching the event, the expect returns true. Seems the dispatch does not trigger the v-on binding somehow? Any idea why this happens?\r\n"}}
{"actor":{"display_login":"mattixittam"}}