Skip to content

findAll with Vue extended component causing errors #248

Closed
@sygrinberg

Description

@sygrinberg

When I use the "findAll" function on a component that extends another component using "extends" attribute I get this error:
undefined is not a constructor (evaluating 'Object.entries(refOptionsObject)') isRefSelector@webpack:///node_modules/vue-test-utils/dist/vue-test-utils.js:232:0 <- index.js:751:31 getSelectorType@webpack:///node_modules/vue-test-utils/dist/vue-test-utils.js:265:0 <- index.js:784:20 getSelectorTypeOrThrow@webpack:///node_modules/vue-test-utils/dist/vue-test-utils.js:271:0 <- index.js:790:37 findAll@webpack:///node_modules/vue-test-utils/dist/vue-test-utils.js:895:0 <- index.js:1414:44

Here is an example code of the components I am using:
file CompA.vue

<template>
 some HTML...
</template>

<script>
  export default {
     .... some JS code
  }
</script>

file CompB.vue

<script>
  import CompA from './CompA'
  export default {
    extends: CompA,
     .... some JS code
  }
</script>

After debugging what happens, I found that "findAll" on CompB doesn't refer to is as a Vue component because in the "isVueComponent" CompB doesn't have "render" method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions