test email checked filter

This commit is contained in:
Moriz Wahl 2021-12-21 11:11:13 +01:00
parent 3c5d7f2ced
commit d96e458356
2 changed files with 13 additions and 2 deletions

View File

@ -11,6 +11,7 @@ const apolloQueryMock = jest.fn().mockResolvedValue({
lastName: 'Bloxberg',
email: 'bibi@bloxberg.de',
creation: [200, 400, 600],
emailChecked: false,
},
],
},
@ -43,6 +44,16 @@ describe('UserSearch', () => {
expect(wrapper.find('div.user-search').exists()).toBeTruthy()
})
describe('unconfirmed emails', () => {
beforeEach(async () => {
await wrapper.find('button.btn-block').trigger('click')
})
it('filters the users by unconfirmed emails', () => {
expect(wrapper.vm.searchResult).toHaveLength(0)
})
})
describe('apollo returns error', () => {
beforeEach(() => {
apolloQueryMock.mockRejectedValue({

View File

@ -58,8 +58,8 @@ export default {
methods: {
unconfirmedRegisterMails() {
this.searchResult = this.searchResult.filter((result) => {
return !result.emailChecked
this.searchResult = this.searchResult.filter((user) => {
return user.emailChecked
})
},
getUsers() {