Skip to content

Clarify attachedToDocument meaning in docs #1207

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
maksnester opened this issue Apr 11, 2019 · 2 comments · Fixed by #1214
Closed

Clarify attachedToDocument meaning in docs #1207

maksnester opened this issue Apr 11, 2019 · 2 comments · Fixed by #1214
Labels

Comments

@maksnester
Copy link

Version

1.0.0-beta.29

Reproduction link

https://vue-test-utils.vuejs.org/api/wrapper/#properties

Steps to reproduce

visit https://vue-test-utils.vuejs.org/api/wrapper/#properties

What is expected?

Clear description of options

What is actually happening?

See vague description of options


Can't find any meaningful description of what does attachedToDocument option for.

@maksnester
Copy link
Author

That's still completely unclear. It looks like a comment for such code snippet:

// sum `a` with `b` and save in `c`
let c = a + b

I actually wondered what does it mean at all? What is this attachedToDocument for? It's a public API, but how can I use it? For which scenario? Why do I need that at all? I couldn't find any meaningful information about it in docs and I still can't.

@eddyerburgh eddyerburgh reopened this Apr 27, 2019
sarahdayan added a commit to sarahdayan/vue-test-utils that referenced this issue Feb 6, 2020
@sarahdayan
Copy link
Contributor

Hey @alendorff! There's already a definition for attachedToDocument here. When true, the component is attached to the DOM (jsdom when using Jest). This, I guess, lets you perform DOM API requests (but I'll let @eddyerburgh confirm), but it also means the DOM is mutated (so you have to destroy the component after each test for them to remain deterministic).

I've opened a PR to add a link to this definition: #1432

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants