Skip to content

shallowMount can't handle vuetify's "dynamic slot" #1847

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
hereiscasio opened this issue May 15, 2021 · 1 comment
Closed

shallowMount can't handle vuetify's "dynamic slot" #1847

hereiscasio opened this issue May 15, 2021 · 1 comment

Comments

@hereiscasio
Copy link

Subject of the issue

Actually,
shallowMount already do a great job to handle majority of v-slot usages
BUT,
it can't handle the more advance one,
which is called "dynamic slot" in vuetify official doc

let me clarify the problems,
shallowMount can handle below cases very well:

  • CASE_A:v-slot
  • CASE_B:v-slot:namedSlot
  • CASE_C:v-slot:scopedSlot="{ someProp }"

but it can't handle v-slot like:

  • CASE_D:v-slot:item.calories="{ item }"

and what i mean of "it can't handle" is that

i don't need to set stubs API in mounting options for CASE A ~ C
and it just works perfect.

but if i don't set stubs for CASE D, it will fail

Steps to reproduce

u can test this example by using shallowMount
in my case, after executing shallowMount
i will use expect(wrapper.element).toMatchSnapshot()

Expected behaviour

works without problems, just like CASE A ~ C

Actual behaviour

it will say something like "item is undefined" in the case i presented in "Steps to reproduce"

@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