0

I want to write unit test on vue-treeselect. I followed the testcases written in the repository. There they have taken wrapper.vm.forest.nodemap to find the options but when i try it is giving forest "undefined".

Does anyone have idea how to get wrapper.vm.forest in the wrapper.

kissu
  • 40,416
  • 14
  • 65
  • 133
Vishal Sagar
  • 331
  • 1
  • 3
  • 13

1 Answers1

0

I have used treeselect something like this

<treeselect
          v-model="selected"
          data-test="treeselect"
          :multiple="true"
          :options="options"
          placeholder
          value-consists-of="LEAF_PRIORITY"
          :required="true"
          :show-count="true"
          :default-expand-level="1"
        >

I gave data-test="treeselect" to find this component than in testcase used like this:

expect(wrapper.find('[data-test="tenants"]').vm.forest.selectedNodeIds).toEqual(["anything"]);
Vishal Sagar
  • 331
  • 1
  • 3
  • 13