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

Check if tabs is changed when search value was selected

parent 0cbebe28
No related branches found
No related tags found
2 merge requests!125WIP: Release/2.0.3,!102Implement settings search
......@@ -2,9 +2,13 @@ import Vuex from 'vuex'
import { mount, createLocalVue, config } from '@vue/test-utils'
import Element from 'element-ui'
import Settings from '@/views/settings/index'
import storeConfig from './store.conf'
import { cloneDeep } from 'lodash'
import flushPromises from 'flush-promises'
import app from '@/store/modules/app'
import getters from '@/store/getters'
import relays from '@/store/modules/relays'
import settings from '@/store/modules/settings'
import user from '@/store/modules/user'
import users from '@/store/modules/users'
config.mocks["$t"] = () => {}
......@@ -14,9 +18,21 @@ localVue.use(Element)
describe('Settings search', () => {
let store
let actions
beforeEach(() => {
store = new Vuex.Store(cloneDeep(storeConfig))
actions = { SetActiveTab: jest.fn() }
store = new Vuex.Store({
modules: {
app,
relays,
settings: { ...settings, actions },
user,
users
},
getters
})
})
it('shows search input', async (done) => {
......@@ -30,4 +46,15 @@ describe('Settings search', () => {
expect(searchInput.exists()).toBe(true)
done()
})
it('changes tab when search value was selected', async (done) => {
const wrapper = mount(Settings, {
store,
localVue
})
await flushPromises()
wrapper.vm.handleSearchSelect({ group: 'Pleroma.Upload', key: 'Pleroma.Upload' })
expect(actions.SetActiveTab).toHaveBeenCalled()
done()
})
})
import app from '@/store/modules/app'
import user from '@/store/modules/user'
import users from '@/store/modules/users'
import relays from '@/store/modules/relays'
import settings from '@/store/modules/settings'
import getters from '@/store/getters'
export default {
modules: {
app,
relays,
settings,
user,
users
},
getters
}
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