From df550ad2a976abb9432c8a8bb93f1e54917e0c5c Mon Sep 17 00:00:00 2001 From: yinjiacheng Date: Tue, 24 Sep 2024 16:39:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0rich-text=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/component/rich-text/rich-text.test.js | 21 ++++++++++++++++++++- pages/component/rich-text/rich-text.uvue | 19 +++++++++++++++++-- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/pages/component/rich-text/rich-text.test.js b/pages/component/rich-text/rich-text.test.js index 076d3221..0aac79df 100644 --- a/pages/component/rich-text/rich-text.test.js +++ b/pages/component/rich-text/rich-text.test.js @@ -3,7 +3,7 @@ const PAGE_PATH = '/pages/component/rich-text/rich-text' describe('rich-text-test', () => { // 先屏蔽 android 及 web 平台 - if (process.env.uniTestPlatformInfo.startsWith('android') || process.env.uniTestPlatformInfo.startsWith('web')) { + if (process.env.uniTestPlatformInfo.startsWith('web')) { it('other platform', () => { expect(1).toBe(1) }) @@ -32,5 +32,24 @@ describe('rich-text-test', () => { console.log('afterValue:', afterValue) expect(beforeValue).toBe(afterValue) }) + + it('test selectable itemclick', async () => { + await page.setData({ + autoTest: true, + isItemClickTrigger: false + }); + await page.waitFor(1000); + const info = await page.callMethod('getWindowInfoForTest'); + const rect = await page.callMethod('getBoundingClientRectForTest'); + await program.tap({ + x: (rect.right - rect.left) / 2, + y: info.statusBarHeight + 44 + (rect.bottom - rect.top) / 2 + }); + await page.waitFor(1000); + expect(await page.data('isItemClickTrigger')).toBe(true); + await page.setData({ + autoTest: false + }); + }); }) diff --git a/pages/component/rich-text/rich-text.uvue b/pages/component/rich-text/rich-text.uvue index 3b2b5d3f..ba7d18af 100644 --- a/pages/component/rich-text/rich-text.uvue +++ b/pages/component/rich-text/rich-text.uvue @@ -21,7 +21,8 @@ :nodes="text"> - + +