From 97cfeb033c402d01fcf39a597c6cf27723d3b0cb Mon Sep 17 00:00:00 2001 From: Marton Matusek Date: Thu, 22 Feb 2024 11:01:58 +0100 Subject: [PATCH 1/2] docs(api): fix typo in attachTo anchor tag within isVisible --- docs/api/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/index.md b/docs/api/index.md index b8a5bd61b..3448741da 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 From 77404cbfc91a023d44a80f88671b7d5c1f3fb987 Mon Sep 17 00:00:00 2001 From: Marton Matusek Date: Wed, 27 Mar 2024 11:53:22 +0100 Subject: [PATCH 2/2] docs(api):add warning about attachTo to the French docs of isVisible and change the example usage to adhere to the warning --- docs/api/index.md | 6 ++++-- docs/fr/api/index.md | 8 +++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/api/index.md b/docs/api/index.md index 3448741da..c263deb76 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -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 eafb8e41e..b59fad774 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: `
`, }; test('isVisible', () => { - const wrapper = mount(Component); + const wrapper = mount(Component, { + attachTo: document.body + }); expect(wrapper.find('span').isVisible()).toBe(false); });