Skip to content

Commit

Permalink
docs(api): fix typo in attachTo anchor tag within isVisible (#2351)
Browse files Browse the repository at this point in the history
Also adds the warning about `attachTo` to the French docs of isVisible and changes the example usage to comply with the warning.
  • Loading branch information
matusekma authored Mar 27, 2024
1 parent fb6adab commit 6aa8226
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 5 additions & 3 deletions docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 6aa8226

Please sign in to comment.