From 264909acb707630b7aed50e4ef52dacfce967c1f Mon Sep 17 00:00:00 2001 From: cexbrayat Date: Fri, 10 Feb 2023 15:50:05 +0100 Subject: [PATCH] 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. --- docs/api/index.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/api/index.md b/docs/api/index.md index 9b64592e6..6bb67bfa5 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -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.