First green test for settings search
This commit is contained in:
parent
a83d61ed9f
commit
0cbebe2832
2 changed files with 50 additions and 0 deletions
33
test/views/settings/index.test.js
Normal file
33
test/views/settings/index.test.js
Normal 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()
|
||||
})
|
||||
})
|
17
test/views/settings/store.conf.js
Normal file
17
test/views/settings/store.conf.js
Normal 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
|
||||
}
|
Loading…
Reference in a new issue