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

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

上级 bab8a01b
......@@ -73,6 +73,8 @@ describe('Radio.uvue', () => {
it('trigger UniRadioGroupChangeEvent', async () => {
const element = await page.$('#trigger-change')
await element.tap()
console.log('radio trigger change event', element)
await page.waitFor(1000)
const eventCallbackNum = await page.callMethod('getEventCallbackNum')
expect(eventCallbackNum - originEventCallbackNum).toBe(3)
})
......
......@@ -52,7 +52,8 @@
activeBorderColor_input: "",
iconColor_input: "#ffffff"
}
},
},
methods: {
radioChange(e : UniRadioGroupChangeEvent) {
const selected = this.items.find((item) : boolean => {
......@@ -72,8 +73,9 @@
setEventCallbackNum(num)
},
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)
}
if (e.type === 'change') {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册