Skip to content

Commit 264909a

Browse files
committed
docs: mentions attachTo in trigger documentation
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.
1 parent 85c0a87 commit 264909a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/api/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,6 +1797,12 @@ await wrapper.trigger('keydown', { keyCode: 65 })
17971797
You should use `await` when you call `trigger` to ensure that Vue updates the DOM before you make an assertion.
17981798
:::
17991799
1800+
::: warning
1801+
Some events, like clicking on a checkbox to change its `v-model`,
1802+
will only work if the test uses `attachTo: document.body`.
1803+
Otherwise, the `change` event will not be triggered, and the `v-model` value does not change.
1804+
:::
1805+
18001806
### unmount
18011807
18021808
Unmount the application from the DOM.

0 commit comments

Comments
 (0)