diff --git a/test/views/settings/index.test.js b/test/views/settings/index.test.js new file mode 100644 index 00000000..69f33ed9 --- /dev/null +++ b/test/views/settings/index.test.js @@ -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() + }) +}) diff --git a/test/views/settings/store.conf.js b/test/views/settings/store.conf.js new file mode 100644 index 00000000..017f3180 --- /dev/null +++ b/test/views/settings/store.conf.js @@ -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 +}