mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
Tests
This commit is contained in:
parent
c64ee90311
commit
73c1d2aa63
@ -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 => {
|
||||
|
7
test/fixtures/basic/pages/store.vue
vendored
7
test/fixtures/basic/pages/store.vue
vendored
@ -3,6 +3,8 @@
|
||||
<h1>{{ baz }}</h1>
|
||||
<br>
|
||||
<p>{{ $store.state.counter }}</p>
|
||||
<br>
|
||||
<h2>{{ getVal }}</h2>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -10,6 +12,9 @@
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
computed: mapGetters('foo/bar', ['baz'])
|
||||
computed: {
|
||||
...mapGetters('foo/bar', ['baz']),
|
||||
...mapGetters('foo/blarg', ['getVal'])
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
5
test/fixtures/basic/store/foo/blarg/getters.js
vendored
Normal file
5
test/fixtures/basic/store/foo/blarg/getters.js
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
export default {
|
||||
getVal(state) {
|
||||
return state.val
|
||||
}
|
||||
}
|
3
test/fixtures/basic/store/foo/blarg/state.js
vendored
Normal file
3
test/fixtures/basic/store/foo/blarg/state.js
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
export default () => ({
|
||||
val: 4
|
||||
})
|
Loading…
Reference in New Issue
Block a user