Skip to content

Guide: using-with-vuex.md #7

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 4 commits into from
Oct 23, 2017
Merged

Guide: using-with-vuex.md #7

merged 4 commits into from
Oct 23, 2017

Conversation

Yaty
Copy link

@Yaty Yaty commented Oct 14, 2017

Traduction du fichier using-with-vuex.md
Je n'ai fait qu'une seule relecture, ça risque d'être un peu brut et pas forcement trop agréable à lire. A voir :)
Ligne 40 : pas sûr du verbe à utiliser (j'ai laissé un TODO)

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.

Merci pour la traduction ! Dans Vuex on a traduit state par état et getter par accesseur. Le store reste le store !


## Mocking Actions
## Simuler des Actions
Copy link
Member

Choose a reason for hiding this comment

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

des actions

@@ -35,13 +35,13 @@ export default{
</script>
Copy link
Member

Choose a reason for hiding this comment

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

Cliquer


To test this, we need to pass a mock store to Vue when we shallow our component.
Pour tester cela, on doit passer un store fictif à Vue lorsque l'on isole notre composant. *TODO : Isoler, bon verbe ?*
Copy link
Member

Choose a reason for hiding this comment

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

Bon pour moi isole


Instead of passing the store to the base Vue constructor, we can pass it to a - [localVue](../api/options.md#localvue). A localVue is a scoped Vue constructor that we can make changes to without affecting the global Vue constructor.
Au lieu de passer le store au constructeur de base de Vue, on peut le passer à - [localVue](../api/options.md#localvue). Une localVue est un constructeur à portée limitée de Vue sur lequel on peut effectuer des changements sans avoir à affecter le constructeur global.
Copy link
Member

Choose a reason for hiding this comment

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

le passer à [`localVue`](...

Copy link
Member

Choose a reason for hiding this comment

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

un Vue local est un constructeur

ou

un `localVue` est un constructeur

@@ -67,47 +67,47 @@ describe('Actions.vue', () => {
})
})

it('calls store action actionInput when input value is input and an input event is fired', () => {
it('appelle une action du store (actionInput) quand la valeur de l\'input est input et qu\'un évènement input est lancée', () => {
Copy link
Member

Choose a reason for hiding this comment

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

On s'autorise le " en français dans le cas ou les « ' » sont utilisés dans la traduction

it("appelle l'action `actionInput` du store quand la valeur du champ est `input` et qu'un évènement `input` est lancé", () =>


[Modules](https://vuex.vuejs.org/en/modules.html) are useful for separating out our store into manageable chunks. They also export getters. We can use these in our tests.
[Modules](https://vuex.vuejs.org/en/modules.html) sont utiles pour séparer un store en plusieurs morceaux. Ils exportent des getters que l'on peut utiliser dans nos tests.
Copy link
Member

Choose a reason for hiding this comment

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

Les [modules]

Copy link
Member

Choose a reason for hiding this comment

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

accesseurs

@@ -205,9 +205,9 @@ export default{
}
</script>
```
Copy link
Member

Choose a reason for hiding this comment

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

Cliquer

@@ -205,9 +205,9 @@ export default{
}
</script>
```
Simple component that includes one action and one getter.
Simple composant qui possède une action et un getter.
Copy link
Member

Choose a reason for hiding this comment

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

un accesseur

@@ -242,23 +242,23 @@ describe('Modules.vue', () => {
})
})

it('calls store action moduleActionClick when button is clicked', () => {
it('appelle l\'action du store moduleActionClick quand le bouton est cliqué', () => {
Copy link
Member

Choose a reason for hiding this comment

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

it("appelle l'action `moduleActionClick` du store quand le bouton est cliqué", () => {

const wrapper = shallow(Modules, { store, localVue })
const button = wrapper.find('button')
button.trigger('click')
expect(actions.moduleActionClick).toHaveBeenCalled()
})

it('Renders state.inputValue in first p tag', () => {
it('affiche state.inputValue dans le premier tag p', () => {
Copy link
Member

Choose a reason for hiding this comment

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

it('affiche `state.inputValue` dans la première balise `<p>`', () => {

@MachinisteWeb MachinisteWeb merged commit 4d900e0 into vuejs-fr:working Oct 23, 2017
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