Skip to content
Snippets Groups Projects
Commit 4b9c5df5 authored by Angelina Filippova's avatar Angelina Filippova
Browse files

Add test for SetActiveTab arguments

parent f4df449f
No related branches found
No related tags found
2 merge requests!125WIP: Release/2.0.3,!102Implement settings search
...@@ -4,11 +4,11 @@ import Element from 'element-ui' ...@@ -4,11 +4,11 @@ import Element from 'element-ui'
import Settings from '@/views/settings/index' import Settings from '@/views/settings/index'
import flushPromises from 'flush-promises' import flushPromises from 'flush-promises'
import app from '@/store/modules/app' import app from '@/store/modules/app'
import getters from '@/store/getters'
import relays from '@/store/modules/relays' import relays from '@/store/modules/relays'
import settings from '@/store/modules/settings' import settings from '@/store/modules/settings'
import user from '@/store/modules/user' import user from '@/store/modules/user'
import users from '@/store/modules/users' import users from '@/store/modules/users'
import getters from '@/store/getters'
config.mocks["$t"] = () => {} config.mocks["$t"] = () => {}
...@@ -19,17 +19,18 @@ localVue.use(Element) ...@@ -19,17 +19,18 @@ localVue.use(Element)
describe('Settings search', () => { describe('Settings search', () => {
let store let store
let actions let actions
let permission
beforeEach(() => { beforeEach(() => {
actions = { SetActiveTab: jest.fn() } actions = { SetActiveTab: jest.fn() }
permission = { addRouters: jest.fn() }
store = new Vuex.Store({ store = new Vuex.Store({
modules: { modules: {
app, app,
permission,
relays, relays,
settings: { ...settings, actions }, settings: { ...settings, actions },
user, user,
users
}, },
getters getters
}) })
...@@ -55,6 +56,8 @@ describe('Settings search', () => { ...@@ -55,6 +56,8 @@ describe('Settings search', () => {
await flushPromises() await flushPromises()
wrapper.vm.handleSearchSelect({ group: 'Pleroma.Upload', key: 'Pleroma.Upload' }) wrapper.vm.handleSearchSelect({ group: 'Pleroma.Upload', key: 'Pleroma.Upload' })
expect(actions.SetActiveTab).toHaveBeenCalled() expect(actions.SetActiveTab).toHaveBeenCalled()
expect(actions.SetActiveTab).toHaveBeenCalledWith(expect.anything(), 'upload', undefined)
done() done()
}) })
}) })
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment