Skip to content

Commit

Permalink
fix: fix failures
Browse files Browse the repository at this point in the history
  • Loading branch information
shortdiv committed Apr 26, 2018
1 parent 54f8ba0 commit 5b24600
Show file tree
Hide file tree
Showing 18 changed files with 38 additions and 63 deletions.
6 changes: 4 additions & 2 deletions docs/en/api/wrapper-array/setData.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ Sets `Wrapper` `vm` data and forces update on each `Wrapper` in `WrapperArray`.
**Note every `Wrapper` must contain a Vue instance.**

- **Arguments:**
- `{Object} data`
- `{Object} target`
- `{string} key`
- `{any} value`

- **Example:**

Expand All @@ -16,6 +18,6 @@ import Bar from './Bar.vue'

const wrapper = mount(Foo)
const barArray = wrapper.findAll(Bar)
barArray.setData({ foo: 'bar' })
barArray.setData(barArray.vm, 'foo', 'bar')
expect(barArray.at(0).vm.foo).toBe('bar')
```
2 changes: 1 addition & 1 deletion docs/en/api/wrapper/setData.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ import { mount } from '@vue/test-utils'
import Foo from './Foo.vue'

const wrapper = mount(Foo)
wrapper.setData(wrapper.vm.text, message, 'hello' })
wrapper.setData(wrapper.vm.text, message, 'hello')
expect(wrapper.vm.text.message).toBe('hello')
```
6 changes: 4 additions & 2 deletions docs/fr/api/wrapper-array/setData.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
**Note every `Wrapper` must contain a Vue instance.**

- **Arguments:**
- `{Object} data`
- `{Object} target`
- `{string} key`
- `{any} value`

- **Example:**

Expand All @@ -16,6 +18,6 @@ import Bar from './Bar.vue'

const wrapper = mount(Foo)
const barArray = wrapper.findAll(Bar)
barArray.setData({ foo: 'bar' })
barArray.setData(barArray.vm, 'foo', 'bar')
expect(barArray.at(0).vm.foo).toBe('bar')
```
2 changes: 1 addition & 1 deletion docs/fr/api/wrapper/setData.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ import { mount } from '@vue/test-utils'
import Foo from './Foo.vue'

const wrapper = mount(Foo)
wrapper.setData(wrapper.vm.text, message, 'hello' })
wrapper.setData(wrapper.vm.text, message, 'hello')
expect(wrapper.vm.text.message).toBe('hello')
```
6 changes: 4 additions & 2 deletions docs/ja/api/wrapper-array/setData.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
**すべての `Wrapper` は Vue インスタンスを含んでいなければならないことに注意してください。**

- **引数:**
- `{Object} data`
- `{Object} target`
- `{string} key`
- `{any} value`

- **例:**

Expand All @@ -16,6 +18,6 @@ import Bar from './Bar.vue'

const wrapper = mount(Foo)
const barArray = wrapper.findAll(Bar)
barArray.setData({ foo: 'bar' })
barArray.setData(barArray.vm, 'foo', 'bar')
expect(barArray.at(0).vm.foo).toBe('bar')
```
2 changes: 1 addition & 1 deletion docs/ja/api/wrapper/setData.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ import { mount } from '@vue/test-utils'
import Foo from './Foo.vue'

const wrapper = mount(Foo)
wrapper.setData(wrapper.vm.text, message, 'hello' })
wrapper.setData(wrapper.vm.text, message, 'hello')
expect(wrapper.vm.text.message).toBe('hello')
```
6 changes: 4 additions & 2 deletions docs/kr/api/wrapper-array/setData.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
**참고: Wrapper는 Vue 인스턴스를 반드시 가지고 있어야합니다.**

- **전달인자:**
- `{Object} data`
- `{Object} target`
- `{string} key`
- `{any} value`

- **예제:**

Expand All @@ -16,6 +18,6 @@ import Bar from './Bar.vue'

const wrapper = mount(Foo)
const barArray = wrapper.findAll(Bar)
barArray.setData({ foo: 'bar' })
barArray.setData(barArray.vm, 'foo', 'bar')
expect(barArray.at(0).vm.foo).toBe('bar')
```
2 changes: 1 addition & 1 deletion docs/kr/api/wrapper/setData.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ import { mount } from '@vue/test-utils'
import Foo from './Foo.vue'

const wrapper = mount(Foo)
wrapper.setData(wrapper.vm.text, message, 'hello' })
wrapper.setData(wrapper.vm.text, message, 'hello')
expect(wrapper.vm.text.message).toBe('hello')
```
6 changes: 4 additions & 2 deletions docs/pt-br/api/wrapper-array/setData.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ Define os dados e força a atualização de cada wrapper presente no Array.
**Nota: cada wrapper deve ser uma instância do Vue.**

- **Argumentos:**
- `{Object} data`
- `{Object} target`
- `{string} key`
- `{any} value`

- **Exemplho:**

Expand All @@ -17,6 +19,6 @@ import Bar from './Bar.vue'
const wrapper = mount(Foo)
const barArray = wrapper.findAll(Bar)

barArray.setData({ foo: 'bar' })
barArray.setData(barArray.vm, 'foo', 'bar')
expect(barArray.at(0).vm.foo).toBe('bar')
```
2 changes: 1 addition & 1 deletion docs/pt-br/api/wrapper/setData.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ import { mount } from '@vue/test-utils'
import Foo from './Foo.vue'

const wrapper = mount(Foo)
wrapper.setData(wrapper.vm.text, message, 'hello' })
wrapper.setData(wrapper.vm.text, message, 'hello')
expect(wrapper.vm.text.message).toBe('hello')
```
6 changes: 4 additions & 2 deletions docs/ru/api/wrapper-array/setData.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
**Обратите внимание, что каждый `Wrapper` должен содержать экземпляр Vue.**

- **Принимает:**
- `{Object} data`
- `{Object} target`
- `{string} key`
- `{any} value`

- **Пример:**

Expand All @@ -16,6 +18,6 @@ import Bar from './Bar.vue'

const wrapper = mount(Foo)
const barArray = wrapper.findAll(Bar)
barArray.setData({ foo: 'bar' })
barArray.setData(barArray.vm, 'foo', 'bar')
expect(barArray.at(0).vm.foo).toBe('bar')
```
2 changes: 1 addition & 1 deletion docs/ru/api/wrapper/setData.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ import { mount } from '@vue/test-utils'
import Foo from './Foo.vue'

const wrapper = mount(Foo)
wrapper.setData(wrapper.vm.text, message, 'hello' })
wrapper.setData(wrapper.vm.text, message, 'hello')
expect(wrapper.vm.text.message).toBe('hello')
```
6 changes: 4 additions & 2 deletions docs/zh-cn/api/wrapper-array/setData.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
**注意:该包裹器必须包含一个 Vue 示例。**

- **参数:**
- `{Object} data`
- `{Object} target`
- `{string} key`
- `{any} value`

- **示例:**

Expand All @@ -16,6 +18,6 @@ import Bar from './Bar.vue'

const wrapper = mount(Foo)
const barArray = wrapper.findAll(Bar)
barArray.setData({ foo: 'bar' })
barArray.setData(barArray.vm, 'foo', 'bar')
expect(barArray.at(0).vm.foo).toBe('bar')
```
2 changes: 1 addition & 1 deletion docs/zh-cn/api/wrapper/setData.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ import { mount } from '@vue/test-utils'
import Foo from './Foo.vue'

const wrapper = mount(Foo)
wrapper.setData(wrapper.vm.text, message, 'hello' })
wrapper.setData(wrapper.vm.text, message, 'hello')
expect(wrapper.vm.text.message).toBe('hello')
```
2 changes: 1 addition & 1 deletion packages/test-utils/src/wrapper-array.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export default class WrapperArray implements BaseWrapper {
this.wrappers.forEach(wrapper => wrapper.setComputed(computed))
}

setData (obj: Object, key, value): void {
setData (obj: Object, key: string, value: string): void {
this.throwErrorIfWrappersIsEmpty('setData')

this.wrappers.forEach(wrapper => wrapper.setData(obj, key, value))
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/src/wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ export default class Wrapper implements BaseWrapper {
/**
* Sets vm data object while preserving existing k/v
*/
setData (obj: string, key: string, value: any) {
setData (obj: Object, key: string, value: any) {
if (this.isFunctionalComponent) {
throwError('wrapper.setData() cannot be called on a functional component')
}
Expand Down
2 changes: 1 addition & 1 deletion test/specs/wrapper/setData.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describeWithShallowAndMount('setData', (mountingMethod) => {
it('runs watch function after all props are updated', () => {
const wrapper = mountingMethod(ComponentWithWatch)
const data1 = 'testest'
wrapper.setData(wrapper.vm, 'data2','newProp')
wrapper.setData(wrapper.vm, 'data2', 'newProp')
wrapper.setData(wrapper.vm, 'data1', data1)
expect(info.args[1][0]).to.equal(data1)
})
Expand Down
39 changes: 0 additions & 39 deletions test/specs/wrapper/setDataObj.spec.js

This file was deleted.

0 comments on commit 5b24600

Please sign in to comment.