First green test for settings search

This commit is contained in:
Angelina Filippova 2020-03-16 22:47:08 +03:00
parent a83d61ed9f
commit 0cbebe2832
2 changed files with 50 additions and 0 deletions

View file

@ -0,0 +1,33 @@
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'
config.mocks["$t"] = () => {}
const localVue = createLocalVue()
localVue.use(Vuex)
localVue.use(Element)
describe('Settings search', () => {
let store
beforeEach(() => {
store = new Vuex.Store(cloneDeep(storeConfig))
})
it('shows search input', async (done) => {
const wrapper = mount(Settings, {
store,
localVue
})
await flushPromises()
const searchInput = wrapper.find('.settings-search-input')
expect(searchInput.exists()).toBe(true)
done()
})
})

View file

@ -0,0 +1,17 @@
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
}