refs #209 Fix mock store for Preferences/General

This commit is contained in:
AkiraFukushima 2019-03-10 22:14:47 +09:00
parent d95dbfa559
commit bdb3b71318
2 changed files with 12 additions and 2 deletions

View File

@ -28,6 +28,15 @@ const initStore = () => {
}
}
const app = {
namespaced: true,
actions: {
loadPreferences (_) {
return true
}
}
}
describe('Preferences/General', () => {
let store
let localVue
@ -37,7 +46,8 @@ describe('Preferences/General', () => {
localVue.use(Vuex)
store = new Vuex.Store({
modules: {
Preferences: initStore()
Preferences: initStore(),
App: app
}
})
})

View File

@ -71,7 +71,7 @@ describe('AddListMember', () => {
}
Mastodon.mockImplementation(() => mockClient)
const accounts = await store.dispatch('AddListMember/search', 'akira')
await store.dispatch('AddListMember/search', 'akira')
expect(store.state.AddListMember.accounts).toEqual([
{ id: 1, name: 'h3poteto' },
{ id: 2, name: 'akito19' }