diff --git a/pages/component/rich-text/rich-text.test.js b/pages/component/rich-text/rich-text.test.js index a68cb59814cf807ef69ae4ffa139e637528822c1..14b0f7d0e34c92d898e56b07f78b59cf89de7599 100644 --- a/pages/component/rich-text/rich-text.test.js +++ b/pages/component/rich-text/rich-text.test.js @@ -55,4 +55,12 @@ describe('rich-text-test', () => { }); }); + it('rich-text parent click', async () => { + const element = await page.$('#rich-text-parent') + await element.tap() + await page.waitFor(500) + const element2 = await page.$('#rich-text-str') + expect(await element2.text()).toBe("true") + }) + }) diff --git a/pages/component/rich-text/rich-text.uvue b/pages/component/rich-text/rich-text.uvue index dbe8ddcd79183b658a527913c8749f00d5f26235..6b3298b637c0e35fa9ad29d9cab1714abe277e37 100644 --- a/pages/component/rich-text/rich-text.uvue +++ b/pages/component/rich-text/rich-text.uvue @@ -16,9 +16,13 @@ selectable - + + + rich-text-parent + {{richTextStr}} + @@ -35,7 +39,8 @@ // 自动化测试 autoTest: false, testNodes: '', - isItemClickTrigger: false + isItemClickTrigger: false, + richTextStr: false } }, onReady() { @@ -71,6 +76,9 @@ }, getWindowInfoForTest() : GetWindowInfoResult { return uni.getWindowInfo(); + }, + richTextParentClick() { + this.richTextStr = true; } } }