Skip to content

[Doc FR]: Some update from EN version #217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jan 2, 2018
Merged
24 changes: 12 additions & 12 deletions docs/fr/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

* [mount (EN)](./mount.md)
* [shallow (EN)](./shallow.md)
* [Options de montage (EN)](./options.md)
* [Mounting Options (EN)](./options.md)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trad perdu ici

Copy link
Contributor Author

@MachinisteWeb MachinisteWeb Dec 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Volontaire, je traduirais quand la page sera traduite. Bien vu :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

- [context (EN)](./options.md#context)
- [slots (EN)](./options.md#slots)
- [stubs (EN)](./options.md#stubs)
Expand All @@ -15,7 +15,7 @@
* [contains (EN)](./wrapper/contains.md)
* [emitted (EN)](./wrapper/emitted.md)
* [emittedByOrder (EN)](./wrapper/emittedByOrder.md)
* [exists](./wrapper/exists.md)
* [exists (EN)](./wrapper/exists.md)
* [destroy (EN)](./wrapper/destroy.md)
* [find (EN)](./wrapper/find.md)
* [findAll (EN)](./wrapper/findAll.md)
Expand All @@ -28,17 +28,17 @@
* [isEmpty (EN)](./wrapper/isEmpty.md)
* [isVueInstance (EN)](./wrapper/isVueInstance.md)
* [name (EN)](./wrapper/name.md)
* [setComputed](./wrapper/setComputed.md)
* [setData](./wrapper/setData.md)
* [setMethods](./wrapper/setMethods.md)
* [setProps](./wrapper/setProps.md)
* [text](./wrapper/text.md)
* [setComputed (EN)](./wrapper/setComputed.md)
* [setData (EN)](./wrapper/setData.md)
* [setMethods (EN)](./wrapper/setMethods.md)
* [setProps (EN)](./wrapper/setProps.md)
* [text (EN)](./wrapper/text.md)
* [trigger (EN)](./wrapper/trigger.md)
* [update (EN)](./wrapper/update.md)
* [WrapperArray (EN)](./wrapper-array/README.md)
* [at (EN)](./wrapper-array/at.md)
* [contains (EN)](./wrapper-array/contains.md)
* [exists](./wrapper/exists.md)
* [exists (EN)](./wrapper/exists.md)
* [destroy (EN)](./wrapper-array/destroy.md)
* [hasAttribute (EN)](./wrapper-array/hasAttribute.md)
* [hasClass (EN)](./wrapper-array/hasClass.md)
Expand All @@ -53,9 +53,9 @@
* [setProps (EN)](./wrapper-array/setProps.md)
* [trigger (EN)](./wrapper-array/trigger.md)
* [update (EN)](./wrapper-array/update.md)
* [components](./components/README.md)
* [TransitionStub](./components/TransitionStub.md)
* [TransitionGroupStub](./components/TransitionGroupStub.md)
* [components (EN)](./components/README.md)
* [TransitionStub (EN)](./components/TransitionStub.md)
* [TransitionGroupStub (EN)](./components/TransitionGroupStub.md)
* [Selectors (EN)](./selectors.md)
* [createLocalVue (EN)](./createLocalVue.md)
* [Selecteurs (EN)](./selectors.md)
* [config (EN)](./config.md)
6 changes: 3 additions & 3 deletions docs/fr/api/components/TransitionGroupStub.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# TransitionGroupStub

<p><strong>⚠Cette page est actuellement en cours de traduction française. Vous pouvez repasser plus tard ou <a href="https://github.com/vuejs-fr/vue-test-utils" target="_blank">participer à la traduction</a> de celle-ci dès maintenant !</strong></p><p>A component to stub the `transition-group` wrapper component. Instead of performing transitions asynchronously, it returns the child components synchronously.</p>
<p><strong>⚠Cette page est actuellement en cours de traduction française. Vous pouvez repasser plus tard ou <a href="https://github.com/vuejs-fr/vue-test-utils" target="_blank">participer à la traduction</a> de celle-ci dès maintenant !</strong></p><p>A component to stub the `transition-group` component. Instead of performing transitions asynchronously, it returns the child components synchronously.</p>

This is set to stub all `transition-group` components by default in the `vue-test-utils` config. To use the built-in `transition-group` wrapper component set `config.stubs['transition-group']` to false:
This is set to stub all `transition-group` components by default in the `vue-test-utils` config. To use the built-in `transition-group` component set `config.stubs['transition-group']` to false:

```js
import VueTestUtils from 'vue-test-utils'

VueTestUtils.config.stubs['transition-group'] = false
```

To reset it to stub transition components:
To reset it to stub `transition-group` components:

```js
import VueTestUtils, { TransitionGroupStub } from 'vue-test-utils'
Expand Down
6 changes: 3 additions & 3 deletions docs/fr/api/components/TransitionStub.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# TransitionStub

<p><strong>⚠Cette page est actuellement en cours de traduction française. Vous pouvez repasser plus tard ou <a href="https://github.com/vuejs-fr/vue-test-utils" target="_blank">participer à la traduction</a> de celle-ci dès maintenant !</strong></p><p>A component to stub the `transition` wrapper component. Instead of performing transitions asynchronously, it returns the child component synchronously.</p>
<p><strong>⚠Cette page est actuellement en cours de traduction française. Vous pouvez repasser plus tard ou <a href="https://github.com/vuejs-fr/vue-test-utils" target="_blank">participer à la traduction</a> de celle-ci dès maintenant !</strong></p><p>A component to stub the `transition` component. Instead of performing transitions asynchronously, it returns the child component synchronously.</p>

This is set to stub all `transition` components by default in the vue-test-utils config. To use the built-in `transition` wrapper component set `config.stubs.transition` to false:
This is set to stub all `transition` components by default in the vue-test-utils config. To use the built-in `transition` component set `config.stubs.transition` to false:

```js
import VueTestUtils from 'vue-test-utils'

VueTestUtils.config.stubs.transition = false
```

To reset it to stub transition components:
To reset it to stub `transition` components:
```js
import VueTestUtils, { TransitionStub } from 'vue-test-utils'

Expand Down
2 changes: 1 addition & 1 deletion docs/fr/api/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

Stubs to use in components. These are overwritten by `stubs` passed in the mounting options.

When passing `stubs` as an array in the mounting options, `config.stubs` are converted to an array, and will stub components with a basic component that returns a div.
When passing `stubs` as an array in the mounting options, `config.stubs` are converted to an array, and will stub components with a basic component that returns `<!---->`.

Example:

Expand Down
4 changes: 2 additions & 2 deletions docs/fr/api/mount.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ import Faz from './Faz.vue'
describe('Foo', () => {
it('renders a div', () => {
const wrapper = mount(Foo, {
stub: {
Bar: '<div class="stubbed />',
stubs: {
Bar: '<div class="stubbed" />',
BarFoo: true,
FooBar: Faz
}
Expand Down
9 changes: 6 additions & 3 deletions docs/fr/api/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Vue options are passed to the component when a new instance is created. , e.g. `
- [`localVue`](#localvue)
- [`attachToDocument`](#attachtodocument)
- [`attrs`](#attrs)
- [`provide`](#provide)
- [`listeners`](#listeners)

### `context`
Expand Down Expand Up @@ -60,7 +61,7 @@ expect(wrapper.find('div')).toBe(true)

- type: `{ [name: string]: Component | boolean } | Array<string>`

Stubs child components. Can be an Array of component names to stub, or an object.
Stubs child components. Can be an Array of component names to stub, or an object. If `stubs` is an Array, every stub is `<!---->`.

Example:

Expand Down Expand Up @@ -152,6 +153,8 @@ Set the component instance's `$attrs` object.

Set the component instance's `$listeners` object.

`options.mocks` (`Object`): Add globals to Vue instance.
### `provide`

`options.localVue` (`Object`): `Vue` class to use in `mount`. See [`createLocalVue`](createLocalVue.md).
- type: `Object`

Pass properties for components to use in injection. See [provide/inject](https://vuejs.org/v2/api/#provide-inject).
6 changes: 3 additions & 3 deletions docs/fr/guides/dom-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const wrapper = mount(MyButton)
wrapper.trigger('click')
```

Vous devez être au courant que la méthode `find` retourne aussi un wrapper. En partant du principe que `MyComponent` contient un bouton, le code suivant clique sur le bouton.
Vous devez être au courant que la méthode `find` retourne aussi un `Wrapper`. En partant du principe que `MyComponent` contient un bouton, le code suivant clique sur le bouton.

```js
const wrapper = mount(MyComponent)
Expand Down Expand Up @@ -70,7 +70,7 @@ import { mount } from 'vue-test-utils'
import sinon from 'sinon'

describe('Évènement click', () => {
it('Cliquer sur le bouton oui appelle notre méthode avec l\'argument "oui"', () => {
it("Cliquer sur le bouton oui appelle notre méthode avec l'argument « oui »", () => {
const spy = sinon.spy()
const wrapper = mount(YesNoComponent, {
propsData: {
Expand Down Expand Up @@ -173,7 +173,7 @@ describe('Tests événement clavier', () => {
expect(wrapper.vm.quantity).to.equal(0)
})

it('Le caractère magique "a" positionne la quantité à 13', () => {
it('Le caractère magique `a` positionne la quantité à 13', () => {
const wrapper = mount(QuantityComponent)
wrapper.trigger('keydown', {
which: 65
Expand Down
28 changes: 28 additions & 0 deletions docs/fr/guides/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,34 @@ Pour simplifier cela, `vue-test-utils` applique toutes les mises à jour de faç

*Note : `nextTick` est toujours nécessaire quand vous souhaitez explicitement faire avancer la boucle des évènements, pour des opérations telles que des fonctions de rappel ou des résolutions de promesses.*

Si vous avez toujours besoin de `nextTick` dans vos fichiers de tests, faites attention aux erreurs jetées aux erreurs lancées à l'intérieur qui peuvent ne pas être attrapées par votre lanceur de tests car il utilise des promesses. Il y a deux approches pour régler celà : vous pouvez affecter la fonction de rappel `done` du système de gestion d'erreurs globales de Vue au démarrage des tests, ou vous pouvez appeler `nextTick` sans argument pour l'utiliser sous forme de promesse :

```js
// ceci ne sera pas intercepté
it("pas d'interception", (done) => {
Vue.nextTick(() => {
expect(true).toBe(false)
done()
})
})

// les deux tests ci-dessous vont fonctionner comme souhaité
it("attraper l'erreur avec `done`", (done) => {
Vue.config.errorHandler = done
Vue.nextTick(() => {
expect(true).toBe(false)
done()
})
})

it("attraper l'erreur avec une promesse", () => {
return Vue.nextTick()
.then(function () {
expect(true).toBe(false)
})
})
```

## Et après ?

- Intégrez `vue-test-utils` dans votre projet en [choisissant votre lanceur de tests](./choosing-a-test-runner.md)
Expand Down
5 changes: 2 additions & 3 deletions docs/fr/guides/using-with-vuex.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe('Actions.vue', () => {
})
```

Que se passe-t-il ici ? Premièrement, on indique à Vue d'utiliser Vuex avec la méthode `use`. C'est tout simplement une surcouche de `Vue.use`.
Que se passe-t-il ici ? Premièrement, on indique à Vue d'utiliser Vuex avec la méthode `localVue.use`. C'est tout simplement une surcouche de `Vue.use`.

On va ensuite créer un store fictif en appelant `new Vuex.Store` avec nos propres valeurs. À noter que l'on indique uniquement nos actions, car on ne s'intéresse qu'à elles.

Expand All @@ -109,7 +109,6 @@ Génial, on peut désormais simuler des actions. Allons avoir comment simuler de

## Simuler des accesseurs


``` html
<template>
<div>
Expand Down Expand Up @@ -244,7 +243,7 @@ describe('Modules.vue', () => {
})
})

it('appelle l\'action du store moduleActionClick quand le bouton est cliqué', () => {
it("appelle l'action du store moduleActionClick quand le bouton est cliqué", () => {
const wrapper = shallow(Modules, { store, localVue })
const button = wrapper.find('button')
button.trigger('click')
Expand Down