提交 85446a1d 编写于 作者: 辛宝Otto's avatar 辛宝Otto 🥊

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

上级 5c0d2a34
......@@ -73,7 +73,8 @@ describe('Radio.uvue', () => {
it('trigger UniRadioGroupChangeEvent', async () => {
const element = await page.$('#trigger-change')
await element.tap()
await page.waitFor(500)
console.log('radio trigger change event', element)
await page.waitFor(1000)
const eventCallbackNum = await page.callMethod('getEventCallbackNum')
expect(eventCallbackNum - originEventCallbackNum).toBe(3)
})
......
......@@ -53,6 +53,7 @@
iconColor_input: "#ffffff"
}
},
methods: {
radioChange(e : UniRadioGroupChangeEvent) {
const selected = this.items.find((item) : boolean => {
......@@ -73,7 +74,8 @@
},
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.
先完成此消息的编辑!
想要评论请 注册