Skip to content

Commit

Permalink
docs: mentions attachTo in trigger documentation
Browse files Browse the repository at this point in the history
Fixes #1470

Some events, like clicking on a checkbox to change its `v-model`, will only work if the test uses `attachTo: document.body`.
Otherwise, the `change` event will not be triggered, and the `v-model` value does not change.
  • Loading branch information
cexbrayat committed Feb 10, 2023
1 parent 85c0a87 commit 264909a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/api/index.md
Expand Up @@ -1797,6 +1797,12 @@ await wrapper.trigger('keydown', { keyCode: 65 })
You should use `await` when you call `trigger` to ensure that Vue updates the DOM before you make an assertion.
:::
::: warning
Some events, like clicking on a checkbox to change its `v-model`,
will only work if the test uses `attachTo: document.body`.
Otherwise, the `change` event will not be triggered, and the `v-model` value does not change.
:::
### unmount
Unmount the application from the DOM.
Expand Down

0 comments on commit 264909a

Please sign in to comment.