Fix tests

This commit is contained in:
Maxim Filippov 2019-11-29 23:09:53 +09:00
parent fb9d166f5d
commit 4103faa079

View file

@ -163,7 +163,7 @@ describe('Apply users actions to multiple users', () => {
const activateMultipleUsersStub = jest.fn()
wrapper.setMethods({ activateMultipleUsers: activateMultipleUsersStub })
wrapper.find(`.el-dropdown-menu__item:nth-child(5)`).trigger('click')
wrapper.find(`.el-dropdown-menu__item:nth-child(7)`).trigger('click')
expect(wrapper.vm.activateMultipleUsers).toHaveBeenCalled()
const activate = wrapper.vm.mappers().activate
@ -190,7 +190,7 @@ describe('Apply users actions to multiple users', () => {
const deactivateMultipleUsersStub = jest.fn()
wrapper.setMethods({ deactivateMultipleUsers: deactivateMultipleUsersStub })
wrapper.find(`.el-dropdown-menu__item:nth-child(6)`).trigger('click')
wrapper.find(`.el-dropdown-menu__item:nth-child(8)`).trigger('click')
expect(wrapper.vm.deactivateMultipleUsers).toHaveBeenCalled()
const deactivate = wrapper.vm.mappers().deactivate
@ -221,7 +221,7 @@ describe('Apply users actions to multiple users', () => {
const deleteMultipleUsersStub = jest.fn()
wrapper.setMethods({ deleteMultipleUsers: deleteMultipleUsersStub })
wrapper.find(`.el-dropdown-menu__item:nth-child(7)`).trigger('click')
wrapper.find(`.el-dropdown-menu__item:nth-child(9)`).trigger('click')
expect(wrapper.vm.deleteMultipleUsers).toHaveBeenCalled()
const remove = wrapper.vm.mappers().remove
@ -247,15 +247,15 @@ describe('Apply users actions to multiple users', () => {
const addTagForMultipleUsersStub = jest.fn()
wrapper.setMethods({ addTagForMultipleUsers: addTagForMultipleUsersStub })
wrapper.find(`.el-dropdown-menu__item:nth-child(9) button:nth-child(1)`).trigger('click')
wrapper.find(`.el-dropdown-menu__item:nth-child(11) button:nth-child(1)`).trigger('click')
expect(wrapper.vm.addTagForMultipleUsers).toHaveBeenCalled()
expect(wrapper.vm.addTagForMultipleUsers).toHaveBeenCalledWith('force_nsfw')
wrapper.find(`.el-dropdown-menu__item:nth-child(11) button:nth-child(1)`).trigger('click')
wrapper.find(`.el-dropdown-menu__item:nth-child(13) button:nth-child(1)`).trigger('click')
expect(wrapper.vm.addTagForMultipleUsers).toHaveBeenCalled()
expect(wrapper.vm.addTagForMultipleUsers).toHaveBeenCalledWith('force_unlisted')
wrapper.find(`.el-dropdown-menu__item:nth-child(13) button:nth-child(1)`).trigger('click')
wrapper.find(`.el-dropdown-menu__item:nth-child(15 ) button:nth-child(1)`).trigger('click')
expect(wrapper.vm.addTagForMultipleUsers).toHaveBeenCalled()
expect(wrapper.vm.addTagForMultipleUsers).toHaveBeenCalledWith('disable_remote_subscription')
@ -287,15 +287,15 @@ describe('Apply users actions to multiple users', () => {
const removeTagFromMultipleUsersStub = jest.fn()
wrapper.setMethods({ removeTagFromMultipleUsers: removeTagFromMultipleUsersStub })
wrapper.find(`.el-dropdown-menu__item:nth-child(10) button:nth-child(2)`).trigger('click')
wrapper.find(`.el-dropdown-menu__item:nth-child(12) button:nth-child(2)`).trigger('click')
expect(wrapper.vm.removeTagFromMultipleUsers).toHaveBeenCalled()
expect(wrapper.vm.removeTagFromMultipleUsers).toHaveBeenCalledWith('strip_media')
wrapper.find(`.el-dropdown-menu__item:nth-child(12) button:nth-child(2)`).trigger('click')
wrapper.find(`.el-dropdown-menu__item:nth-child(14) button:nth-child(2)`).trigger('click')
expect(wrapper.vm.removeTagFromMultipleUsers).toHaveBeenCalled()
expect(wrapper.vm.removeTagFromMultipleUsers).toHaveBeenCalledWith('sandbox')
wrapper.find(`.el-dropdown-menu__item:nth-child(14) button:nth-child(2)`).trigger('click')
wrapper.find(`.el-dropdown-menu__item:nth-child(16) button:nth-child(2)`).trigger('click')
expect(wrapper.vm.removeTagFromMultipleUsers).toHaveBeenCalled()
expect(wrapper.vm.removeTagFromMultipleUsers).toHaveBeenCalledWith('disable_any_subscription')