Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JanAckermann committed Apr 8, 2022
1 parent 6988498 commit fa73868
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
Expand All @@ -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
Expand Down Expand Up @@ -73,7 +73,7 @@ function getWrapper({ propsData = {} } = {}) {
$gettextInterpolate: jest.fn()
},
propsData: {
group: { displayName: 'group' },
groups: [{ displayName: 'group' }],
...propsData
},
stubs: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,15 @@ afterEach(() => jest.clearAllMocks())
describe('EditPanel', () => {
describe('method "revertChanges"', () => {
it('should revert changes on property editUser', () => {
const wrapper = getWrapper({
propsData: {
user: { displayName: 'jan', mail: '[email protected]' }
}
})
const wrapper = getWrapper({})
wrapper.vm.editUser.displayName = 'jana'
wrapper.vm.editUser.mail = '[email protected]'
wrapper.vm.revertChanges()
expect(wrapper.vm.editUser.displayName).toEqual('jan')
expect(wrapper.vm.editUser.mail).toEqual('[email protected]')
})
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()
Expand Down Expand Up @@ -90,9 +82,9 @@ function getWrapper({ propsData = {} } = {}) {
$gettextInterpolate: jest.fn()
},
propsData: {
user: { displayName: 'jan', mail: '[email protected]' },
users: [{ id: '1', displayName: 'jan', mail: '[email protected]' }],
roles: [{ id: '1', displayName: 'admin' }],
userRole: { id: '1', displayName: 'admin' },
userRoles: { 1: { id: '1', displayName: 'admin' } },
...propsData
},
stubs: {
Expand Down

0 comments on commit fa73868

Please sign in to comment.