|
@@ -378,9 +378,10 @@ describe('Vuex', () => {
|
|
let calls = 0
|
|
let calls = 0
|
|
const makeAction = n => {
|
|
const makeAction = n => {
|
|
return {
|
|
return {
|
|
- [TEST] ({ state }) {
|
|
|
|
|
|
+ [TEST] ({ state, rootState }) {
|
|
calls++
|
|
calls++
|
|
expect(state.a).to.equal(n)
|
|
expect(state.a).to.equal(n)
|
|
|
|
+ expect(rootState).to.equal(store.state)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -424,7 +425,12 @@ describe('Vuex', () => {
|
|
|
|
|
|
it('module: getters', function () {
|
|
it('module: getters', function () {
|
|
const makeGetter = n => ({
|
|
const makeGetter = n => ({
|
|
- [`getter${n}`]: state => state.a
|
|
|
|
|
|
+ [`getter${n}`]: (state, rootState) => {
|
|
|
|
+ if (rootState) {
|
|
|
|
+ expect(rootState).to.equal(store.state)
|
|
|
|
+ }
|
|
|
|
+ return state.a
|
|
|
|
+ }
|
|
})
|
|
})
|
|
const store = new Vuex.Store({
|
|
const store = new Vuex.Store({
|
|
state: {
|
|
state: {
|