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