How to test nested promise method written in vue component written in method
as you can see here that cancel method is nested promise so how to write test case using vue test utils & jest
<template>
<b-button variant="danger" @click="cancel">Cancel</b-button>
</template>
<script>
export default {
props: {
id: {
type: String,
default: ''
}
},
methods: {
cancel() {
this.$store
.dispatch('cancel')
.then(() => {
this.$store
.dispatch('getdata')
.then(() => {})
.catch(() => {});
this.$emit('closeModel');
})
.catch(() => {});
}
}
};
</script>