bv toast in user search page

This commit is contained in:
Moriz Wahl 2022-03-03 12:40:46 +01:00
parent 16501a7488
commit 1d31b00622
3 changed files with 3 additions and 11 deletions

View File

@ -73,10 +73,6 @@ const mocks = {
},
},
},
$toasted: {
error: jest.fn(),
success: jest.fn(),
},
}
describe('SearchUserTable', () => {

View File

@ -1,5 +1,6 @@
import { mount } from '@vue/test-utils'
import UserSearch from './UserSearch.vue'
import { toastErrorSpy } from '../../test/testSetup'
const localVue = global.localVue
@ -45,17 +46,12 @@ const apolloQueryMock = jest.fn().mockResolvedValue({
},
})
const toastErrorMock = jest.fn()
const mocks = {
$t: jest.fn((t) => t),
$d: jest.fn((d) => String(d)),
$apollo: {
query: apolloQueryMock,
},
$toasted: {
error: toastErrorMock,
},
}
describe('UserSearch', () => {
@ -196,7 +192,7 @@ describe('UserSearch', () => {
})
it('toasts an error message', () => {
expect(toastErrorMock).toBeCalledWith('Ouch')
expect(toastErrorSpy).toBeCalledWith('Ouch')
})
})
})

View File

@ -94,7 +94,7 @@ export default {
this.searchResult = result.data.searchUsers.userList
})
.catch((error) => {
this.$toasted.error(error.message)
this.toastError(error.message)
})
},
updateDeletedAt(userId, deletedAt) {