From 73c1d2aa631e2f4eea26f0007b844442b19ebba6 Mon Sep 17 00:00:00 2001 From: airjp73 Date: Wed, 31 Jan 2018 14:46:57 -0500 Subject: [PATCH] Tests --- test/basic.csr.test.js | 1 + test/fixtures/basic/pages/store.vue | 7 ++++++- test/fixtures/basic/store/foo/blarg/getters.js | 5 +++++ test/fixtures/basic/store/foo/blarg/state.js | 3 +++ 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/basic/store/foo/blarg/getters.js create mode 100644 test/fixtures/basic/store/foo/blarg/state.js diff --git a/test/basic.csr.test.js b/test/basic.csr.test.js index eb430a62a0..cda6890a1e 100644 --- a/test/basic.csr.test.js +++ b/test/basic.csr.test.js @@ -80,6 +80,7 @@ test.serial('/store', async t => { t.is(await page.$text('h1'), 'Vuex Nested Modules') t.is(await page.$text('p'), '1') + t.is(await page.$text('h2'), '4') }) test.serial('/head', async t => { diff --git a/test/fixtures/basic/pages/store.vue b/test/fixtures/basic/pages/store.vue index 32fbf8750a..f9efbd1175 100644 --- a/test/fixtures/basic/pages/store.vue +++ b/test/fixtures/basic/pages/store.vue @@ -3,6 +3,8 @@

{{ baz }}


{{ $store.state.counter }}

+
+

{{ getVal }}

@@ -10,6 +12,9 @@ import { mapGetters } from 'vuex' export default { - computed: mapGetters('foo/bar', ['baz']) + computed: { + ...mapGetters('foo/bar', ['baz']), + ...mapGetters('foo/blarg', ['getVal']) + } } diff --git a/test/fixtures/basic/store/foo/blarg/getters.js b/test/fixtures/basic/store/foo/blarg/getters.js new file mode 100644 index 0000000000..34a4b4236a --- /dev/null +++ b/test/fixtures/basic/store/foo/blarg/getters.js @@ -0,0 +1,5 @@ +export default { + getVal(state) { + return state.val + } +} diff --git a/test/fixtures/basic/store/foo/blarg/state.js b/test/fixtures/basic/store/foo/blarg/state.js new file mode 100644 index 0000000000..b5a088b8e3 --- /dev/null +++ b/test/fixtures/basic/store/foo/blarg/state.js @@ -0,0 +1,3 @@ +export default () => ({ + val: 4 +})