Skip to content

Commit ab6ef34

Browse files
xuhongbokazupon
authored andcommitted
docs(zh):Restore the test case name to English (#1179)
1 parent f4ea3fd commit ab6ef34

6 files changed

+24
-24
lines changed

docs/zh/api/shallowMount.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { shallowMount } from '@vue/test-utils'
3131
import Foo from './Foo.vue'
3232

3333
describe('Foo', () => {
34-
it('返回一个 div', () => {
34+
it('renders a div', () => {
3535
const wrapper = shallowMount(Foo)
3636
expect(wrapper.contains('div')).toBe(true)
3737
})
@@ -45,7 +45,7 @@ import { shallowMount } from '@vue/test-utils'
4545
import Foo from './Foo.vue'
4646

4747
describe('Foo', () => {
48-
it('渲染一个 div', () => {
48+
it('renders a div', () => {
4949
const wrapper = shallowMount(Foo, {
5050
propsData: {
5151
color: 'red'
@@ -63,7 +63,7 @@ import { shallowMount } from '@vue/test-utils'
6363
import Foo from './Foo.vue'
6464

6565
describe('Foo', () => {
66-
it('渲染一个 div', () => {
66+
it('renders a div', () => {
6767
const wrapper = shallowMount(Foo, {
6868
attachToDocument: true
6969
})

docs/zh/guides/dom-events.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ import YesNoComponent from '@/components/YesNoComponent'
7171
import { mount } from '@vue/test-utils'
7272
import sinon from 'sinon'
7373

74-
describe('点击事件', () => {
75-
it('yes 按钮上点击会调用我们的方法并附带参数 "yes"', () => {
74+
describe('Click event', () => {
75+
it('Click on yes button calls our method with argument "yes"', () => {
7676
const spy = sinon.spy()
7777
const wrapper = mount(YesNoComponent, {
7878
propsData: {
@@ -150,33 +150,33 @@ describe('点击事件', () => {
150150
import QuantityComponent from '@/components/QuantityComponent'
151151
import { mount } from '@vue/test-utils'
152152

153-
describe('键盘事件测试', () => {
154-
it('默认的数量是零', () => {
153+
describe('Key event tests', () => {
154+
it('Quantity is zero by default', () => {
155155
const wrapper = mount(QuantityComponent)
156156
expect(wrapper.vm.quantity).toBe(0)
157157
})
158158

159-
it('上按键将数量加 1', () => {
159+
it('Up arrow key increments quantity by 1', () => {
160160
const wrapper = mount(QuantityComponent)
161161
wrapper.trigger('keydown.up')
162162
expect(wrapper.vm.quantity).toBe(1)
163163
})
164164

165-
it('下按键将数量减 1', () => {
165+
it('Down arrow key decrements quantity by 1', () => {
166166
const wrapper = mount(QuantityComponent)
167167
wrapper.vm.quantity = 5
168168
wrapper.trigger('keydown.down')
169169
expect(wrapper.vm.quantity).toBe(4)
170170
})
171171

172-
it('ESC 键将数量设置为 0', () => {
172+
it('Escape sets quantity to 0', () => {
173173
const wrapper = mount(QuantityComponent)
174174
wrapper.vm.quantity = 5
175175
wrapper.trigger('keydown.esc')
176176
expect(wrapper.vm.quantity).toBe(0)
177177
})
178178

179-
it('魔术字符 "a" 键将数量设置为 13', () => {
179+
it('Magic character "a" sets quantity to 13', () => {
180180
const wrapper = mount(QuantityComponent)
181181
wrapper.trigger('keydown', {
182182
key: 'a'

docs/zh/guides/getting-started.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,16 @@ console.log(wrapper)
7272
import { mount } from '@vue/test-utils'
7373
import Counter from './counter'
7474

75-
describe('计数器', () => {
75+
describe('Counter', () => {
7676
// 现在挂载组件,你便得到了这个包裹器
7777
const wrapper = mount(Counter)
7878

79-
it('渲染正确的标记', () => {
79+
it('renders the correct markup', () => {
8080
expect(wrapper.html()).toContain('<span class="count">0</span>')
8181
})
8282

8383
// 也便于检查已存在的元素
84-
it('是一个按钮', () => {
84+
it('has a button', () => {
8585
expect(wrapper.contains('button')).toBe(true)
8686
})
8787
})
@@ -94,7 +94,7 @@ describe('计数器', () => {
9494
当用户点击按钮的时候,我们的计数器应该递增。为了模拟这一行为,我们首先需要通过 `wrapper.find()` 定位该按钮,此方法返回一个**该按钮元素的包裹器**。然后我们能够通过对该按钮包裹器调用 `.trigger()` 来模拟点击。
9595

9696
```js
97-
it('点击按钮应该使得计数递增', () => {
97+
it('button click should increment the count', () => {
9898
expect(wrapper.vm.count).toBe(0)
9999
const button = wrapper.find('button')
100100
button.trigger('click')

docs/zh/guides/testing-single-file-components-with-jest.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ import { mount } from '@vue/test-utils'
162162
import Component from './component'
163163

164164
describe('Component', () => {
165-
test('是一个 Vue 实例', () => {
165+
test('is a Vue instance', () => {
166166
const wrapper = mount(Component)
167167
expect(wrapper.isVueInstance()).toBeTruthy()
168168
})

docs/zh/guides/testing-single-file-components-with-mocha-webpack.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ import { shallowMount } from '@vue/test-utils'
154154
import Counter from '../src/Counter.vue'
155155

156156
describe('Counter.vue', () => {
157-
it('计数器在点击按钮时自增', () => {
157+
it('increments count when button is clicked', () => {
158158
const wrapper = shallowMount(Counter)
159159
wrapper.find('button').trigger('click')
160160
expect(wrapper.find('div').text()).toMatch('1')

docs/zh/guides/using-with-vuex.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -67,23 +67,23 @@ describe('Actions.vue', () => {
6767
})
6868
})
6969

70-
it('当事件的值是“input”时会 dispatch“actionInput', () => {
70+
it('dispatches "actionInput" when input event value is "input"', () => {
7171
const wrapper = shallowMount(Actions, { store, localVue })
7272
const input = wrapper.find('input')
7373
input.element.value = 'input'
7474
input.trigger('input')
7575
expect(actions.actionInput).toHaveBeenCalled()
7676
})
7777

78-
it('当事件的值不是“input”时不会 dispatch actionInput', () => {
78+
it('does not dispatch "actionInput" when event value is not "input"', () => {
7979
const wrapper = shallowMount(Actions, { store, localVue })
8080
const input = wrapper.find('input')
8181
input.element.value = 'not input'
8282
input.trigger('input')
8383
expect(actions.actionInput).not.toHaveBeenCalled()
8484
})
8585

86-
it('当按钮被点击时候调用“actionClick”的 action', () => {
86+
it('calls store action "actionClick" when button is clicked', () => {
8787
const wrapper = shallowMount(Actions, { store, localVue })
8888
wrapper.find('button').trigger('click')
8989
expect(actions.actionClick).toHaveBeenCalled()
@@ -154,13 +154,13 @@ describe('Getters.vue', () => {
154154
})
155155
})
156156

157-
it('在第一个 p 标签中渲染“store.state.inputValue', () => {
157+
it('Renders "store.getters.inputValue" in first p tag', () => {
158158
const wrapper = shallowMount(Getters, { store, localVue })
159159
const p = wrapper.find('p')
160160
expect(p.text()).toBe(getters.inputValue())
161161
})
162162

163-
it('在第二个 p 标签中渲染“store.state.clicks', () => {
163+
it('Renders "store.getters.clicks" in second p tag', () => {
164164
const wrapper = shallowMount(Getters, { store, localVue })
165165
const p = wrapper.findAll('p').at(1)
166166
expect(p.text()).toBe(getters.clicks().toString())
@@ -238,14 +238,14 @@ describe('MyComponent.vue', () => {
238238
})
239239
})
240240

241-
it('在点击按钮时调用 actionmoduleActionClick', () => {
241+
it('calls store action "moduleActionClick" when button is clicked', () => {
242242
const wrapper = shallowMount(MyComponent, { store, localVue })
243243
const button = wrapper.find('button')
244244
button.trigger('click')
245245
expect(actions.moduleActionClick).toHaveBeenCalled()
246246
})
247247

248-
it('在第一个 p 标签内渲染“state.clicks', () => {
248+
it('renders "state.clicks" in first p tag', () => {
249249
const wrapper = shallowMount(MyComponent, { store, localVue })
250250
const p = wrapper.find('p')
251251
expect(p.text()).toBe(state.clicks.toString())

0 commit comments

Comments
 (0)