Skip to content

Commit 77404cb

Browse files
committed
docs(api):add warning about attachTo to the French docs of isVisible and change the example usage to adhere to the warning
1 parent 97cfeb0 commit 77404cb

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

docs/api/index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,9 +1445,11 @@ const Component = {
14451445
}
14461446

14471447
test('isVisible', () => {
1448-
const wrapper = mount(Component)
1448+
const wrapper = mount(Component, {
1449+
attachTo: document.body
1450+
});
14491451

1450-
expect(wrapper.find('span').isVisible()).toBe(false)
1452+
expect(wrapper.find('span').isVisible()).toBe(false);
14511453
})
14521454
```
14531455

docs/fr/api/index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1429,13 +1429,19 @@ isVisible(): boolean
14291429

14301430
**Utilisation :**
14311431

1432+
::: warning
1433+
`isVisible()` ne fonctionne correctement que si le wrapper est attaché au DOM en utilisant [`attachTo`](#attachTo)
1434+
:::
1435+
14321436
```js
14331437
const Component = {
14341438
template: `<div v-show="false"><span /></div>`,
14351439
};
14361440
14371441
test('isVisible', () => {
1438-
const wrapper = mount(Component);
1442+
const wrapper = mount(Component, {
1443+
attachTo: document.body
1444+
});
14391445
14401446
expect(wrapper.find('span').isVisible()).toBe(false);
14411447
});

0 commit comments

Comments
 (0)