diff --git a/pages/component/checkbox/checkbox.test.js b/pages/component/checkbox/checkbox.test.js index 6a4ff4015465ff862af7bec09fff8ae63713f562..20083b7de142abe92a6d5a8a15c41aceb68b549a 100644 --- a/pages/component/checkbox/checkbox.test.js +++ b/pages/component/checkbox/checkbox.test.js @@ -67,6 +67,23 @@ describe('Checkbox.uvue', () => { }) expect(await cb.attribute('color')).toBe('#63acfc') }) + + it('icon color', async () => { + const cb = await page.$('.cb') + expect(await cb.attribute('iconColor')).toBe('#211cfe') + await page.setData({ + iconColor: '#63acfc', + }) + expect(await cb.attribute('iconColor')).toBe('#63acfc') + }) + it('foreColor', async () => { + const cb = await page.$('.cb') + expect(await cb.attribute('foreColor')).toBe('#ff0000') + await page.setData({ + foreColor: '#63acfe', + }) + expect(await cb.attribute('foreColor')).toBe('#63acfe') + }) it('disabled', async () => { const cb = await page.$('.cb2') expect(await cb.attribute('disabled')).toBe(true + '') @@ -78,7 +95,7 @@ describe('Checkbox.uvue', () => { it('trigger UniCheckboxGroupChangeEvent', async () => { const element = await page.$('.checkbox-item-0') await element.tap() - await page.waitFor(500) + await page.waitFor(1000) const eventCallbackNum = await page.callMethod('getEventCallbackNum') expect(eventCallbackNum - originEventCallbackNum).toBe(3) }) diff --git a/pages/component/checkbox/checkbox.uvue b/pages/component/checkbox/checkbox.uvue index c409c87f76786978a5d92b144d17379de29b4b1d..bae7e76ab61c6cb57bce6ebac4a639946d21ef32 100644 --- a/pages/component/checkbox/checkbox.uvue +++ b/pages/component/checkbox/checkbox.uvue @@ -46,7 +46,9 @@ value: [] as string[], disabled: true, checked: true, - color: '#007aff', + color: '#007aff', + iconColor:'#211cfe', + foreColor:'#ff0000', // 组件属性 autotest checked_boolean: false, disabled_boolean: false, @@ -55,7 +57,8 @@ borderColor_input: "#d1d1d1", activeBackgroundColor_input: "#ffffff", activeBorderColor_input: "#d1d1d1", - iconColor_input: "#007aff" + iconColor_input: "#007aff", + foreColor_input: '#ff0000' } }, methods: { @@ -70,7 +73,7 @@ }, checkboxChange: function (e : UniCheckboxGroupChangeEvent) { // 自动化测试 - if ((e.target?.tagName ?? '').includes('CHECKBOX-GROUP')) { + if ((e.target?.tagName ?? '') == 'CHECKBOX-GROUP') { this.setEventCallbackNum(state.eventCallbackNum + 1) } if (e.type === 'change') { @@ -105,19 +108,20 @@ confirm_borderColor_input(value : string) { this.borderColor_input = value }, confirm_activeBackgroundColor_input(value : string) { this.activeBackgroundColor_input = value }, confirm_activeBorderColor_input(value : string) { this.activeBorderColor_input = value }, - confirm_iconColor_input(value : string) { this.iconColor_input = value } + confirm_iconColor_input(value : string) { this.iconColor_input = value }, + confirm_foreColor_input(value : string) { this.foreColor_input = value } } }