{"action":"closed","issue":{"url":"https://api.github.com/repos/vuejs/vue-test-utils/issues/614","repository_url":"https://api.github.com/repos/vuejs/vue-test-utils","labels_url":"https://api.github.com/repos/vuejs/vue-test-utils/issues/614/labels{/name}","comments_url":"https://api.github.com/repos/vuejs/vue-test-utils/issues/614/comments","events_url":"https://api.github.com/repos/vuejs/vue-test-utils/issues/614/events","html_url":"https://github.com/vuejs/vue-test-utils/issues/614","id":323314752,"number":614,"title":"Trigger disregards `setMethods` and remains referencing the old one","user":{"login":"lchanmann","id":441658,"avatar_url":"https://avatars3.githubusercontent.com/u/441658?v=4","gravatar_id":"","url":"https://api.github.com/users/lchanmann","html_url":"https://github.com/lchanmann","followers_url":"https://api.github.com/users/lchanmann/followers","following_url":"https://api.github.com/users/lchanmann/following{/other_user}","gists_url":"https://api.github.com/users/lchanmann/gists{/gist_id}","starred_url":"https://api.github.com/users/lchanmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lchanmann/subscriptions","organizations_url":"https://api.github.com/users/lchanmann/orgs","repos_url":"https://api.github.com/users/lchanmann/repos","events_url":"https://api.github.com/users/lchanmann/events{/privacy}","received_events_url":"https://api.github.com/users/lchanmann/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-15T17:34:51Z","updated_at":"2018-05-15T17:34:52Z","closed_at":"2018-05-15T17:34:51Z","author_association":"CONTRIBUTOR","body":"## Version\r\n1.0.0-beta.16\r\n\r\n## Reproduction link\r\nhttps://github.com/lchanmann/vue-test-utils-setMethods-issue\r\n\r\n## Steps to reproduce\r\nClone the repo, then run:\r\n\r\n    yarn install\r\n    yarn test\r\n\r\n## What is expected?\r\nShould pass tests\r\n\r\n## What is actually happening?\r\n\r\nTest fail:\r\n\r\n    FAIL  ./setMethods.test.js\r\n     ● Console\r\n   \r\n       console.log setMethods.test.js:9\r\n         clickMethod\r\n   \r\n     ● setMethods › calls stub when event is triggered\r\n   \r\n       expect(jest.fn()).toHaveBeenCalled()\r\n   \r\n       Expected mock function to have been called.\r\n   \r\n         at Object.<anonymous> (setMethods.test.js:17:29)\r\n             at new Promise (<anonymous>)\r\n             at <anonymous>\r\n         at process._tickCallback (internal/process/next_tick.js:188:7)\r\n\r\n\r\n### setMethods.test.js\r\n\r\n```javascript\r\nimport { mount } from '@vue/test-utils'\r\n\r\ndescribe('setMethods', () => {\r\n  it('calls stub when event is triggered', () => {\r\n    const TestComponent = {\r\n      template: '<button @click=\"clickMethod\">Click here</button>',\r\n      methods: {\r\n        clickMethod() {\r\n          console.log('clickMethod')\r\n        }\r\n      }\r\n    }\r\n    const wrapper = mount(TestComponent)\r\n    const clickMethodStub = jest.fn()\r\n    wrapper.setMethods({ clickMethod: clickMethodStub })\r\n    wrapper.find('button').trigger('click')\r\n    expect(clickMethodStub).toHaveBeenCalled()\r\n  })\r\n})\r\n\r\n```"}}
{"actor":{"display_login":"vue-issue-bot"}}