-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
JanAckermann
committed
Apr 8, 2022
1 parent
6988498
commit fa73868
Showing
2 changed files
with
7 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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() | ||
|
@@ -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: { | ||
|