Skip to content

Slot testing fails for component. #851

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
trashpanda001 opened this issue Jul 23, 2018 · 1 comment
Closed

Slot testing fails for component. #851

trashpanda001 opened this issue Jul 23, 2018 · 1 comment
Labels

Comments

@trashpanda001
Copy link

Version

1.0.0-beta.21

Reproduction link

https://github.com/sickp/vue-test-slots

Steps to reproduce

yarn install
yarn test:unit

What is expected?

  • named slot "header" to receive 'Hello There'
  • default slot to receive 'Content Goes Here'

What is actually happening?

default slot receives 'Hello There'


This worked in 1.0.0-beta.20

@bost-h
Copy link

bost-h commented Jul 24, 2018

It does not seem related to functional components to me, it also fails when the component is not functional.
It think it comes from createSlotVNodes https://github.com/vuejs/vue-test-utils/blob/dev/packages/create-instance/create-slot-vnodes.js#L41 which receive good values, but returns an array with duplicated VNodes. It looks like a reference/value issue, where VNodes having already been created are overwritten by the creation of a new VNode

@trashpanda001 trashpanda001 changed the title Slot testing fails for functional component. Slot testing fails for component. Jul 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants