Skip to content

Can't find using a component import #240

@Spittal

Description

@Spittal

Hey there, I'm having an issue where I cannot use a Vue component to find within a wrapper. I should note that I use vue-component-class Here's a small sample of my code

import { mount } from 'vue-test-utils';
import GameOwnerships from '@/game-ownership/GameOwnerships';
import GameOwnershipCard from '@/game-ownership/GameOwnershipCard';

// ... down the file in an 'describe' block

it('Should find based on in a component', () => {
  const wrapper = mount(GameOwnerships, { // ...stuff } );
  console.log(GameOwnershipCard);
  wrapper.find(GameOwnershipCard);
});

// ...

the result of the console log is

//  console.log(GameOwnershipCard);
{ [Function: VueComponent]
  cid: 2,
  options: //... I don't think it's relevant
  super: //... I don't think it's relevant
}

and the error thrown is

[vue-test-utils]: wrapper.find() must be passed a valid CSS selector, Vue constructor, or valid find option object

Using Versions
"vue-test-utils": "1.0.0-beta.6",
"vue": "2.5.9",
"vue-class-component": "5.0.2"

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