Skip to content

Commit a96eb32

Browse files
antoinezanardiAntoine ZANARDI
and
Antoine ZANARDI
authored
docs(fr): french documentation and README.md (#1975)
* docs(fr): french language added to docs * docs(fr): french language added to docs --------- Co-authored-by: Antoine ZANARDI <[email protected]>
1 parent 3d57be7 commit a96eb32

32 files changed

+6529
-62
lines changed

README.md

+40-36
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Component testing utils for Vue 3.
44

5+
## Languages
6+
7+
[🇫🇷 French version of this README.md](https://github.com/vuejs/test-utils/tree/main/docs/fr/README.md)
8+
59
## Installation and Usage
610

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

3236
### Mounting Options
3337

34-
| option | status | notes |
35-
| ---------------- | ------ | ----------------------------------------------------------------------------------- |
36-
| data ||
37-
| slots ||
38-
| mocks || nested in `global` |
39-
| propsData || now called `props` |
40-
| provide || nested in `global` |
41-
| mixins || (new!) nested in `global` |
42-
| plugins || (new!) nested in `global` |
43-
| component || (new!) nested in `global` |
44-
| directives || (new!) nested in `global` |
45-
| stubs ||
46-
| attachToDocument || renamed `attachTo`. See [here](https://github.com/vuejs/vue-test-utils/pull/1492) |
47-
| attrs ||
48-
| scopedSlots | ⚰️ | scopedSlots are merged with `slots` in Vue 3 |
49-
| context | ⚰️ | different from Vue 2, does not make sense anymore. |
50-
| localVue | ⚰️ | no longer required - Vue 3 there is no global Vue instance to mutate. |
51-
| listeners | ⚰️ | no longer exists in Vue 3 |
38+
| option | status | notes |
39+
|------------------|--------|-----------------------------------------------------------------------------------|
40+
| data | |
41+
| slots | |
42+
| mocks | | nested in `global` |
43+
| propsData | | now called `props` |
44+
| provide | | nested in `global` |
45+
| mixins | | (new!) nested in `global` |
46+
| plugins | | (new!) nested in `global` |
47+
| component | | (new!) nested in `global` |
48+
| directives | | (new!) nested in `global` |
49+
| stubs | |
50+
| attachToDocument | | renamed `attachTo`. See [here](https://github.com/vuejs/vue-test-utils/pull/1492) |
51+
| attrs | |
52+
| scopedSlots | ⚰️ | scopedSlots are merged with `slots` in Vue 3 |
53+
| context | ⚰️ | different from Vue 2, does not make sense anymore. |
54+
| localVue | ⚰️ | no longer required - Vue 3 there is no global Vue instance to mutate. |
55+
| listeners | ⚰️ | no longer exists in Vue 3 |
5256
| parentComponent | ⚰️ |
5357

5458
### Wrapper API (mount)
5559

5660
| method | status | notes |
57-
| -------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------- |
58-
| attributes ||
59-
| classes ||
60-
| exists ||
61-
| find || only `querySelector` syntax is supported. `find(Comp)` under discussion [here](https://github.com/vuejs/vue-test-utils/issues/1498) |
62-
| emitted ||
63-
| findAll || see above. `.vm` is different to Vue 2. We are exploring options. |
64-
| get ||
65-
| html ||
66-
| setValue || works for select, checkbox, radio button, input, textarea. Returns `nextTick`. |
67-
| text ||
68-
| trigger || returns `nextTick`. You can do `await wrapper.find('button').trigger('click')` |
69-
| setProps ||
70-
| props ||
71-
| setData ||
72-
| destroy || renamed to `unmount` to match Vue 3 lifecycle hook name. |
73-
| props ||
74-
| isVisible ||
61+
|----------------|--------|-------------------------------------------------------------------------------------------------------------------------------------|
62+
| attributes | |
63+
| classes | |
64+
| exists | |
65+
| find | | only `querySelector` syntax is supported. `find(Comp)` under discussion [here](https://github.com/vuejs/vue-test-utils/issues/1498) |
66+
| emitted | |
67+
| findAll | | see above. `.vm` is different to Vue 2. We are exploring options. |
68+
| get | |
69+
| html | |
70+
| setValue | | works for select, checkbox, radio button, input, textarea. Returns `nextTick`. |
71+
| text | |
72+
| trigger | | returns `nextTick`. You can do `await wrapper.find('button').trigger('click')` |
73+
| setProps | |
74+
| props | |
75+
| setData | |
76+
| destroy | | renamed to `unmount` to match Vue 3 lifecycle hook name. |
77+
| props | |
78+
| isVisible | |
7579
| contains | ⚰️ | use `find` |
7680
| emittedByOrder | ⚰️ | use `emitted` |
7781
| setSelected | ⚰️ | now part of `setValue` |

docs/.vitepress/config.ts

+109-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,122 @@
1-
import { defineConfig } from 'vitepress'
2-
import packageJSON from '../../package.json'
1+
import { defineConfig } from 'vitepress';
2+
import { frLocaleConfig } from "../fr/.vitepress/locale-config";
33

44
export default defineConfig({
55
title: `Vue Test Utils`,
66
description: 'The documentation for the official Vue Test Utils',
77
locales: {
8-
'/': {
8+
"/": {
9+
label: "English",
910
lang: 'en-US',
1011
title: `Vue Test Utils`
11-
}
12+
},
13+
"/fr/": {
14+
label: "Français",
15+
title: "Vue Test Utils",
16+
lang: "fr-FR",
17+
description: "La documentation officielle de Vue Test Utils",
18+
},
1219
},
1320
head: [['link', { rel: 'icon', href: `/logo.png` }]],
1421
themeConfig: {
22+
locales: {
23+
"/": {
24+
label: 'English',
25+
selectText: 'Languages',
26+
nav: [
27+
{ text: 'Guide', link: '/guide/' },
28+
{ text: 'API Reference', link: '/api/' },
29+
{ text: 'Migrating from Vue 2', link: '/migration/' },
30+
{
31+
text: 'Changelog',
32+
link: 'https://github.com/vuejs/test-utils/releases'
33+
}
34+
],
35+
sidebar: [
36+
{
37+
text: 'Installation',
38+
link: '/installation/'
39+
},
40+
{
41+
text: 'Essentials',
42+
collapsable: false,
43+
children: [
44+
{ text: 'Getting Started', link: '/guide/' },
45+
{ text: 'A Crash Course', link: '/guide/essentials/a-crash-course' },
46+
{
47+
text: 'Conditional Rendering',
48+
link: '/guide/essentials/conditional-rendering'
49+
},
50+
{
51+
text: 'Testing Emitted Events',
52+
link: '/guide/essentials/event-handling'
53+
},
54+
{ text: 'Testing Forms', link: '/guide/essentials/forms' },
55+
{
56+
text: 'Passing Data to Components',
57+
link: '/guide/essentials/passing-data'
58+
},
59+
{
60+
text: 'Write components that are easy to test',
61+
link: '/guide/essentials/easy-to-test'
62+
}
63+
]
64+
},
65+
{
66+
text: 'Vue Test Utils in depth',
67+
collapsable: false,
68+
children: [
69+
{ text: 'Slots', link: '/guide/advanced/slots' },
70+
{
71+
text: 'Asynchronous Behavior',
72+
link: '/guide/advanced/async-suspense'
73+
},
74+
{
75+
text: 'Making HTTP Requests',
76+
link: '/guide/advanced/http-requests'
77+
},
78+
{ text: 'Transitions', link: '/guide/advanced/transitions' },
79+
{
80+
text: 'Component Instance',
81+
link: '/guide/advanced/component-instance'
82+
},
83+
{
84+
text: 'Reusability and Composition',
85+
link: '/guide/advanced/reusability-composition'
86+
},
87+
{ text: 'Testing v-model', link: '/guide/advanced/v-model' },
88+
{ text: 'Testing Vuex', link: '/guide/advanced/vuex' },
89+
{ text: 'Testing Vue Router', link: '/guide/advanced/vue-router' },
90+
{ text: 'Testing Teleport', link: '/guide/advanced/teleport' },
91+
{
92+
text: 'Stubs and Shallow Mount',
93+
link: '/guide/advanced/stubs-shallow-mount'
94+
}
95+
]
96+
},
97+
{
98+
text: 'Extending Vue Test Utils',
99+
collapsable: false,
100+
children: [
101+
{ text: 'Plugins', link: '/guide/extending-vtu/plugins' },
102+
{
103+
text: 'Community and Learning',
104+
link: '/guide/extending-vtu/community-learning'
105+
}
106+
]
107+
},
108+
{
109+
text: 'Migrating from Vue 2',
110+
link: '/migration/'
111+
},
112+
{
113+
text: 'API Reference',
114+
link: '/api/'
115+
}
116+
]
117+
},
118+
"/fr/": frLocaleConfig,
119+
},
15120
repo: 'vuejs/test-utils',
16121
docsRepo: 'vuejs/test-utils',
17122
docsDir: 'docs',

docs/api/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ test('mounts a component', () => {
4444

4545
Notice that `mount` accepts a second parameter to define the component's state configuration.
4646

47-
**Example: mounting with component props and a Vue App plugin**
47+
**Exemple : mounting with component props and a Vue App plugin**
4848

4949
```js
5050
const wrapper = mount(Component, {
@@ -1947,7 +1947,7 @@ type GlobalMountOptions = {
19471947
19481948
Instead of configuring mounting options on a per test basis, you can configure them for your entire test suite. These will be used by default every time you `mount` a component. If desired, you can then override your defaults on a per test basis.
19491949
1950-
**Example:**
1950+
**Exemple :**
19511951
19521952
An example might be globally mocking the `$t` variable from vue-i18n and a component:
19531953

docs/fr/.vitepress/locale-config.ts

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
import { DefaultTheme } from "vitepress";
2+
3+
const frLocaleConfig: DefaultTheme.LocaleConfig & Omit<DefaultTheme.Config, "locales"> = {
4+
label: 'Français',
5+
selectText: 'Langues',
6+
nav: [
7+
{ text: 'Guide', link: '/fr/guide/' },
8+
{ text: 'API', link: '/fr/api/' },
9+
{ text: 'Migrer depuis Vue 2', link: '/fr/migration/' },
10+
{
11+
text: 'Journal de modifications',
12+
link: 'https://github.com/vuejs/test-utils/releases'
13+
}
14+
],
15+
sidebar: [
16+
{
17+
text: 'Installation',
18+
link: '/fr/installation/'
19+
},
20+
{
21+
text: 'Les Bases',
22+
collapsable: false,
23+
children: [
24+
{ text: 'Pour commencer', link: '/fr/guide/' },
25+
{ text: 'Cours rapide', link: '/fr/guide/essentials/a-crash-course' },
26+
{
27+
text: 'Rendu conditionnel',
28+
link: '/fr/guide/essentials/conditional-rendering'
29+
},
30+
{
31+
text: 'Tester les évènements émis',
32+
link: '/fr/guide/essentials/event-handling'
33+
},
34+
{ text: 'Tester les formulaires', link: '/fr/guide/essentials/forms' },
35+
{
36+
text: 'Passer des données aux Composants',
37+
link: '/fr/guide/essentials/passing-data'
38+
},
39+
{
40+
text: 'Écrire des composants facile à tester',
41+
link: '/fr/guide/essentials/easy-to-test'
42+
}
43+
]
44+
},
45+
{
46+
text: 'Vue Test Utils en détail',
47+
collapsable: false,
48+
children: [
49+
{ text: 'Slots', link: '/fr/guide/advanced/slots' },
50+
{
51+
text: 'Comportement asynchrone',
52+
link: '/fr/guide/advanced/async-suspense'
53+
},
54+
{
55+
text: 'Faire des requêtes HTTP',
56+
link: '/fr/guide/advanced/http-requests'
57+
},
58+
{ text: 'Transitions', link: '/fr/guide/advanced/transitions' },
59+
{
60+
text: 'Instance de Composant',
61+
link: '/fr/guide/advanced/component-instance'
62+
},
63+
{
64+
text: 'Réutilisabilité et Composition',
65+
link: '/fr/guide/advanced/reusability-composition'
66+
},
67+
{ text: 'Tester v-model', link: '/fr/guide/advanced/v-model' },
68+
{ text: 'Tester Vuex', link: '/fr/guide/advanced/vuex' },
69+
{ text: 'Tester Vue Router', link: '/fr/guide/advanced/vue-router' },
70+
{ text: 'Tester Teleport', link: '/fr/guide/advanced/teleport' },
71+
{
72+
text: 'Composants de Substitution (Stubs) et Montage Partiel',
73+
link: '/fr/guide/advanced/stubs-shallow-mount'
74+
},
75+
{ text: 'Tester le Rendu côté Serveur (SSR)', link: '/fr/guide/advanced/ssr' }
76+
]
77+
},
78+
{
79+
text: 'Extensions de Vue Test Utils',
80+
collapsable: false,
81+
children: [
82+
{ text: 'Plugins', link: '/fr/guide/extending-vtu/plugins' },
83+
{
84+
text: 'Communauté et Apprentissage',
85+
link: '/fr/guide/extending-vtu/community-learning'
86+
}
87+
]
88+
},
89+
{
90+
text: 'Migrer depuis Vue 2',
91+
link: '/fr/migration/'
92+
},
93+
{
94+
text: 'API',
95+
link: '/fr/api/'
96+
}
97+
]
98+
};
99+
100+
export { frLocaleConfig };

0 commit comments

Comments
 (0)