diff --git a/pages/component/text/text-props.test.js b/pages/component/text/text-props.test.js
index bbe185d2267687a47a2c0a29b3f6d0c86d8d56ba..e4389823f83006bbe537d0a236070d00a1122769 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 b0aa521d3df808d36704a4e173af79ae06e4bee9..c7e9c2f6d8d325fed5dacea954a9328cb1b60d4f 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
+
+
+
+