{"action":"created","comment":{"url":"https://api.github.com/repos/vuejs/vue-test-utils/pulls/comments/144600757","pull_request_review_id":69283323,"id":144600757,"diff_hunk":"@@ -0,0 +1,266 @@\n+# Vuex と一緒に使用する\n+\n+このガイドでは、`vue-test-utils` でコンポーネントで Vuex をテストする方法について、見ていきます。\n+\n+## アクションのモック\n+\n+それではいくつかのコードを見ていきましょう。\n+\n+これはテストしたいコンポーネントです。これは Vuex のアクションを呼び出します。\n+\n+``` html\n+<template>\n+    <div class=\"text-align-center\">\n+      <input type=\"text\" @input=\"actionInputIfTrue\" />\n+      <button @click=\"actionClick()\">Click</button>\n+    </div>\n+</template>\n+\n+<script>\n+import { mapActions } from 'vuex'\n+\n+export default{\n+  methods: {\n+    ...mapActions([\n+      'actionClick'\n+    ]),\n+    actionInputIfTrue: function actionInputIfTrue (event) {\n+      const inputValue = event.target.value\n+      if (inputValue === 'input') {\n+        this.$store.dispatch('actionInput', { inputValue })\n+      }\n+    }\n+  }\n+}\n+</script>\n+```\n+\n+このテストの目的のために、アクションが何をしているのか、またはストアがどのように見えるかは気にしません。これらのアクションが必要なときに発行されていること、そして期待された値によって発行されていることを知ることが必要です。\n+\n+これをテストするためには、私たちのコンポーネントを shallow するときに Vue にモックストアを渡す必要があります。\n+\n+ストアを Vue コンストラクタベースに渡す代わりに、[localVue](../api/options.md#localvue) に渡すことができます。localeVue はグローバルな Vue コンストラクタに影響を与えずに、変更を加えることができるスコープ付き Vue コンストラクタです。\n+\n+これがどのように見えるか見ていきましょう:\n+\n+``` js\n+import { shallow, createLocalVue } from 'vue-test-utils'\n+import Vuex from 'vuex'\n+import Actions from '../../../src/components/Actions'\n+\n+const localVue = createLocalVue()\n+\n+localVue.use(Vuex)\n+\n+describe('Actions.vue', () => {\n+  let actions\n+  let store\n+\n+  beforeEach(() => {\n+    actions = {\n+      actionClick: jest.fn(),\n+      actionInput: jest.fn()\n+    }\n+    store = new Vuex.Store({\n+      state: {},\n+      actions\n+    })\n+  })\n+\n+  it('calls store action actionInput when input value is input and an input even is fired', () => {","path":"docs/ja/guides/using-with-vuex.md","position":70,"original_position":70,"commit_id":"2b5a1fe7ccd6f1f502d93542336a7fc2463151eb","original_commit_id":"2b5a1fe7ccd6f1f502d93542336a7fc2463151eb","user":{"login":"kazupon","id":72989,"avatar_url":"https://avatars1.githubusercontent.com/u/72989?v=4","gravatar_id":"","url":"https://api.github.com/users/kazupon","html_url":"https://github.com/kazupon","followers_url":"https://api.github.com/users/kazupon/followers","following_url":"https://api.github.com/users/kazupon/following{/other_user}","gists_url":"https://api.github.com/users/kazupon/gists{/gist_id}","starred_url":"https://api.github.com/users/kazupon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazupon/subscriptions","organizations_url":"https://api.github.com/users/kazupon/orgs","repos_url":"https://api.github.com/users/kazupon/repos","events_url":"https://api.github.com/users/kazupon/events{/privacy}","received_events_url":"https://api.github.com/users/kazupon/received_events","type":"User","site_admin":false},"body":"oh... I could not notice. 👀 \r\nThanks!","created_at":"2017-10-13T16:32:26Z","updated_at":"2017-10-13T16:32:26Z","html_url":"https://github.com/vuejs/vue-test-utils/pull/95#discussion_r144600757","pull_request_url":"https://api.github.com/repos/vuejs/vue-test-utils/pulls/95","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/vuejs/vue-test-utils/pulls/comments/144600757"},"html":{"href":"https://github.com/vuejs/vue-test-utils/pull/95#discussion_r144600757"},"pull_request":{"href":"https://api.github.com/repos/vuejs/vue-test-utils/pulls/95"}},"in_reply_to_id":144582505},"pull_request":{"url":"https://api.github.com/repos/vuejs/vue-test-utils/pulls/95","id":146430465,"html_url":"https://github.com/vuejs/vue-test-utils/pull/95","diff_url":"https://github.com/vuejs/vue-test-utils/pull/95.diff","patch_url":"https://github.com/vuejs/vue-test-utils/pull/95.patch","issue_url":"https://api.github.com/repos/vuejs/vue-test-utils/issues/95","number":95,"state":"open","locked":false,"title":"Translation for Japanese","user":{"login":"kazupon","id":72989,"avatar_url":"https://avatars1.githubusercontent.com/u/72989?v=4","gravatar_id":"","url":"https://api.github.com/users/kazupon","html_url":"https://github.com/kazupon","followers_url":"https://api.github.com/users/kazupon/followers","following_url":"https://api.github.com/users/kazupon/following{/other_user}","gists_url":"https://api.github.com/users/kazupon/gists{/gist_id}","starred_url":"https://api.github.com/users/kazupon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazupon/subscriptions","organizations_url":"https://api.github.com/users/kazupon/orgs","repos_url":"https://api.github.com/users/kazupon/repos","events_url":"https://api.github.com/users/kazupon/events{/privacy}","received_events_url":"https://api.github.com/users/kazupon/received_events","type":"User","site_admin":false},"body":"related #58 \r\nbased on translation by @sunecosuri (thanks!)\r\n\r\n/cc @sunecosuri @re-fort \r\nもし、可能でしたらレビューお願いできますか？","created_at":"2017-10-13T11:07:19Z","updated_at":"2017-10-13T16:32:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"71f766981d1ec45e023058783ecc2cf9755a9ecd","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/vuejs/vue-test-utils/pulls/95/commits","review_comments_url":"https://api.github.com/repos/vuejs/vue-test-utils/pulls/95/comments","review_comment_url":"https://api.github.com/repos/vuejs/vue-test-utils/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vuejs/vue-test-utils/issues/95/comments","statuses_url":"https://api.github.com/repos/vuejs/vue-test-utils/statuses/2b5a1fe7ccd6f1f502d93542336a7fc2463151eb","head":{"label":"kazupon:translate-ja","ref":"translate-ja","sha":"2b5a1fe7ccd6f1f502d93542336a7fc2463151eb","user":{"login":"kazupon","id":72989,"avatar_url":"https://avatars1.githubusercontent.com/u/72989?v=4","gravatar_id":"","url":"https://api.github.com/users/kazupon","html_url":"https://github.com/kazupon","followers_url":"https://api.github.com/users/kazupon/followers","following_url":"https://api.github.com/users/kazupon/following{/other_user}","gists_url":"https://api.github.com/users/kazupon/gists{/gist_id}","starred_url":"https://api.github.com/users/kazupon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazupon/subscriptions","organizations_url":"https://api.github.com/users/kazupon/orgs","repos_url":"https://api.github.com/users/kazupon/repos","events_url":"https://api.github.com/users/kazupon/events{/privacy}","received_events_url":"https://api.github.com/users/kazupon/received_events","type":"User","site_admin":false},"repo":{"id":106373905,"name":"vue-test-utils","full_name":"kazupon/vue-test-utils","owner":{"login":"kazupon","id":72989,"avatar_url":"https://avatars1.githubusercontent.com/u/72989?v=4","gravatar_id":"","url":"https://api.github.com/users/kazupon","html_url":"https://github.com/kazupon","followers_url":"https://api.github.com/users/kazupon/followers","following_url":"https://api.github.com/users/kazupon/following{/other_user}","gists_url":"https://api.github.com/users/kazupon/gists{/gist_id}","starred_url":"https://api.github.com/users/kazupon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazupon/subscriptions","organizations_url":"https://api.github.com/users/kazupon/orgs","repos_url":"https://api.github.com/users/kazupon/repos","events_url":"https://api.github.com/users/kazupon/events{/privacy}","received_events_url":"https://api.github.com/users/kazupon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kazupon/vue-test-utils","description":"Utilities for testing Vue components","fork":true,"url":"https://api.github.com/repos/kazupon/vue-test-utils","forks_url":"https://api.github.com/repos/kazupon/vue-test-utils/forks","keys_url":"https://api.github.com/repos/kazupon/vue-test-utils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kazupon/vue-test-utils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kazupon/vue-test-utils/teams","hooks_url":"https://api.github.com/repos/kazupon/vue-test-utils/hooks","issue_events_url":"https://api.github.com/repos/kazupon/vue-test-utils/issues/events{/number}","events_url":"https://api.github.com/repos/kazupon/vue-test-utils/events","assignees_url":"https://api.github.com/repos/kazupon/vue-test-utils/assignees{/user}","branches_url":"https://api.github.com/repos/kazupon/vue-test-utils/branches{/branch}","tags_url":"https://api.github.com/repos/kazupon/vue-test-utils/tags","blobs_url":"https://api.github.com/repos/kazupon/vue-test-utils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kazupon/vue-test-utils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kazupon/vue-test-utils/git/refs{/sha}","trees_url":"https://api.github.com/repos/kazupon/vue-test-utils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kazupon/vue-test-utils/statuses/{sha}","languages_url":"https://api.github.com/repos/kazupon/vue-test-utils/languages","stargazers_url":"https://api.github.com/repos/kazupon/vue-test-utils/stargazers","contributors_url":"https://api.github.com/repos/kazupon/vue-test-utils/contributors","subscribers_url":"https://api.github.com/repos/kazupon/vue-test-utils/subscribers","subscription_url":"https://api.github.com/repos/kazupon/vue-test-utils/subscription","commits_url":"https://api.github.com/repos/kazupon/vue-test-utils/commits{/sha}","git_commits_url":"https://api.github.com/repos/kazupon/vue-test-utils/git/commits{/sha}","comments_url":"https://api.github.com/repos/kazupon/vue-test-utils/comments{/number}","issue_comment_url":"https://api.github.com/repos/kazupon/vue-test-utils/issues/comments{/number}","contents_url":"https://api.github.com/repos/kazupon/vue-test-utils/contents/{+path}","compare_url":"https://api.github.com/repos/kazupon/vue-test-utils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kazupon/vue-test-utils/merges","archive_url":"https://api.github.com/repos/kazupon/vue-test-utils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kazupon/vue-test-utils/downloads","issues_url":"https://api.github.com/repos/kazupon/vue-test-utils/issues{/number}","pulls_url":"https://api.github.com/repos/kazupon/vue-test-utils/pulls{/number}","milestones_url":"https://api.github.com/repos/kazupon/vue-test-utils/milestones{/number}","notifications_url":"https://api.github.com/repos/kazupon/vue-test-utils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kazupon/vue-test-utils/labels{/name}","releases_url":"https://api.github.com/repos/kazupon/vue-test-utils/releases{/id}","deployments_url":"https://api.github.com/repos/kazupon/vue-test-utils/deployments","created_at":"2017-10-10T05:53:11Z","updated_at":"2017-10-10T05:53:13Z","pushed_at":"2017-10-13T11:23:54Z","git_url":"git://github.com/kazupon/vue-test-utils.git","ssh_url":"git@github.com:kazupon/vue-test-utils.git","clone_url":"https://github.com/kazupon/vue-test-utils.git","svn_url":"https://github.com/kazupon/vue-test-utils","homepage":"https://vue-test-utils.vuejs.org","size":1718,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"vuejs:dev","ref":"dev","sha":"02b13e85f381c8e28c77604130ad9bea11750b75","user":{"login":"vuejs","id":6128107,"avatar_url":"https://avatars1.githubusercontent.com/u/6128107?v=4","gravatar_id":"","url":"https://api.github.com/users/vuejs","html_url":"https://github.com/vuejs","followers_url":"https://api.github.com/users/vuejs/followers","following_url":"https://api.github.com/users/vuejs/following{/other_user}","gists_url":"https://api.github.com/users/vuejs/gists{/gist_id}","starred_url":"https://api.github.com/users/vuejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuejs/subscriptions","organizations_url":"https://api.github.com/users/vuejs/orgs","repos_url":"https://api.github.com/users/vuejs/repos","events_url":"https://api.github.com/users/vuejs/events{/privacy}","received_events_url":"https://api.github.com/users/vuejs/received_events","type":"Organization","site_admin":false},"repo":{"id":92657585,"name":"vue-test-utils","full_name":"vuejs/vue-test-utils","owner":{"login":"vuejs","id":6128107,"avatar_url":"https://avatars1.githubusercontent.com/u/6128107?v=4","gravatar_id":"","url":"https://api.github.com/users/vuejs","html_url":"https://github.com/vuejs","followers_url":"https://api.github.com/users/vuejs/followers","following_url":"https://api.github.com/users/vuejs/following{/other_user}","gists_url":"https://api.github.com/users/vuejs/gists{/gist_id}","starred_url":"https://api.github.com/users/vuejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuejs/subscriptions","organizations_url":"https://api.github.com/users/vuejs/orgs","repos_url":"https://api.github.com/users/vuejs/repos","events_url":"https://api.github.com/users/vuejs/events{/privacy}","received_events_url":"https://api.github.com/users/vuejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vuejs/vue-test-utils","description":"Utilities for testing Vue components","fork":false,"url":"https://api.github.com/repos/vuejs/vue-test-utils","forks_url":"https://api.github.com/repos/vuejs/vue-test-utils/forks","keys_url":"https://api.github.com/repos/vuejs/vue-test-utils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vuejs/vue-test-utils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vuejs/vue-test-utils/teams","hooks_url":"https://api.github.com/repos/vuejs/vue-test-utils/hooks","issue_events_url":"https://api.github.com/repos/vuejs/vue-test-utils/issues/events{/number}","events_url":"https://api.github.com/repos/vuejs/vue-test-utils/events","assignees_url":"https://api.github.com/repos/vuejs/vue-test-utils/assignees{/user}","branches_url":"https://api.github.com/repos/vuejs/vue-test-utils/branches{/branch}","tags_url":"https://api.github.com/repos/vuejs/vue-test-utils/tags","blobs_url":"https://api.github.com/repos/vuejs/vue-test-utils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vuejs/vue-test-utils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vuejs/vue-test-utils/git/refs{/sha}","trees_url":"https://api.github.com/repos/vuejs/vue-test-utils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vuejs/vue-test-utils/statuses/{sha}","languages_url":"https://api.github.com/repos/vuejs/vue-test-utils/languages","stargazers_url":"https://api.github.com/repos/vuejs/vue-test-utils/stargazers","contributors_url":"https://api.github.com/repos/vuejs/vue-test-utils/contributors","subscribers_url":"https://api.github.com/repos/vuejs/vue-test-utils/subscribers","subscription_url":"https://api.github.com/repos/vuejs/vue-test-utils/subscription","commits_url":"https://api.github.com/repos/vuejs/vue-test-utils/commits{/sha}","git_commits_url":"https://api.github.com/repos/vuejs/vue-test-utils/git/commits{/sha}","comments_url":"https://api.github.com/repos/vuejs/vue-test-utils/comments{/number}","issue_comment_url":"https://api.github.com/repos/vuejs/vue-test-utils/issues/comments{/number}","contents_url":"https://api.github.com/repos/vuejs/vue-test-utils/contents/{+path}","compare_url":"https://api.github.com/repos/vuejs/vue-test-utils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vuejs/vue-test-utils/merges","archive_url":"https://api.github.com/repos/vuejs/vue-test-utils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vuejs/vue-test-utils/downloads","issues_url":"https://api.github.com/repos/vuejs/vue-test-utils/issues{/number}","pulls_url":"https://api.github.com/repos/vuejs/vue-test-utils/pulls{/number}","milestones_url":"https://api.github.com/repos/vuejs/vue-test-utils/milestones{/number}","notifications_url":"https://api.github.com/repos/vuejs/vue-test-utils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vuejs/vue-test-utils/labels{/name}","releases_url":"https://api.github.com/repos/vuejs/vue-test-utils/releases{/id}","deployments_url":"https://api.github.com/repos/vuejs/vue-test-utils/deployments","created_at":"2017-05-28T11:38:09Z","updated_at":"2017-10-13T16:02:19Z","pushed_at":"2017-10-13T11:35:11Z","git_url":"git://github.com/vuejs/vue-test-utils.git","ssh_url":"git@github.com:vuejs/vue-test-utils.git","clone_url":"https://github.com/vuejs/vue-test-utils.git","svn_url":"https://github.com/vuejs/vue-test-utils","homepage":"https://vue-test-utils.vuejs.org","size":1627,"stargazers_count":576,"watchers_count":576,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":43,"mirror_url":null,"open_issues_count":20,"forks":43,"open_issues":20,"watchers":576,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/vuejs/vue-test-utils/pulls/95"},"html":{"href":"https://github.com/vuejs/vue-test-utils/pull/95"},"issue":{"href":"https://api.github.com/repos/vuejs/vue-test-utils/issues/95"},"comments":{"href":"https://api.github.com/repos/vuejs/vue-test-utils/issues/95/comments"},"review_comments":{"href":"https://api.github.com/repos/vuejs/vue-test-utils/pulls/95/comments"},"review_comment":{"href":"https://api.github.com/repos/vuejs/vue-test-utils/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vuejs/vue-test-utils/pulls/95/commits"},"statuses":{"href":"https://api.github.com/repos/vuejs/vue-test-utils/statuses/2b5a1fe7ccd6f1f502d93542336a7fc2463151eb"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"kazupon"}}