From 0825cc4cf6dd24a9934c17fe627f69450b8b193f Mon Sep 17 00:00:00 2001 From: Suraj Kumar Shrestha Date: Fri, 8 Jun 2018 15:26:03 +0545 Subject: [PATCH 1/2] docs: update Vuex guide for namespaced option --- docs/guides/using-with-vuex.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/guides/using-with-vuex.md b/docs/guides/using-with-vuex.md index 45a50c343..46c084e53 100644 --- a/docs/guides/using-with-vuex.md +++ b/docs/guides/using-with-vuex.md @@ -214,10 +214,10 @@ Simple component that includes one action and one getter. And the test: ``` js -import { shallowMount, createLocalVue } from '@vue/test-utils' +import { createLocalVue, shallowMount } from '@vue/test-utils' import Vuex from 'vuex' import MyComponent from '../../../src/components/MyComponent' -import mymodule from '../../../src/store/mymodule' +import myModule from '../../../src/store/myModule' const localVue = createLocalVue() @@ -230,9 +230,7 @@ describe('MyComponent.vue', () => { beforeEach(() => { state = { - module: { - clicks: 2 - } + clicks: 2 } actions = { @@ -241,10 +239,11 @@ describe('MyComponent.vue', () => { store = new Vuex.Store({ modules: { - mymodule: { + myModule: { + namespaced: true, // If store/myModule is namespaced https://vuex.vuejs.org/guide/modules.html#namespacing state, actions, - getters: module.getters + getters: myModule.getters } } }) @@ -257,7 +256,7 @@ describe('MyComponent.vue', () => { expect(actions.moduleActionClick).toHaveBeenCalled() }) - it('Renders "state.inputValue" in first p tag', () => { + it('renders "state.inputValue" in first p tag', () => { const wrapper = shallowMount(MyComponent, { store, localVue }) const p = wrapper.find('p') expect(p.text()).toBe(state.clicks.toString()) From db688ef6fc0427c09eb8353c0d358be69861dee9 Mon Sep 17 00:00:00 2001 From: suraj Date: Sat, 9 Jun 2018 22:41:08 +0545 Subject: [PATCH 2/2] docs: update Vuex guide --- docs/guides/using-with-vuex.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/guides/using-with-vuex.md b/docs/guides/using-with-vuex.md index 46c084e53..af608040c 100644 --- a/docs/guides/using-with-vuex.md +++ b/docs/guides/using-with-vuex.md @@ -214,7 +214,7 @@ Simple component that includes one action and one getter. And the test: ``` js -import { createLocalVue, shallowMount } from '@vue/test-utils' +import { shallowMount, createLocalVue } from '@vue/test-utils' import Vuex from 'vuex' import MyComponent from '../../../src/components/MyComponent' import myModule from '../../../src/store/myModule' @@ -240,7 +240,6 @@ describe('MyComponent.vue', () => { store = new Vuex.Store({ modules: { myModule: { - namespaced: true, // If store/myModule is namespaced https://vuex.vuejs.org/guide/modules.html#namespacing state, actions, getters: myModule.getters