diff --git a/docs/en/api/wrapper/README.md b/docs/en/api/wrapper/README.md index 6469b8745..663af840b 100644 --- a/docs/en/api/wrapper/README.md +++ b/docs/en/api/wrapper/README.md @@ -1,16 +1,16 @@ # Wrapper -vue-test-utils is a wrapper based API. +`vue-test-utils` est une API basée sur un `wrapper`. -A `Wrapper` is an object that contains a mounted component or vnode and methods to test the component or vnode. +Un `Wrapper` est un objet qui contient un composant monté, un nœud virtuel et des méthodes pour les tester. -- **Properties:** +- **Propriétés :** -`vm` `Component`: this is the vue instance. You can access all the [instance methods and properties of a vm](https://vuejs.org/v2/api/#Instance-Properties) with `wrapper.vm`. This only exists on Vue component wrappers -`element` `HTMLElement`: the root DOM node of the wrapper -`options` `Object`: Object containing vue-test-utils options passed to `mount` or `shallow` -`options.attachedToDom` `Boolean`: True if attachToDom was passed to `mount` or `shallow` +`vm` `Component`: c'est une instance de Vue. Vous pouvez accéder à toutes les [méthodes et propriétés de l'instance](https://vuejs.org/v2/api/#Instance-Properties) avec `wrapper.vm`. Cela existe uniquement sur les `wrappers` de composants Vue. +`element` `HTMLElement`: le nœud principal du DOM du `wrapper`. +`options` `Object`: objet contenant les options de `vue-test-utils` passées à `mount` ou `shallow`. +`options.attachedToDom` `Boolean`: `true` si `attachToDom` est passé à `mount` ou `shallow`. -- **Methods:** +- **Méthodes :** -There is a detailed list of methods in the wrapper section of the docs. +Il y a une liste détaillé des méthodes dans la section `wrapper` de la documentation. \ No newline at end of file diff --git a/docs/en/api/wrapper/contains.md b/docs/en/api/wrapper/contains.md index a91b0353b..7d4026c29 100644 --- a/docs/en/api/wrapper/contains.md +++ b/docs/en/api/wrapper/contains.md @@ -1,13 +1,13 @@ # contains(selector) -Assert `Wrapper` contains an element or component matching [selector](../selectors.md). +Asserte que `Wrapper` contient un élément ou un composant correspondant au [sélecteur](../selectors.md). -- **Arguments:** - - `{string|Component} selector` +- **Paramètres :** + - `{string|Component} selector : un sélecteur` -- **Returns:** `{boolean}` +- **Retourne :** `{boolean}` -- **Example:** +- **Exemple :** ```js import { mount } from 'vue-test-utils' @@ -20,4 +20,4 @@ expect(wrapper.contains('p')).toBe(true) expect(wrapper.contains(Bar)).toBe(true) ``` -- **See also:** [selectors](../selectors.md) +- **Voir aussi :** [sélecteurs](../selectors.md) diff --git a/docs/en/api/wrapper/emitted.md b/docs/en/api/wrapper/emitted.md index d754eab98..669328c9c 100644 --- a/docs/en/api/wrapper/emitted.md +++ b/docs/en/api/wrapper/emitted.md @@ -1,10 +1,10 @@ # emitted() -Return an object containing custom events emitted by the `Wrapper` `vm`. +Retourne un objet contenant des évènements émis par l'instance de Vue `vm` du `Wrapper`. -- **Returns:** `{ [name: string]: Array> }` +- **Retourne :** `{ [name: string]: Array> }` -- **Example:** +- **Exemple :** ```js import { mount } from 'vue-test-utils' @@ -16,18 +16,18 @@ wrapper.vm.$emit('foo') wrapper.vm.$emit('foo', 123) /* -wrapper.emitted() returns the following object: +wrapper.emitted() retourne l'objet suivant : { foo: [[], [123]] } */ -// assert event has been emitted +// asserte que l'évènement est émis expect(wrapper.emitted().foo).toBeTruthy() -// assert event count +// asserte que l'évènement est compté expect(wrapper.emitted().foo.length).toBe(2) -// assert event payload +// asserte le contenu de l'évènement expect(wrapper.emitted().foo[1]).toEqual([123]) ``` diff --git a/docs/en/api/wrapper/emittedByOrder.md b/docs/en/api/wrapper/emittedByOrder.md index 55ff975b2..b3096437d 100644 --- a/docs/en/api/wrapper/emittedByOrder.md +++ b/docs/en/api/wrapper/emittedByOrder.md @@ -1,10 +1,10 @@ # emittedByOrder() -Return an Array containing custom events emitted by the `Wrapper` `vm`. +Retourne un tableau contenant des évènements émis par l'instance de Vue `vm` de `Wrapper`. -- **Returns:** `Array<{ name: string, args: Array }>` +- **Retourne :** `Array<{ name: string, args: Array }>` -- **Example:** +- **Exemple :** ```js import { mount } from 'vue-test-utils' @@ -16,13 +16,13 @@ wrapper.vm.$emit('foo') wrapper.vm.$emit('bar', 123) /* -wrapper.emittedByOrder() returns the following Array: +wrapper.emittedByOrder() retourne le tableau suivant : [ { name: 'foo', args: [] }, { name: 'bar', args: [123] } ] */ -// assert event emit order +// asserte l'ordre des émissions expect(wrapper.emittedByOrder().map(e => e.name)).toEqual(['foo', 'bar']) ``` diff --git a/docs/en/api/wrapper/exists.md b/docs/en/api/wrapper/exists.md index 4fac1351f..e72e86f52 100644 --- a/docs/en/api/wrapper/exists.md +++ b/docs/en/api/wrapper/exists.md @@ -1,12 +1,12 @@ # exists() -Assert `Wrapper` or `WrapperArray` exists. +Asserte que `Wrapper` ou `WrapperArray` existent. -Returns false if called on an empty `Wrapper` or `WrapperArray`. +Retourne `false` si appellé sur un `Wrapper` ou `WrapperArray` vide. -- **Returns:** `{boolean}` +- **Retourne :** `{boolean}` -- **Example:** +- **Exemple :** ```js import { mount } from 'vue-test-utils' @@ -15,7 +15,7 @@ import Foo from './Foo.vue' const wrapper = mount(Foo) expect(wrapper.exists()).toBe(true) -expect(wrapper.find('does-not-exist').exists()).toBe(false) +expect(wrapper.find('existe-pas').exists()).toBe(false) expect(wrapper.findAll('div').exists()).toBe(true) -expect(wrapper.findAll('does-not-exist').exists()).toBe(false) +expect(wrapper.findAll('existe-pas').exists()).toBe(false) ``` diff --git a/docs/en/api/wrapper/find.md b/docs/en/api/wrapper/find.md index 1d121c591..6339b7224 100644 --- a/docs/en/api/wrapper/find.md +++ b/docs/en/api/wrapper/find.md @@ -1,15 +1,15 @@ # find(selector) -Returns [`Wrapper`](README.md) of first DOM node or Vue component matching selector. +Retourne un [`Wrapper`](README.md) du premier nœud du DOM ou le composant Vue correspondant au sélecteur. -Use any valid [selector](../selectors.md). +Utilise n'importe quels [sélecteurs valides](../selectors.md). -- **Arguments:** - - `{string|Component} selector` +- **Paramètres ** + - `{string|Component} selector : un sélecteur` -- **Returns:** `{Wrapper}` +- **Retourne :** `{Wrapper}` -- **Example:** +- **Exemple :** ```js import { mount } from 'vue-test-utils' @@ -24,4 +24,4 @@ const bar = wrapper.find(Bar) expect(bar.is(Bar)).toBe(true) ``` -- **See also:** [Wrapper](README.md) +- **Voir aussi :** [Wrapper](README.md) diff --git a/docs/en/api/wrapper/findAll.md b/docs/en/api/wrapper/findAll.md index f78ab6201..beb6165b1 100644 --- a/docs/en/api/wrapper/findAll.md +++ b/docs/en/api/wrapper/findAll.md @@ -1,15 +1,15 @@ # findAll(selector) -Returns a [`WrapperArray`](../wrapper-array/README.md) of [Wrappers](README.md). +Retourne un [`WrapperArray`](../wrapper-array/README.md) de [Wrappers](README.md). -Use any valid [selector](../selectors.md). +Utilise n'importe quels [sélecteurs valides](../selectors.md). -- **Arguments:** - - `{string|Component} selector` +- **Paramètres :** + - `{string|Component} selector : un sélecteur` -- **Returns:** `{WrapperArray}` +- **Retourne :** `{WrapperArray}` -- **Example:** +- **Exemple :** ```js import { mount } from 'vue-test-utils' @@ -24,4 +24,4 @@ const bar = wrapper.findAll(Bar).at(0) expect(bar.is(Bar)).toBe(true) ``` -- **See also:** [Wrapper](README.md) +- **Voir aussi :** [Wrapper](README.md) diff --git a/docs/en/api/wrapper/hasAttribute.md b/docs/en/api/wrapper/hasAttribute.md index da9a893b5..43da0b5c1 100644 --- a/docs/en/api/wrapper/hasAttribute.md +++ b/docs/en/api/wrapper/hasAttribute.md @@ -1,16 +1,16 @@ # hasAttribute(attribute, value) -Assert `Wrapper` DOM node has attribute matching value. +Asserte que le DOM du `Wrapper` a l'attribut avec la valeur correspondate. -Returns `true` if `Wrapper` DOM node contains attribute with matching value. +Retourne `true` si le nœud du DOM du `Wrapper` contient un attribut avec la bonne valeur. -- **Arguments:** +- **Paramètres :** - `{string} attribute` - `{string} value` -- **Returns:** `{boolean}` +- **Retourne :** `{boolean}` -- **Example:** +- **Exemple :** ```js import { mount } from 'vue-test-utils' @@ -21,9 +21,9 @@ const wrapper = mount(Foo) expect(wrapper.hasAttribute('id', 'foo')).toBe(true) ``` -- **Alternative:** +- **Alternative :** -You could get the attribute from the `Wrapper.element` to have a value based assertion: +Vous pouvez récuperer l'attribut depuis `Wrapper.element` pour avoir une assertion basée sur une valeur. ```js import { mount } from 'vue-test-utils' @@ -34,4 +34,4 @@ const wrapper = mount(Foo) expect(wrapper.element.getAttribute('id')).toBe('foo') ``` -This makes for a more informative assertion error. +Cela produit une erreur d'assertion plus informative. \ No newline at end of file diff --git a/docs/en/api/wrapper/hasClass.md b/docs/en/api/wrapper/hasClass.md index c70b21ef9..98e3a12b2 100644 --- a/docs/en/api/wrapper/hasClass.md +++ b/docs/en/api/wrapper/hasClass.md @@ -1,15 +1,15 @@ # hasClass(className) -Assert `Wrapper` DOM node has class contains `className`. +Asserte que le DOM du `Wrapper` contient une classe nommé `className`. -Returns `true` if `Wrapper` DOM node contains class. +Retourne `true` si le nœud du DOM du `Wrapper` contient la classe. -- **Arguments:** +- **Paramètres :** - `{string} className` -- **Returns:** `{boolean}` +- **Retourne :** `{boolean}` -- **Example:** +- **Exemple :** ```js import { mount } from 'vue-test-utils' diff --git a/docs/en/api/wrapper/hasProp.md b/docs/en/api/wrapper/hasProp.md index 66e64b41b..c6661a9ca 100644 --- a/docs/en/api/wrapper/hasProp.md +++ b/docs/en/api/wrapper/hasProp.md @@ -1,19 +1,19 @@ # hasProp(prop, value) -Assert `Wrapper` `vm` has `prop` matching `value`. +Asserte que l'instance de Vue `vm` du `Wrapper` contient une `prop` de valeur `value`. -Returns `true` if `Wrapper` `vm` has `prop` matching `value`. +Retourne `true` si l'instance de Vue `vm` du `Wrapper` contient une `prop` de valeur `value`. -**Note: the Wrapper must contain a Vue instance.** +**Note : le Wrapper doit posséder une instance de Vue.** -- **Arguments:** +- **Paramètres :** - `{string} prop` - `{any} value` -- **Returns:** `{boolean}` +- **Retourne :** `{boolean}` -- **Example:** +- **Exemple :** ```js import { mount } from 'vue-test-utils' diff --git a/docs/en/api/wrapper/hasStyle.md b/docs/en/api/wrapper/hasStyle.md index 3d3bb68b4..1d95a2f05 100644 --- a/docs/en/api/wrapper/hasStyle.md +++ b/docs/en/api/wrapper/hasStyle.md @@ -1,18 +1,18 @@ # hasStyle(style, value) -Assert `Wrapper` DOM node has style matching value +Asserte que le DOM du `Wrapper` contient un style avec une certaine valeur. -Returns `true` if `Wrapper` DOM node has `style` matching `string`. +Retourne `true` si le nœud du DOM du `Wrapper` contient un `style` correspondant à `string`. -**Note will only detect inline styles when running in `jsdom`.** +**Note : cela va uniquement détecter les styles `inlines` quand ils fonctionnent avec `jsdom`.** -- **Arguments:** +- **Paramètres :** - `{string} style` - `{string} value` -- **Returns:** `{boolean}` +- **Retourne :** `{boolean}` -- **Example:** +- **Exemple :** ```js import { mount } from 'vue-test-utils' diff --git a/docs/en/api/wrapper/html.md b/docs/en/api/wrapper/html.md index 1243f180f..44d2a893e 100644 --- a/docs/en/api/wrapper/html.md +++ b/docs/en/api/wrapper/html.md @@ -1,10 +1,10 @@ # html() -Returns HTML of `Wrapper` DOM node as a string. +Retourne l'HTML du DOM du `Wrapper` en string. -- **Returns:** `{string}` +- **Retourne :** `{string}` -- **Example:** +- **Exemple :** ```js import { mount } from 'vue-test-utils' diff --git a/docs/en/api/wrapper/is.md b/docs/en/api/wrapper/is.md index 2987de1a2..18d9c8ba7 100644 --- a/docs/en/api/wrapper/is.md +++ b/docs/en/api/wrapper/is.md @@ -1,13 +1,13 @@ # is(selector) -Assert `Wrapper` DOM node or `vm` matches [selector](../selectors.md). +Asserte que le DOM du `Wrapper` ou que l'instance de Vue `vm` correspond au [sélecteur](../selectors.md). -- **Arguments:** - - `{string|Component} selector` +- **Paramètres :** + - `{string|Component} selector : un sélecteur` -- **Returns:** `{boolean}` +- **Retourne :** `{boolean}` -- **Example:** +- **Exemple :** ```js import { mount } from 'vue-test-utils' diff --git a/docs/en/api/wrapper/isEmpty.md b/docs/en/api/wrapper/isEmpty.md index d70fe7140..40ed9ed9e 100644 --- a/docs/en/api/wrapper/isEmpty.md +++ b/docs/en/api/wrapper/isEmpty.md @@ -1,10 +1,10 @@ # isEmpty() -Assert `Wrapper` does not contain child node. +Asserte que le `Wrapper` ne contient pas de nœuds enfants. -- **Returns:** `{boolean}` +- **Retourne :** `{boolean}` -- **Example:** +- **Exemple :** ```js import { mount } from 'vue-test-utils' diff --git a/docs/en/api/wrapper/isVueInstance.md b/docs/en/api/wrapper/isVueInstance.md index 9da12a267..782a97b09 100644 --- a/docs/en/api/wrapper/isVueInstance.md +++ b/docs/en/api/wrapper/isVueInstance.md @@ -1,10 +1,10 @@ # isVueInstance() -Assert `Wrapper` is Vue instance. +Asserte que `Wrapper` contient une instance de Vue. -- **Returns:** `{boolean}` +- **Retourne :** `{boolean}` -- **Example:** +- **Exemple :** ```js import { mount } from 'vue-test-utils' diff --git a/docs/en/api/wrapper/name.md b/docs/en/api/wrapper/name.md index a1faf1b4f..e20be6f9d 100644 --- a/docs/en/api/wrapper/name.md +++ b/docs/en/api/wrapper/name.md @@ -1,10 +1,10 @@ # name() -Returns component name if `Wrapper` contains a Vue instance, or the tag name of `Wrapper` DOM node if `Wrapper` does not contain a Vue instance. +Retourne le nom du composant si le `Wrapper` contient une instance de Vue. Il retourne le nom de la balise du nœud du DOM du `Wrapper` si il ne contient pas une instance de Vue. -- **Returns:** `{string}` +- **Retourne :** `{string}` -- **Example:** +- **Exemple :** ```js import { mount } from 'vue-test-utils' diff --git a/docs/en/api/wrapper/setData.md b/docs/en/api/wrapper/setData.md index 608f083f4..b4c0f4a82 100644 --- a/docs/en/api/wrapper/setData.md +++ b/docs/en/api/wrapper/setData.md @@ -1,13 +1,13 @@ # setData(data) -Sets `Wrapper` `vm` data and forces update. +Fixe les données de l'instance de Vue `vm` du `Wrapper` `vm` et force la mise à jour. -**Note the Wrapper must contain a Vue instance.** +**Note : le `Wrapper` doit contenir une instance de Vue.** -- **Arguments:** - - `{Object} data` +- **Paramètres :** + - `{Object} data : données` -- **Example:** +- **Exemple :** ```js import { mount } from 'vue-test-utils' diff --git a/docs/en/api/wrapper/setMethods.md b/docs/en/api/wrapper/setMethods.md index 4a40546ee..be3b3c3b3 100644 --- a/docs/en/api/wrapper/setMethods.md +++ b/docs/en/api/wrapper/setMethods.md @@ -1,13 +1,13 @@ # setMethods(methods) -Sets `Wrapper` `vm` methods and forces update. +Fixe les méthodes de l'instance de Vue `vm` du `Wrapper` `vm` et force la mise à jour. -**Note the Wrapper must contain a Vue instance.** +**Note : le `Wrapper` doit contenir une instance de Vue.** -- **Arguments:** +- **Paramètres:** - `{Object} methods` -- **Example:** +- **Exemple :** ```js import { mount } from 'vue-test-utils' diff --git a/docs/en/api/wrapper/setProps.md b/docs/en/api/wrapper/setProps.md index 67ff3f3b1..354556b56 100644 --- a/docs/en/api/wrapper/setProps.md +++ b/docs/en/api/wrapper/setProps.md @@ -1,13 +1,13 @@ # setProps(props) -Sets `Wrapper` `vm` props and forces update. +Fixe les `props` de l'instance de Vue `vm` du `Wrapper` `vm` et force la mise à jour. -**Note the Wrapper must contain a Vue instance.** +**Note : le `Wrapper` doit contenir une instance de Vue.** -- **Arguments:** +- **Paramètres :** - `{Object} props` -- **Example:** +- **Exemple :** ```js import { mount } from 'vue-test-utils' diff --git a/docs/en/api/wrapper/text.md b/docs/en/api/wrapper/text.md index d1ccd4b44..f808c64d3 100644 --- a/docs/en/api/wrapper/text.md +++ b/docs/en/api/wrapper/text.md @@ -1,10 +1,10 @@ # text() -Returns text content of `Wrapper`. +Retourne le contenu texte du `Wrapper`. -- **Returns:** `{string}` +- **Retourne :** `{string}` -- **Example:** +- **Exemple :** ```js import { mount } from 'vue-test-utils' diff --git a/docs/en/api/wrapper/trigger.md b/docs/en/api/wrapper/trigger.md index 537cda9e6..aa6aa1956 100644 --- a/docs/en/api/wrapper/trigger.md +++ b/docs/en/api/wrapper/trigger.md @@ -1,17 +1,17 @@ # trigger(eventName) -Triggers an event on the `Wrapper` DOM node. +Déclenche un évènement sur le nœud du DOM du `Wrapper`. -Trigger takes an optional `options` object. The properties in the `options` object are added to the Event. +`Trigger` prend un objet optionel `options`. Les propriétés dans `options` sont ajoutées à l'évènement. -You can run preventDefault on the event by passing `preventDefault: true` in `options`. +Vous pouvez activer `preventDefault` sur l'évènement en passant `preventDefault: true` dans `options`. -- **Arguments:** - - `{string} eventName` +- **Paramètres :** + - `{string} eventName : nom de l'évènement` - `{Object} options` - `{boolean} preventDefault` -- **Example:** +- **Exemple :** ```js import { mount } from 'vue-test-utils' diff --git a/docs/en/api/wrapper/update.md b/docs/en/api/wrapper/update.md index 15d13be89..d0e534148 100644 --- a/docs/en/api/wrapper/update.md +++ b/docs/en/api/wrapper/update.md @@ -1,10 +1,10 @@ # update() -Force root Vue component to re-render. +Force le composant Vue principal à se mettre à jour. -If called on a `Wrapper` containing a `vm`, it will force the `Wrapper` `vm` to re-render. +Si appellée sur un `Wrapper` contenant une instance de Vue `vm`, il la mettra à jour. -- **Example:** +- **Exemple :** ```js import { mount } from 'vue-test-utils' @@ -13,7 +13,7 @@ import Foo from './Foo.vue' const wrapper = mount(Foo) expect(wrapper.vm.bar).toBe('bar') -wrapper.vm.bar = 'new value' +wrapper.vm.bar = 'nouvelle valeur' wrapper.update() -expect(wrapper.vm.bar).toBe('new value') +expect(wrapper.vm.bar).toBe('nouvelle valeur') ```