You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Say I have this async method called fetchItem() which calls an api wait for its return value and set the form to ready.
export default {
components: {
Header,
Footer
},
data() {
return {
meeting: {},
formReady: false,
formAgree: false,
ANSWER_TYPE: ANSWER_TYPE
}
},
mounted() {
this.fetchItem()
},
methods: {
async fetchItem() {
// wanted to test if meeting got data but I need $route to have params id
this.meeting = await this.$MeetingApi.getMeeting(
this.$route.params.id,
false
)
this.formReady = true
this.meeting.initAnswerBills()
},
async saveMeetingAnswer() {
// I want to know if saveMeetingAnswer is called if I click the button( can't find by class name)
this.formReady = false
let save = await this.$MeetingApi.postAnswered(
this.meeting.answeredFormData
)
this.formReady = true
}
}
}
How can I test this with jest async and mock function ? I read the documentation and I still have no clue how to implement the test.
The text was updated successfully, but these errors were encountered:
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
Say I have this async method called fetchItem() which calls an api wait for its return value and set the form to ready.
How can I test this with jest async and mock function ? I read the documentation and I still have no clue how to implement the test.
The text was updated successfully, but these errors were encountered: