提交 8f098f28 编写于 作者: 辛宝Otto's avatar 辛宝Otto 🥊

test: radio 组件补充相关 log 信息

上级 bab8a01b
...@@ -73,6 +73,8 @@ describe('Radio.uvue', () => { ...@@ -73,6 +73,8 @@ describe('Radio.uvue', () => {
it('trigger UniRadioGroupChangeEvent', async () => { it('trigger UniRadioGroupChangeEvent', async () => {
const element = await page.$('#trigger-change') const element = await page.$('#trigger-change')
await element.tap() await element.tap()
console.log('radio trigger change event', element)
await page.waitFor(1000)
const eventCallbackNum = await page.callMethod('getEventCallbackNum') const eventCallbackNum = await page.callMethod('getEventCallbackNum')
expect(eventCallbackNum - originEventCallbackNum).toBe(3) expect(eventCallbackNum - originEventCallbackNum).toBe(3)
}) })
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
iconColor_input: "#ffffff" iconColor_input: "#ffffff"
} }
}, },
methods: { methods: {
radioChange(e : UniRadioGroupChangeEvent) { radioChange(e : UniRadioGroupChangeEvent) {
const selected = this.items.find((item) : boolean => { const selected = this.items.find((item) : boolean => {
...@@ -73,7 +74,8 @@ ...@@ -73,7 +74,8 @@
}, },
testChange(e : UniRadioGroupChangeEvent) { testChange(e : UniRadioGroupChangeEvent) {
// 自动化测试 // 自动化测试
if ((e.target?.tagName ?? '').includes('RADIO-GROUP')) { console.log('test: radio event detail', e.target?.tagName, e.type)
if ((e.target?.tagName ?? '') == 'RADIO-GROUP') {
this.setEventCallbackNum(state.eventCallbackNum + 1) this.setEventCallbackNum(state.eventCallbackNum + 1)
} }
if (e.type === 'change') { if (e.type === 'change') {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册