Skip to content

Stubs don't behave correctly with augmented options #1260

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
strutcode opened this issue Jun 18, 2019 · 1 comment
Closed

Stubs don't behave correctly with augmented options #1260

strutcode opened this issue Jun 18, 2019 · 1 comment

Comments

@strutcode
Copy link

Version

1.0.0-beta.29

Reproduction link

https://codepen.io/strutcode/pen/YoGXeW?editors=0010

Steps to reproduce

View the console output

What is expected?

In the console:

Permissions in component-a: some other value
Permissions in component-b: some value

The global mixin should be called with the original component's options

What is actually happening?

In the console:

Permissions in undefined: undefined
Permissions in component-a: some other value
Permissions in component-b: undefined

The mixin is called three times in spite of only two components being in use. The options passed to the stub mixin are filtered unnecessarily.


The code base I'm currently working on uses a global mixin that provides a new option for components, but the stubbing functionality of shallowMount is filtering the component options here:

https://github.com/vuejs/vue-test-utils/blob/dev/packages/create-instance/create-component-stubs.js#L37

Is there a purpose to that function? It's causing a considerable number of issues for me in testing.

@ebisbe ebisbe added the bug label Jan 27, 2023
@ebisbe
Copy link
Collaborator

ebisbe commented Feb 15, 2023

#1564 (comment)

@ebisbe ebisbe closed this as completed Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants