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

Refactoring

parent 13409efa
No related branches found
No related tags found
2 merge requests!11Add ability to read reports,!10Add more users filters
...@@ -6,6 +6,8 @@ import storeConfig from './store.conf' ...@@ -6,6 +6,8 @@ import storeConfig from './store.conf'
import { cloneDeep } from 'lodash' import { cloneDeep } from 'lodash'
config.mocks["$t"] = () => {} config.mocks["$t"] = () => {}
config.stubs['users-filter'] = '<div />'
const localVue = createLocalVue() const localVue = createLocalVue()
localVue.use(Vuex) localVue.use(Vuex)
...@@ -23,8 +25,7 @@ describe('Search and filter users', () => { ...@@ -23,8 +25,7 @@ describe('Search and filter users', () => {
it('fetches initial list of users', async (done) => { it('fetches initial list of users', async (done) => {
const wrapper = mount(Users, { const wrapper = mount(Users, {
store, store,
localVue, localVue
stubs: ['users-filter']
}) })
await wrapper.vm.$nextTick() await wrapper.vm.$nextTick()
...@@ -35,8 +36,7 @@ describe('Search and filter users', () => { ...@@ -35,8 +36,7 @@ describe('Search and filter users', () => {
it('starts a search on input change', async (done) => { it('starts a search on input change', async (done) => {
const wrapper = mount(Users, { const wrapper = mount(Users, {
store, store,
localVue, localVue
stubs: ['users-filter']
}) })
wrapper.vm.handleDebounceSearchInput = (query) => { wrapper.vm.handleDebounceSearchInput = (query) => {
...@@ -72,8 +72,7 @@ describe('Users actions', () => { ...@@ -72,8 +72,7 @@ describe('Users actions', () => {
it('grants admin and moderator rights to a local user', async (done) => { it('grants admin and moderator rights to a local user', async (done) => {
const wrapper = mount(Users, { const wrapper = mount(Users, {
store, store,
localVue, localVue
stubs: ['users-filter']
}) })
await wrapper.vm.$nextTick() await wrapper.vm.$nextTick()
...@@ -95,8 +94,7 @@ describe('Users actions', () => { ...@@ -95,8 +94,7 @@ describe('Users actions', () => {
it('does not show actions that grant admin and moderator rights to external users', async (done) => { it('does not show actions that grant admin and moderator rights to external users', async (done) => {
const wrapper = mount(Users, { const wrapper = mount(Users, {
store, store,
localVue, localVue
stubs: ['users-filter']
}) })
await wrapper.vm.$nextTick() await wrapper.vm.$nextTick()
...@@ -110,8 +108,7 @@ describe('Users actions', () => { ...@@ -110,8 +108,7 @@ describe('Users actions', () => {
it('toggles activation status', async (done) => { it('toggles activation status', async (done) => {
const wrapper = mount(Users, { const wrapper = mount(Users, {
store, store,
localVue, localVue
stubs: ['users-filter']
}) })
await wrapper.vm.$nextTick() await wrapper.vm.$nextTick()
...@@ -129,8 +126,7 @@ describe('Users actions', () => { ...@@ -129,8 +126,7 @@ describe('Users actions', () => {
it('deactivates user when Delete action is called', async (done) => { it('deactivates user when Delete action is called', async (done) => {
const wrapper = mount(Users, { const wrapper = mount(Users, {
store, store,
localVue, localVue
stubs: ['users-filter']
}) })
await wrapper.vm.$nextTick() await wrapper.vm.$nextTick()
...@@ -148,8 +144,7 @@ describe('Users actions', () => { ...@@ -148,8 +144,7 @@ describe('Users actions', () => {
it('adds tags', async (done) => { it('adds tags', async (done) => {
const wrapper = mount(Users, { const wrapper = mount(Users, {
store, store,
localVue, localVue
stubs: ['users-filter']
}) })
await wrapper.vm.$nextTick() await wrapper.vm.$nextTick()
...@@ -173,8 +168,7 @@ describe('Users actions', () => { ...@@ -173,8 +168,7 @@ describe('Users actions', () => {
it('deletes tags', async (done) => { it('deletes tags', async (done) => {
const wrapper = mount(Users, { const wrapper = mount(Users, {
store, store,
localVue, localVue
stubs: ['users-filter']
}) })
await wrapper.vm.$nextTick() await wrapper.vm.$nextTick()
...@@ -192,8 +186,7 @@ describe('Users actions', () => { ...@@ -192,8 +186,7 @@ describe('Users actions', () => {
it('shows check icon when tag is added', async (done) => { it('shows check icon when tag is added', async (done) => {
const wrapper = mount(Users, { const wrapper = mount(Users, {
store, store,
localVue, localVue
stubs: ['users-filter']
}) })
await wrapper.vm.$nextTick() await wrapper.vm.$nextTick()
...@@ -209,8 +202,7 @@ describe('Users actions', () => { ...@@ -209,8 +202,7 @@ describe('Users actions', () => {
it('does not change user index in array when tag is added', async (done) => { it('does not change user index in array when tag is added', async (done) => {
const wrapper = mount(Users, { const wrapper = mount(Users, {
store, store,
localVue, localVue
stubs: ['users-filter']
}) })
await wrapper.vm.$nextTick() await wrapper.vm.$nextTick()
......
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