From fa738685e7c02d4dae89f2cf020ba17774127f27 Mon Sep 17 00:00:00 2001 From: JanAckermann Date: Fri, 8 Apr 2022 14:12:55 +0200 Subject: [PATCH] Fix tests --- .../components/Groups/SideBar/EditPanel.spec.js | 6 +++--- .../components/Users/SideBar/EditPanel.spec.js | 16 ++++------------ 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/packages/web-app-user-management/tests/unit/components/Groups/SideBar/EditPanel.spec.js b/packages/web-app-user-management/tests/unit/components/Groups/SideBar/EditPanel.spec.js index a23bd3b77dc..242eff63503 100644 --- a/packages/web-app-user-management/tests/unit/components/Groups/SideBar/EditPanel.spec.js +++ b/packages/web-app-user-management/tests/unit/components/Groups/SideBar/EditPanel.spec.js @@ -12,7 +12,7 @@ describe('EditPanel', () => { it('should revert changes on property editGroup', () => { const wrapper = getWrapper({ propsData: { - group: { displayName: 'group' } + groups: [{ displayName: 'group' }] } }) wrapper.vm.editGroup = { displayName: 'my group' } @@ -22,7 +22,7 @@ describe('EditPanel', () => { it('should revert changes on property formData', () => { const wrapper = getWrapper({ propsData: { - group: { displayName: 'group' } + groups: [{ displayName: 'group' }] } }) wrapper.vm.formData.displayName.valid = false @@ -73,7 +73,7 @@ function getWrapper({ propsData = {} } = {}) { $gettextInterpolate: jest.fn() }, propsData: { - group: { displayName: 'group' }, + groups: [{ displayName: 'group' }], ...propsData }, stubs: { diff --git a/packages/web-app-user-management/tests/unit/components/Users/SideBar/EditPanel.spec.js b/packages/web-app-user-management/tests/unit/components/Users/SideBar/EditPanel.spec.js index ad03398a168..ceb60ba4e1c 100644 --- a/packages/web-app-user-management/tests/unit/components/Users/SideBar/EditPanel.spec.js +++ b/packages/web-app-user-management/tests/unit/components/Users/SideBar/EditPanel.spec.js @@ -10,11 +10,7 @@ afterEach(() => jest.clearAllMocks()) describe('EditPanel', () => { describe('method "revertChanges"', () => { it('should revert changes on property editUser', () => { - const wrapper = getWrapper({ - propsData: { - user: { displayName: 'jan', mail: 'jan@owncloud.com' } - } - }) + const wrapper = getWrapper({}) wrapper.vm.editUser.displayName = 'jana' wrapper.vm.editUser.mail = 'jana@owncloud.com' wrapper.vm.revertChanges() @@ -22,11 +18,7 @@ describe('EditPanel', () => { expect(wrapper.vm.editUser.mail).toEqual('jan@owncloud.com') }) it('should revert changes on property formData', () => { - const wrapper = getWrapper({ - propsData: { - group: { displayName: 'jan' } - } - }) + const wrapper = getWrapper({}) wrapper.vm.formData.displayName.valid = false wrapper.vm.formData.displayName.errorMessage = 'error' wrapper.vm.revertChanges() @@ -90,9 +82,9 @@ function getWrapper({ propsData = {} } = {}) { $gettextInterpolate: jest.fn() }, propsData: { - user: { displayName: 'jan', mail: 'jan@owncloud.com' }, + users: [{ id: '1', displayName: 'jan', mail: 'jan@owncloud.com' }], roles: [{ id: '1', displayName: 'admin' }], - userRole: { id: '1', displayName: 'admin' }, + userRoles: { 1: { id: '1', displayName: 'admin' } }, ...propsData }, stubs: {