Skip to content

Commit

Permalink
docs(fr): french language added to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine ZANARDI committed Feb 12, 2023
1 parent 218eedc commit bf0ebd8
Show file tree
Hide file tree
Showing 7 changed files with 955 additions and 866 deletions.
76 changes: 40 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Component testing utils for Vue 3.

## Languages

[🇫🇷 French version of this README.md](https://github.com/vuejs/test-utils/tree/main/docs/fr/README.md)

## Installation and Usage

- yarn: `yarn add @vue/test-utils --dev`
Expand Down Expand Up @@ -31,47 +35,47 @@ This is table for those coming from VTU 1, comparing the two APIs. Some things a

### Mounting Options

| option | status | notes |
| ---------------- | ------ | ----------------------------------------------------------------------------------- |
| data ||
| slots ||
| mocks || nested in `global` |
| propsData || now called `props` |
| provide || nested in `global` |
| mixins || (new!) nested in `global` |
| plugins || (new!) nested in `global` |
| component || (new!) nested in `global` |
| directives || (new!) nested in `global` |
| stubs ||
| attachToDocument || renamed `attachTo`. See [here](https://github.com/vuejs/vue-test-utils/pull/1492) |
| attrs ||
| scopedSlots | ⚰️ | scopedSlots are merged with `slots` in Vue 3 |
| context | ⚰️ | different from Vue 2, does not make sense anymore. |
| localVue | ⚰️ | no longer required - Vue 3 there is no global Vue instance to mutate. |
| listeners | ⚰️ | no longer exists in Vue 3 |
| option | status | notes |
|------------------|--------|-----------------------------------------------------------------------------------|
| data | |
| slots | |
| mocks | | nested in `global` |
| propsData | | now called `props` |
| provide | | nested in `global` |
| mixins | | (new!) nested in `global` |
| plugins | | (new!) nested in `global` |
| component | | (new!) nested in `global` |
| directives | | (new!) nested in `global` |
| stubs | |
| attachToDocument | | renamed `attachTo`. See [here](https://github.com/vuejs/vue-test-utils/pull/1492) |
| attrs | |
| scopedSlots | ⚰️ | scopedSlots are merged with `slots` in Vue 3 |
| context | ⚰️ | different from Vue 2, does not make sense anymore. |
| localVue | ⚰️ | no longer required - Vue 3 there is no global Vue instance to mutate. |
| listeners | ⚰️ | no longer exists in Vue 3 |
| parentComponent | ⚰️ |

### Wrapper API (mount)

| method | status | notes |
| -------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| attributes ||
| classes ||
| exists ||
| find || only `querySelector` syntax is supported. `find(Comp)` under discussion [here](https://github.com/vuejs/vue-test-utils/issues/1498) |
| emitted ||
| findAll || see above. `.vm` is different to Vue 2. We are exploring options. |
| get ||
| html ||
| setValue || works for select, checkbox, radio button, input, textarea. Returns `nextTick`. |
| text ||
| trigger || returns `nextTick`. You can do `await wrapper.find('button').trigger('click')` |
| setProps ||
| props ||
| setData ||
| destroy || renamed to `unmount` to match Vue 3 lifecycle hook name. |
| props ||
| isVisible ||
|----------------|--------|-------------------------------------------------------------------------------------------------------------------------------------|
| attributes | |
| classes | |
| exists | |
| find | | only `querySelector` syntax is supported. `find(Comp)` under discussion [here](https://github.com/vuejs/vue-test-utils/issues/1498) |
| emitted | |
| findAll | | see above. `.vm` is different to Vue 2. We are exploring options. |
| get | |
| html | |
| setValue | | works for select, checkbox, radio button, input, textarea. Returns `nextTick`. |
| text | |
| trigger | | returns `nextTick`. You can do `await wrapper.find('button').trigger('click')` |
| setProps | |
| props | |
| setData | |
| destroy | | renamed to `unmount` to match Vue 3 lifecycle hook name. |
| props | |
| isVisible | |
| contains | ⚰️ | use `find` |
| emittedByOrder | ⚰️ | use `emitted` |
| setSelected | ⚰️ | now part of `setValue` |
Expand Down
2 changes: 1 addition & 1 deletion docs/fr/.vitepress/locale-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const frLocaleConfig: DefaultTheme.LocaleConfig & Omit<DefaultTheme.Config, "loc
{ text: 'Tester Vue Router', link: '/fr/guide/advanced/vue-router' },
{ text: 'Tester Teleport', link: '/fr/guide/advanced/teleport' },
{
text: 'Stubs and Shallow Mount',
text: 'Composants de Substitution (Stubs) et Montage Partiel',
link: '/fr/guide/advanced/stubs-shallow-mount'
}
]
Expand Down
83 changes: 83 additions & 0 deletions docs/fr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Vue Test Utils

Utilitaire de Test de Composants pour Vue 3.

## Installation et Utilisation

- yarn: `yarn add @vue/test-utils --dev`
- npm: `npm install @vue/test-utils --save-dev`

Lancez-vous avec la [documentation](https://test-utils.vuejs.org/fr).

## Vous venez de Vue 2 + Test Utils v1?

[Jetez un œil au guide de migration](https://test-utils.vuejs.org/migration/fr). C'est encore en cours de développement. Si vous rencontrez un problème ou quelque chose qui ne fonctionne plus alors qu'il fonctionnait auparavant dans Vue Test Utils v1, veuillez ouvrir une question sur GitHub.

## Documentation

Voir la [documentation](https://test-utils.vuejs.org/fr).

## Développement

Commencez en exécutant la commande `pnpm install`. Vous pouvez exécuter les tests avec la commande `pnpm test`. C'est tout !

## Comparaison avec Vue Test Utils v1 (qui cible Vue 2)

Voici un tableau pour ceux qui viennent de VTU 1, comparant les deux API. Certaines choses sont encore en cours de développement.

- ✅ - implémenté
- ❌ - pas encore implémenté
- ⚰️ - ne sera pas implémenté (si vous trouvez un scénario qui prouve son utilité, veuillez ouvrir une question sur GitHub)

### Mounting Options

| option | status | notes |
|------------------|--------|---------------------------------------------------------------------------------------|
| data ||
| slots ||
| mocks || situé dans `global` |
| propsData || s'appelle maintenant `props` |
| provide || situé dans `global` |
| mixins || (nouveau !) situé dans `global` |
| plugins || (nouveau !) situé dans `global` |
| component || (nouveau !) situé dans `global` |
| directives || (nouveau !) situé dans `global` |
| stubs ||
| attachToDocument || renommé en `attachTo`. Voir [here](https://github.com/vuejs/vue-test-utils/pull/1492) |
| attrs ||
| scopedSlots | ⚰️ | `scopedSlots` sont fusionnés dans `slots` dans Vue 3 |
| context | ⚰️ | différent depuis Vue 2, n'a plus d'utilité. |
| localVue | ⚰️ | n'est plus obligatoire - Vue 3 il n'y a plus d'instance globale à muter. |
| listeners | ⚰️ | n'existe plus dans Vue 3 |
| parentComponent | ⚰️ |

### Wrapper API (mount)

| method | status | notes |
|----------------|--------|-------------------------------------------------------------------------------------------------------------------------------------|
| attributes ||
| classes ||
| exists ||
| find || seulement la syntaxe `querySelector` est supportée. `find(Comp)` discuté [ici](https://github.com/vuejs/vue-test-utils/issues/1498) |
| emitted ||
| findAll || voir ci-dessus. `.vm` est différent de celui de Vue 2. Nous étudions les options. |
| get ||
| html ||
| setValue || fonctionne avec les `select`, `checkbox`, `radio button`, `input`, `textarea`. Retourne `nextTick`. |
| text ||
| trigger || retourne `nextTick`. Vous pouvez écrire `await wrapper.find('button').trigger('click')` |
| setProps ||
| props ||
| setData ||
| destroy || renommé en `unmount` pour correspondre au cycle de vie Vue 3. |
| props ||
| isVisible ||
| contains | ⚰️ | utilisez `find` |
| emittedByOrder | ⚰️ | utilisez `emitted` |
| setSelected | ⚰️ | fait maintenant parti de `setValue` |
| setChecked | ⚰️ | fait maintenant parti de `setValue` |
| is | ⚰️ |
| isEmpty | ⚰️ | utilisez une fonction comme [celle-ci](https://github.com/testing-library/jest-dom#tobeempty) |
| isVueInstance | ⚰️ |
| name | ⚰️ |
| setMethods | ⚰️ |
Loading

0 comments on commit bf0ebd8

Please sign in to comment.