diff --git a/pages/component/button/button.test.js b/pages/component/button/button.test.js
index 98ccf957d9d9707eef72756d64a9746d3bd22cc8..222df019630e5c58ad4909ef11ca2f21c1aaaa21 100644
--- a/pages/component/button/button.test.js
+++ b/pages/component/button/button.test.js
@@ -22,8 +22,8 @@ describe('Button.uvue', () => {
expect(await getData('count')).toEqual(1)
})
it('length', async () => {
- const btnLen = await page.$$('.button')
- expect(btnLen.length).toBe(13)
+ const elements = await page.$$('.button')
+ expect(elements.length).toBe(13)
})
it('text', async () => {
const textBtn = await page.$('.text-button')
diff --git a/pages/component/checkbox/checkbox.test.js b/pages/component/checkbox/checkbox.test.js
index 39ebb22b5a498c5a7eeadb6582065fea9f2c90ea..211dc6b8b52ff004cf67af12b1257a887f0e50ae 100644
--- a/pages/component/checkbox/checkbox.test.js
+++ b/pages/component/checkbox/checkbox.test.js
@@ -22,7 +22,9 @@ describe('Checkbox.uvue', () => {
await cb.tap()
expect(await getData('value')).toEqual(["cb1"])
await cb2.tap()
- expect(await getData('value')).toEqual(["cb1"])
+ expect(await getData('value')).toEqual(["cb1"])
+ await cb1.tap()
+ expect(await getData('value')).toEqual([])
})
it('length', async () => {
const checkboxGroupElements = await page.$$('.checkbox-group')
@@ -31,12 +33,12 @@ describe('Checkbox.uvue', () => {
expect(checkboxElements.length).toBe(11)
})
it('text', async () => {
- const cb = await page.$('.cb')
- expect(await cb.text()).toEqual('选中')
+ const cb = await page.$('.cb1')
+ expect(await cb.text()).toEqual('未选中')
await page.setData({
- text: 'checked'
+ text: 'not selected'
})
- expect(await cb.text()).toEqual('checked')
+ expect(await cb.text()).toEqual('not selected')
})
it('checked', async () => {
const cb = await page.$('.cb')
diff --git a/pages/component/checkbox/checkbox.uvue b/pages/component/checkbox/checkbox.uvue
index fab82ad2caa05745dd389fad775a0be67fb134e3..46d915c3d3a235cf9fb70c1626d7f8f85b456fc5 100644
--- a/pages/component/checkbox/checkbox.uvue
+++ b/pages/component/checkbox/checkbox.uvue
@@ -10,8 +10,8 @@
{{text}}
- 未选中
+ class="checkbox cb">选中
+ {{text}}
禁用
@@ -93,7 +93,7 @@
}
] as ItemType[],
- text: '选中',
+ text: '未选中',
value: [] as string[],
disabled: true,
checked: true,
diff --git a/pages/component/radio/radio.test.js b/pages/component/radio/radio.test.js
index 5a3c3b8fdaab78a07e55f14ff4771991d7e0998f..c9e3602d1760ca6aeb4564e25cb61c49632c06dd 100644
--- a/pages/component/radio/radio.test.js
+++ b/pages/component/radio/radio.test.js
@@ -31,12 +31,12 @@ describe('Radio.uvue', () => {
expect(radioElements.length).toBe(11)
})
it('text', async () => {
- const radio = await page.$('.r')
- expect(await radio.text()).toEqual('选中')
+ const radio = await page.$('.r1')
+ expect(await radio.text()).toEqual('未选中')
await page.setData({
- text: 'checked'
+ text: 'not selected'
})
- expect(await radio.text()).toEqual('checked')
+ expect(await radio.text()).toEqual('not selected')
})
it('checked', async () => {
const radio = await page.$('.r')
diff --git a/pages/component/radio/radio.uvue b/pages/component/radio/radio.uvue
index 69764f85e1e2cc650479a3758a2a016a29229a68..0e8db2a7ddfe87b68496e45f6d1e6e67f1183c31 100644
--- a/pages/component/radio/radio.uvue
+++ b/pages/component/radio/radio.uvue
@@ -8,9 +8,9 @@
- {{text}}
+ 选中
- 未选中
+ {{text}}
禁用
@@ -82,7 +82,7 @@
current: 0,
value: '',
- text: '选中',
+ text: '未选中',
disabled: true,
checked: true,
color: '#007aff'