vuejs / vuejs/test-utils

Bug: Props in child component defined in mixin are missing with `shallowMount` on @vue/compat

Open
#2,333 5 comments 0 reactions 1 assignee View on GitHub

@xanf is already working on this.

Since Feb 12, 2024.

bug
Dominant language
TypeScript
Stars
1.2k
Forks
291
Avg merge
1d 9h
Merged PRs (30d)
18

Description

Describe the bug
With shallowMount on Vue 3 + @vue/compat, properties of a child component are undefined when using them through a mixin.

If the property is moved from the mixin directly to the component, then the property is defined.

Also if the shallowMount is switched to mount, the property is defined.

To Reproduce

I created a demo repo where this issue can be reproduced, with tags for various working and not working states. It includes the following important files:

git clone https://github.com/cody-collins/vue-compat-mixin-demo.git
cd vue-compat-mixin-demo
npm install
npm test

And the following tags:

Expected behavior
The second assertion should pass in the broken case

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.