Skip to content
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

Guide: dom-events.md #19

Merged
merged 5 commits into from
Nov 6, 2017
Merged

Guide: dom-events.md #19

merged 5 commits into from
Nov 6, 2017

Conversation

mdartic
Copy link
Member

@mdartic mdartic commented Nov 2, 2017

Traduction de la partie dom-events, merci de relire !

Première traduction
Copy link
Member

@MachinisteWeb MachinisteWeb left a comment

Choose a reason for hiding this comment

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

Top @mdartic !

Le gros de ce que j'ai vu c'est la ponctuation FR, ne pas traduire les propriétés, méthode et nom de fichir et utiliser la graphie post 1990 :)

Merci pour la trad !

@@ -2,7 +2,7 @@

* [Commencer](./getting-started.md)
* [Astuces](./common-tips.md)
* [Mouse, Key and other DOM Events (EN)](guides/dom-events.md)
* [Mouse, Key and other DOM Events (EN)](./dom-events.md)
Copy link
Member

Choose a reason for hiding this comment

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

Tu peux retirer le EN :) Et traduire la ligne :)

@@ -1,16 +1,17 @@
# Testing Key, Mouse and other DOM events
# Tester le clavier, la souris et les autres événements DOM
Copy link
Member

Choose a reason for hiding this comment

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

On utilise la graphie post 1990. Donc

évèments


The `Wrapper` expose a `trigger` method. It can be used to trigger DOM events.

Le `Wrapper` expose une méthode `trigger` method. Elle peut être utilisée pour déclencher des événements du DOM.
Copy link
Member

Choose a reason for hiding this comment

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

method.


```js
const wrapper = mount(MyButton)

wrapper.trigger('click')
```

You should be aware, that find returns a wrapper as well. Assuming `MyComponent` contains a button, the following code clicks the button.
Vous devez être au courant que la méthode find retourne un wrapper aussi. Partant du principe que `MyComponent` contient un bouton, le code suivant clique sur le bouton.
Copy link
Member

Choose a reason for hiding this comment

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

`find`

(Tu peux PR l'original)

@@ -20,9 +21,9 @@ wrapper.find('button').trigger('click')

## Options

The trigger method takes an optional `options` object. The properties in the `options` object are added to the Event.
La méthode trigger prend en paramètre optionnel l'objet `options`. Les propriétés de l'objet `options` sont ajoutées à l'événement Event.
Copy link
Member

Choose a reason for hiding this comment

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

La méthode `trigger`

sont ajoutées à l'évènement Event.

ou

sont ajoutées à l'évènement.

it('Quantity is zero by default', () => {
const wrapper = mount(QuantityComponent)
expect(wrapper.vm.quantity).to.equal(0)
describe('Tests événement clavier', () => {
Copy link
Member

Choose a reason for hiding this comment

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

évènement

expect(wrapper.vm.quantity).to.equal(0)
describe('Tests événement clavier', () => {
it('La quantité est zéro par défaut', () => {
const wrapper = mount(QuantiteComponent)
Copy link
Member

Choose a reason for hiding this comment

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

Remettre en EN et le reste du code (garder en FR ce qui est dans it(

it('Escape sets quantity to 0', () => {
const wrapper = mount(QuantityComponent)
wrapper.vm.quantity = 5
it('La touche Echap positionne la quantité à 0', () => {
Copy link
Member

Choose a reason for hiding this comment

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

La touche Échap

})
})

```

**Limitations**

A key name after the dot `keydown.up` is translated to a `keyCode`. This is supported for the following names:
Un nom de touche après le point `keydown.up` est traduit vers un `keyCode`. Cela est supporté pour les noms suivant:
Copy link
Member

Choose a reason for hiding this comment

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

les noms suivant : (espace avant les :)


* enter, tab, delete, esc, space, up, down, left, right

## Important

vue-test-utils triggers event synchronously. Consequently, `vue.nextTick` is not required.
vue-test-utils déclenche les événements de façon synchrone. Par conséquent, `vue.nextTick` n'est pas requis.
Copy link
Member

Choose a reason for hiding this comment

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

évènements

Copy link

@rspt rspt left a comment

Choose a reason for hiding this comment

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

Niveau orthographe c'est plutôt ok pour moi! Juste événements à changer pour évènements comme souligné par @haeresis

@mdartic
Copy link
Member Author

mdartic commented Nov 5, 2017

Merci @haeresis & @rspt
J'ai pris en compte tes demandes  @haeresis , mais j'ai encore le doute sur le yes/no.

@MachinisteWeb
Copy link
Member

Le paramètre de this.callMe('yes') est une chaîne de caractères, donc on le traduit.

@MachinisteWeb
Copy link
Member

T'en fais pas, je m'en occupe après merge, j'ai pas le contexte complet sur mon mobile, j'imagine qu'en fait c'est plus subtile ?!

Copy link

@Yaty Yaty left a comment

Choose a reason for hiding this comment

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

Voilà ma review, bonne trad :)


```js
const wrapper = mount(MyButton)

wrapper.trigger('click')
```

You should be aware, that find returns a wrapper as well. Assuming `MyComponent` contains a button, the following code clicks the button.
Vous devez être au courant que la méthode `find` retourne un wrapper aussi. Partant du principe que `MyComponent` contient un bouton, le code suivant clique sur le bouton.
Copy link

Choose a reason for hiding this comment

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

retourne aussi un wrapper.

En partant du principe


**Component under test**
**Componsant à tester**
Copy link

Choose a reason for hiding this comment

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

Composant

describe('Click event', () => {
it('Click on yes button calls our method with argument "yes"', () => {
describe('Évènement click', () => {
it('Cliquer sur le bouton oui appelle notre méthode avec l\'argument "yes"', () => {
Copy link

Choose a reason for hiding this comment

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

"Cliquer sur le bouton oui appelle notre méthode avec l'argument 'yes'", on avait fait ça pour les autres fichiers afin d'éviter les backslashs

@MachinisteWeb
Copy link
Member

Je te laisse prendre les retours de @Yaty, @mdartic et on pourra merge :)

@mdartic
Copy link
Member Author

mdartic commented Nov 6, 2017

Done
J'ai traduit du coup les this.callMe('yes/no') en this.callMe('oui/non'), mais ça me paraît un peu cavalier dans le sens où les tests sont à la fois en anglais & français.
On a une classe css yes qui est utilisée pour cibler le bouton, et on valide que la méthode est bien appelée avec oui... ça vous paraît pas étrange ?

@MachinisteWeb
Copy link
Member

Pour moi c'est tout bon, le libélé du bouton cliqué est bien « Oui » <button class="yes" @click="callYes">Oui</button>

@MachinisteWeb MachinisteWeb merged commit 95fa5db into working Nov 6, 2017
@MachinisteWeb MachinisteWeb deleted the guide-dom-events branch November 6, 2017 15:19
@MachinisteWeb
Copy link
Member

Super @Yaty, @mdartic et @rspt

La pratie Guides est en PR ;)
vuejs#159

Partie API maintenant :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants