Skip to content

Commit

Permalink
docs(api):add warning about attachTo to the French docs of isVisible …
Browse files Browse the repository at this point in the history
…and change the example usage to adhere to the warning
  • Loading branch information
matusekma committed Mar 27, 2024
1 parent 97cfeb0 commit 77404cb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 4 additions & 2 deletions docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
})
```
Expand Down
8 changes: 7 additions & 1 deletion docs/fr/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: `<div v-show="false"><span /></div>`,
};
test('isVisible', () => {
const wrapper = mount(Component);
const wrapper = mount(Component, {
attachTo: document.body
});
expect(wrapper.find('span').isVisible()).toBe(false);
});
Expand Down

0 comments on commit 77404cb

Please sign in to comment.