refs #209 Fix mock store for Preferences/General
This commit is contained in:
parent
d95dbfa559
commit
bdb3b71318
|
@ -28,6 +28,15 @@ const initStore = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const app = {
|
||||||
|
namespaced: true,
|
||||||
|
actions: {
|
||||||
|
loadPreferences (_) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
describe('Preferences/General', () => {
|
describe('Preferences/General', () => {
|
||||||
let store
|
let store
|
||||||
let localVue
|
let localVue
|
||||||
|
@ -37,7 +46,8 @@ describe('Preferences/General', () => {
|
||||||
localVue.use(Vuex)
|
localVue.use(Vuex)
|
||||||
store = new Vuex.Store({
|
store = new Vuex.Store({
|
||||||
modules: {
|
modules: {
|
||||||
Preferences: initStore()
|
Preferences: initStore(),
|
||||||
|
App: app
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -71,7 +71,7 @@ describe('AddListMember', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
Mastodon.mockImplementation(() => mockClient)
|
Mastodon.mockImplementation(() => mockClient)
|
||||||
const accounts = await store.dispatch('AddListMember/search', 'akira')
|
await store.dispatch('AddListMember/search', 'akira')
|
||||||
expect(store.state.AddListMember.accounts).toEqual([
|
expect(store.state.AddListMember.accounts).toEqual([
|
||||||
{ id: 1, name: 'h3poteto' },
|
{ id: 1, name: 'h3poteto' },
|
||||||
{ id: 2, name: 'akito19' }
|
{ id: 2, name: 'akito19' }
|
||||||
|
|
Loading…
Reference in New Issue