diff --git a/docs/en/api/shallow.md b/docs/en/api/shallow.md index fa16e9d24..8e4b20b30 100644 --- a/docs/en/api/shallow.md +++ b/docs/en/api/shallow.md @@ -1,35 +1,35 @@ -# shallow(component {, options}]) +# shallow(composant {, options}]) -- **Arguments:** +- **Paramètres :** - - `{Component} component` + - `{Component} component : un composant Vue` - `{Object} options` - - `{boolean} attachToDocument` + - `{boolean} attachToDocument : attacher au document` - `{Object} context` - `{Object} slots` - - `{Array|Component|String} default` - - `{Array|Component|String} named` - - `{Object} mocks` + - `{Array|Component|String} default : défaut` + - `{Array|Component|String} named : nommés` + - `{Object} mocks : imitations` - `{Object|Array} stubs` - `{boolean} clone` - - `{Object} children` - - `{Vue} localVue` + - `{Object} children : enfant` + - `{Vue} localVue : instance locale de Vue` -- **Returns:** `{Wrapper}` +- **Retourne :** `{Wrapper}` -- **Options:** +- **Options :** -See [options](./options.md) +Voir [options](./options.md) -- **Usage:** +- **Utilisation :** -Returns [`Wrapper`](./wrapper/README.md) of first DOM node or Vue component matching selector. +Retourne un [`Wrapper`](./wrapper/README.md) du premier nœud du DOM ou le composant Vue correspondant au sélecteur. -Stubs all child components. +Substitue tous les composants enfants. -Use any valid [selector](./selectors.md). +Utilise n'importe quel [sélecteur valide](./selectors.md) -**Without options:** +**Sans options :** ```js import { shallow } from 'vue-test-utils' @@ -37,14 +37,14 @@ import { expect } from 'chai' import Foo from './Foo.vue' describe('Foo', () => { - it('renders a div', () => { + it('rend une div', () => { const wrapper = shallow(Foo) expect(wrapper.contains('div')).toBe(true) }) }) ``` -**With Vue options:** +**Avec des options Vue :** ```js import { shallow } from 'vue-test-utils' @@ -52,7 +52,7 @@ import { expect } from 'chai' import Foo from './Foo.vue' describe('Foo', () => { - it('renders a div', () => { + it('rend une div', () => { const wrapper = shallow(Foo, { propsData: { color: 'red' @@ -63,7 +63,7 @@ describe('Foo', () => { }) ``` -**Attach to DOM:** +**Attacher au DOM :** ```js import { shallow } from 'vue-test-utils' @@ -71,7 +71,7 @@ import { expect } from 'chai' import Foo from './Foo.vue' describe('Foo', () => { - it('renders a div', () => { + it('rend une div', () => { const wrapper = shallow(Foo, { attachToDocument: true }) @@ -80,7 +80,7 @@ describe('Foo', () => { }) ``` -**Default and named slots:** +**Slots par défaut et nommés :** ```js import { shallow } from 'vue-test-utils' @@ -90,11 +90,11 @@ import Bar from './Bar.vue' import FooBar from './FooBar.vue' describe('Foo', () => { - it('renders a div', () => { + it('rend une div', () => { const wrapper = shallow(Foo, { slots: { default: [Bar, FooBar], - fooBar: FooBar, // Will match , + fooBar: FooBar, // Va correspondre à , foo: '
' } }) @@ -103,7 +103,7 @@ describe('Foo', () => { }) ``` -**Stubbing global properties:** +**Substituer des propriétés globales :** ```js import { shallow } from 'vue-test-utils' @@ -111,7 +111,7 @@ import { expect } from 'chai' import Foo from './Foo.vue' describe('Foo', () => { - it('renders a div', () => { + it('rend une div', () => { const $route = { path: 'http://www.example-path.com' } const wrapper = shallow(Foo, { mocks: {