From 1f59f1b399e3e96d5b749e675123bfbb51a2d200 Mon Sep 17 00:00:00 2001 From: yinjiacheng Date: Fri, 23 Feb 2024 19:59:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0text=E7=A4=BA=E4=BE=8B?= =?UTF-8?q?=E5=92=8C=E8=87=AA=E5=8A=A8=E5=8C=96=E6=B5=8B=E8=AF=95=E7=94=A8?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/component/text/text-props.test.js | 13 ++++++++++++- pages/component/text/text-props.uvue | 12 ++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/pages/component/text/text-props.test.js b/pages/component/text/text-props.test.js index bbe185d2..e4389823 100644 --- a/pages/component/text/text-props.test.js +++ b/pages/component/text/text-props.test.js @@ -1,12 +1,23 @@ const PAGE_PATH = '/pages/component/text/text-props' describe('text-props', () => { + let page beforeAll(async () => { - const page = await program.navigateTo(PAGE_PATH) + page = await program.navigateTo(PAGE_PATH) await page.waitFor(1000) }) + it('screenshot', async () => { const image = await program.screenshot({ fullPage: true }) expect(image).toMatchImageSnapshot() }) + + it('empty text', async () => { + const element = await page.$('#empty-text') + if (element != null) { + const { width, height } = await element.size() + expect(width).toBe(0) + expect(height).toBe(0) + } + }) }) diff --git a/pages/component/text/text-props.uvue b/pages/component/text/text-props.uvue index b0aa521d..c7e9c2f6 100644 --- a/pages/component/text/text-props.uvue +++ b/pages/component/text/text-props.uvue @@ -27,8 +27,8 @@ 截断(clip) - - {{ + + {{ multiLineText }} @@ -36,8 +36,8 @@ 截断(ellipsis) - - {{ + + {{ multiLineText }} @@ -96,6 +96,10 @@ hello uni-app x + + + + -- GitLab