В настоящее время я создаю тесты с Jest, и я хотел бы знать, как программно подтвердить MessageBox ElementUI, потому что я не могу получить его HTML DOM. Чтобы он выполнял мои запросы graphql внутри then()
. Я действительно не знаю, хорошая ли это практика или нет, так как я новичок в Jest.
confirmBox(
this,
'warning',
'Delete Record',
'Do you really want to delete this record?',
true
).then(() => {
this.loading = true
deleteGame(id, (response, success) => {
if (success) {
this.$message({
message: 'Record successfully deleted',
type: 'success'
})
this.get()
} else {
this.$message({
message: response,
dangerouslyUseHTMLString: true,
type: 'error'
})
this.loading = false
}
})
})