method tests added

This commit is contained in:
Moriz Wahl 2019-11-08 14:22:04 +01:00
parent e4883b5175
commit 3d3a121dc5

View File

@ -104,12 +104,14 @@ describe('ContentMenu.vue', () => {
.attributes('to'),
).toBe('/post-menu-pin')
items.at(0).trigger('click')
expect(wrapper.emitted('pinPost')).toEqual([[
expect(wrapper.emitted('pinPost')).toEqual([
[
{
id: 'd23a4265-f5f7-4e17-9f86-85f714b4b9f8',
pinnedBy: null,
}
]])
},
],
])
})
it('admin can unpin pinned post', () => {
@ -131,12 +133,14 @@ describe('ContentMenu.vue', () => {
.attributes('to'),
).toBe('/post-menu-unpin')
items.at(0).trigger('click')
expect(wrapper.emitted('unpinPost')).toEqual([[
expect(wrapper.emitted('unpinPost')).toEqual([
[
{
id: 'd23a4265-f5f7-4e17-9f86-85f714b4b9f8',
pinnedBy: 'someone',
}
]])
},
],
])
})
})
@ -170,7 +174,6 @@ describe('ContentMenu.vue', () => {
).toBe('/comment-menu-delete')
items.at(1).trigger('click')
expect(openModalSpy).toHaveBeenCalledWith('delete')
})
})
@ -382,9 +385,7 @@ describe('ContentMenu.vue', () => {
.attributes('to'),
).toBe('/release-contribution-title')
items.at(1).trigger('click')
expect(openModalSpy).toHaveBeenCalledWith(
'release', 'd23a4265-f5f7-4e17-9f86-85f714b4b9f8'
)
expect(openModalSpy).toHaveBeenCalledWith('release', 'd23a4265-f5f7-4e17-9f86-85f714b4b9f8')
})
it('moderator can release comments', () => {
@ -407,9 +408,7 @@ describe('ContentMenu.vue', () => {
.attributes('to'),
).toBe('/release-comment-title')
items.at(1).trigger('click')
expect(openModalSpy).toHaveBeenCalledWith(
'release', 'd23a4265-f5f7-4e17-9f86-85f714b4b9f8'
)
expect(openModalSpy).toHaveBeenCalledWith('release', 'd23a4265-f5f7-4e17-9f86-85f714b4b9f8')
})
it('moderator can release users', () => {
@ -432,9 +431,7 @@ describe('ContentMenu.vue', () => {
.attributes('to'),
).toBe('/release-user-title')
items.at(1).trigger('click')
expect(openModalSpy).toHaveBeenCalledWith(
'release', 'd23a4265-f5f7-4e17-9f86-85f714b4b9f8'
)
expect(openModalSpy).toHaveBeenCalledWith('release', 'd23a4265-f5f7-4e17-9f86-85f714b4b9f8')
})
it('moderator can release organizations', () => {
@ -457,9 +454,7 @@ describe('ContentMenu.vue', () => {
.attributes('to'),
).toBe('/release-organization-title')
items.at(1).trigger('click')
expect(openModalSpy).toHaveBeenCalledWith(
'release', 'd23a4265-f5f7-4e17-9f86-85f714b4b9f8'
)
expect(openModalSpy).toHaveBeenCalledWith('release', 'd23a4265-f5f7-4e17-9f86-85f714b4b9f8')
})
})
@ -504,12 +499,14 @@ describe('ContentMenu.vue', () => {
.attributes('to'),
).toBe('/settings-blocked-users-block')
items.at(1).trigger('click')
expect(wrapper.emitted('block')).toEqual([[
expect(wrapper.emitted('block')).toEqual([
[
{
id: 'd23a4265-f5f7-4e17-9f86-85f714b4b9f8',
isBlocked: false,
}
]])
},
],
])
})
it('user can unblock blocked users', () => {
@ -532,12 +529,14 @@ describe('ContentMenu.vue', () => {
.attributes('to'),
).toBe('/settings-blocked-users-unblock')
items.at(1).trigger('click')
expect(wrapper.emitted('unblock')).toEqual([[
expect(wrapper.emitted('unblock')).toEqual([
[
{
id: 'd23a4265-f5f7-4e17-9f86-85f714b4b9f8',
isBlocked: true,
}
]])
},
],
])
})
})
})