Vue-test-utils: Clarify attachedToDocument meaning in docs

Created on 11 Apr 2019  ·  2Comments  ·  Source: vuejs/vue-test-utils

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.

docs

Most helpful comment

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.

All 2 comments

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.

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: https://github.com/vuejs/vue-test-utils/pull/1432

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AustinGil picture AustinGil  ·  3Comments

matt-sanders picture matt-sanders  ·  3Comments

lusarz picture lusarz  ·  3Comments

kjugi picture kjugi  ·  3Comments

ParsonsProjects picture ParsonsProjects  ·  3Comments