Skip to content

Commit 50a3596

Browse files
MachinisteWebeddyerburgh
authored andcommitted
docs(fr): Update EN version (#217)
* Add french part Signed-off-by: Bruno Lesieur <[email protected]> * Message for part still not translated. Signed-off-by: Bruno Lesieur <[email protected]> * Last changes added Signed-off-by: Bruno Lesieur <[email protected]> * Review from original repo Signed-off-by: Bruno Lesieur <[email protected]> * Some update from french version Signed-off-by: Bruno Lesieur <[email protected]> * Review of Edd Yerburgh and updates Signed-off-by: Bruno Lesieur <[email protected]> * Fix code syntax Signed-off-by: Bruno Lesieur <[email protected]> * Fix code typo Signed-off-by: Bruno Lesieur <[email protected]> * Fix HEAD remaining Signed-off-by: Bruno Lesieur <[email protected]> * Review @posva Signed-off-by: Bruno Lesieur <[email protected]>
1 parent d064eaa commit 50a3596

File tree

9 files changed

+60
-30
lines changed

9 files changed

+60
-30
lines changed

docs/fr/api/README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
* [mount (EN)](./mount.md)
44
* [shallow (EN)](./shallow.md)
5-
* [Options de montage (EN)](./options.md)
5+
* [Mounting Options (EN)](./options.md)
66
- [context (EN)](./options.md#context)
77
- [slots (EN)](./options.md#slots)
88
- [stubs (EN)](./options.md#stubs)
@@ -15,7 +15,7 @@
1515
* [contains (EN)](./wrapper/contains.md)
1616
* [emitted (EN)](./wrapper/emitted.md)
1717
* [emittedByOrder (EN)](./wrapper/emittedByOrder.md)
18-
* [exists](./wrapper/exists.md)
18+
* [exists (EN)](./wrapper/exists.md)
1919
* [destroy (EN)](./wrapper/destroy.md)
2020
* [find (EN)](./wrapper/find.md)
2121
* [findAll (EN)](./wrapper/findAll.md)
@@ -28,17 +28,17 @@
2828
* [isEmpty (EN)](./wrapper/isEmpty.md)
2929
* [isVueInstance (EN)](./wrapper/isVueInstance.md)
3030
* [name (EN)](./wrapper/name.md)
31-
* [setComputed](./wrapper/setComputed.md)
32-
* [setData](./wrapper/setData.md)
33-
* [setMethods](./wrapper/setMethods.md)
34-
* [setProps](./wrapper/setProps.md)
35-
* [text](./wrapper/text.md)
31+
* [setComputed (EN)](./wrapper/setComputed.md)
32+
* [setData (EN)](./wrapper/setData.md)
33+
* [setMethods (EN)](./wrapper/setMethods.md)
34+
* [setProps (EN)](./wrapper/setProps.md)
35+
* [text (EN)](./wrapper/text.md)
3636
* [trigger (EN)](./wrapper/trigger.md)
3737
* [update (EN)](./wrapper/update.md)
3838
* [WrapperArray (EN)](./wrapper-array/README.md)
3939
* [at (EN)](./wrapper-array/at.md)
4040
* [contains (EN)](./wrapper-array/contains.md)
41-
* [exists](./wrapper/exists.md)
41+
* [exists (EN)](./wrapper/exists.md)
4242
* [destroy (EN)](./wrapper-array/destroy.md)
4343
* [hasAttribute (EN)](./wrapper-array/hasAttribute.md)
4444
* [hasClass (EN)](./wrapper-array/hasClass.md)
@@ -53,9 +53,9 @@
5353
* [setProps (EN)](./wrapper-array/setProps.md)
5454
* [trigger (EN)](./wrapper-array/trigger.md)
5555
* [update (EN)](./wrapper-array/update.md)
56-
* [components](./components/README.md)
57-
* [TransitionStub](./components/TransitionStub.md)
58-
* [TransitionGroupStub](./components/TransitionGroupStub.md)
56+
* [components (EN)](./components/README.md)
57+
* [TransitionStub (EN)](./components/TransitionStub.md)
58+
* [TransitionGroupStub (EN)](./components/TransitionGroupStub.md)
59+
* [Selectors (EN)](./selectors.md)
5960
* [createLocalVue (EN)](./createLocalVue.md)
60-
* [Selecteurs (EN)](./selectors.md)
6161
* [config (EN)](./config.md)

docs/fr/api/components/TransitionGroupStub.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# TransitionGroupStub
22

3-
<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>
3+
<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>
44

5-
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:
5+
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:
66

77
```js
88
import VueTestUtils from 'vue-test-utils'
99

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

13-
To reset it to stub transition components:
13+
To reset it to stub `transition-group` components:
1414

1515
```js
1616
import VueTestUtils, { TransitionGroupStub } from 'vue-test-utils'

docs/fr/api/components/TransitionStub.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# TransitionStub
22

3-
<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>
3+
<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>
44

5-
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:
5+
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:
66

77
```js
88
import VueTestUtils from 'vue-test-utils'
99

1010
VueTestUtils.config.stubs.transition = false
1111
```
1212

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

docs/fr/api/config.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

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

17-
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.
17+
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 `<!---->`.
1818

1919
Example:
2020

docs/fr/api/mount.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ import Faz from './Faz.vue'
122122
describe('Foo', () => {
123123
it('renders a div', () => {
124124
const wrapper = mount(Foo, {
125-
stub: {
126-
Bar: '<div class="stubbed />',
125+
stubs: {
126+
Bar: '<div class="stubbed" />',
127127
BarFoo: true,
128128
FooBar: Faz
129129
}

docs/fr/api/options.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Vue options are passed to the component when a new instance is created. , e.g. `
1313
- [`localVue`](#localvue)
1414
- [`attachToDocument`](#attachtodocument)
1515
- [`attrs`](#attrs)
16+
- [`provide`](#provide)
1617
- [`listeners`](#listeners)
1718

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

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

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

6566
Example:
6667

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

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

155-
`options.mocks` (`Object`): Add globals to Vue instance.
156+
### `provide`
156157

157-
`options.localVue` (`Object`): `Vue` class to use in `mount`. See [`createLocalVue`](createLocalVue.md).
158+
- type: `Object`
159+
160+
Pass properties for components to use in injection. See [provide/inject](https://vuejs.org/v2/api/#provide-inject).

docs/fr/guides/dom-events.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const wrapper = mount(MyButton)
1111
wrapper.trigger('click')
1212
```
1313

14-
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.
14+
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.
1515

1616
```js
1717
const wrapper = mount(MyComponent)
@@ -70,7 +70,7 @@ import { mount } from 'vue-test-utils'
7070
import sinon from 'sinon'
7171

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

176-
it('Le caractère magique "a" positionne la quantité à 13', () => {
176+
it('Le caractère magique `a` positionne la quantité à 13', () => {
177177
const wrapper = mount(QuantityComponent)
178178
wrapper.trigger('keydown', {
179179
which: 65

docs/fr/guides/getting-started.md

+28
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,34 @@ Pour simplifier cela, `vue-test-utils` applique toutes les mises à jour de faç
110110

111111
*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.*
112112

113+
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 :
114+
115+
```js
116+
// ceci ne sera pas intercepté
117+
it("pas d'interception", (done) => {
118+
Vue.nextTick(() => {
119+
expect(true).toBe(false)
120+
done()
121+
})
122+
})
123+
124+
// les deux tests ci-dessous vont fonctionner comme souhaité
125+
it("attraper l'erreur avec `done`", (done) => {
126+
Vue.config.errorHandler = done
127+
Vue.nextTick(() => {
128+
expect(true).toBe(false)
129+
done()
130+
})
131+
})
132+
133+
it("attraper l'erreur avec une promesse", () => {
134+
return Vue.nextTick()
135+
.then(function () {
136+
expect(true).toBe(false)
137+
})
138+
})
139+
```
140+
113141
## Et après ?
114142

115143
- Intégrez `vue-test-utils` dans votre projet en [choisissant votre lanceur de tests](./choosing-a-test-runner.md)

docs/fr/guides/using-with-vuex.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ describe('Actions.vue', () => {
9191
})
9292
```
9393

94-
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`.
94+
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`.
9595

9696
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.
9797

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

110110
## Simuler des accesseurs
111111

112-
113112
``` html
114113
<template>
115114
<div>
@@ -244,7 +243,7 @@ describe('Modules.vue', () => {
244243
})
245244
})
246245

247-
it('appelle l\'action du store moduleActionClick quand le bouton est cliqué', () => {
246+
it("appelle l'action du store moduleActionClick quand le bouton est cliqué", () => {
248247
const wrapper = shallow(Modules, { store, localVue })
249248
const button = wrapper.find('button')
250249
button.trigger('click')

0 commit comments

Comments
 (0)