From 4b9c5df5f2ed56c09dc4e473a45c66978794b8a5 Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Fri, 20 Mar 2020 01:06:22 +0300 Subject: [PATCH] Add test for SetActiveTab arguments --- test/views/settings/index.test.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/views/settings/index.test.js b/test/views/settings/index.test.js index d5b75f79..fc0e257b 100644 --- a/test/views/settings/index.test.js +++ b/test/views/settings/index.test.js @@ -4,11 +4,11 @@ import Element from 'element-ui' import Settings from '@/views/settings/index' 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' +import getters from '@/store/getters' config.mocks["$t"] = () => {} @@ -19,17 +19,18 @@ localVue.use(Element) describe('Settings search', () => { let store let actions + let permission beforeEach(() => { actions = { SetActiveTab: jest.fn() } - + permission = { addRouters: jest.fn() } store = new Vuex.Store({ modules: { app, + permission, relays, settings: { ...settings, actions }, user, - users }, getters }) @@ -55,6 +56,8 @@ describe('Settings search', () => { await flushPromises() wrapper.vm.handleSearchSelect({ group: 'Pleroma.Upload', key: 'Pleroma.Upload' }) expect(actions.SetActiveTab).toHaveBeenCalled() + expect(actions.SetActiveTab).toHaveBeenCalledWith(expect.anything(), 'upload', undefined) + done() }) })