diff --git a/pages/component/radio/radio.test.js b/pages/component/radio/radio.test.js index 276091b0dc6dd64b27c158dba172a068ee559df2..494cdbc64416cbee3ece5dc886cf27e3c4b37288 100644 --- a/pages/component/radio/radio.test.js +++ b/pages/component/radio/radio.test.js @@ -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) }) diff --git a/pages/component/radio/radio.uvue b/pages/component/radio/radio.uvue index abbb73bd1192bcee309dcac9180b9115825ef509..2d04b7d66357eb2f5bacb22352d231da52656774 100644 --- a/pages/component/radio/radio.uvue +++ b/pages/component/radio/radio.uvue @@ -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') {