From 6aa82265f04b4ce0767c59a12405ca3cbca7a9fa Mon Sep 17 00:00:00 2001 From: Marton Matusek <36794575+matusekma@users.noreply.github.com> Date: Wed, 27 Mar 2024 14:25:02 +0100 Subject: [PATCH] docs(api): fix typo in attachTo anchor tag within isVisible (#2351) Also adds the warning about `attachTo` to the French docs of isVisible and changes the example usage to comply with the warning. --- docs/api/index.md | 8 +++++--- docs/fr/api/index.md | 8 +++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/api/index.md b/docs/api/index.md index 713331362..a73955b64 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -1436,7 +1436,7 @@ isVisible(): boolean **Details:** ::: warning -`isVisible()` only works correctly if the wrapper is attached to the DOM using [`attachTo`](#attachto) +`isVisible()` only works correctly if the wrapper is attached to the DOM using [`attachTo`](#attachTo) ::: ```js @@ -1445,9 +1445,11 @@ const Component = { } test('isVisible', () => { - const wrapper = mount(Component) + const wrapper = mount(Component, { + attachTo: document.body + }); - expect(wrapper.find('span').isVisible()).toBe(false) + expect(wrapper.find('span').isVisible()).toBe(false); }) ``` diff --git a/docs/fr/api/index.md b/docs/fr/api/index.md index dfb24dfbd..be8af2a1a 100644 --- a/docs/fr/api/index.md +++ b/docs/fr/api/index.md @@ -1429,13 +1429,19 @@ isVisible(): boolean **Utilisation :** +::: warning +`isVisible()` ne fonctionne correctement que si le wrapper est attaché au DOM en utilisant [`attachTo`](#attachTo) +::: + ```js const Component = { template: `