diff --git a/pages/component/text/text-props.test.js b/pages/component/text/text-props.test.js
index 7956e9467710c89784a33c47608d5fea91d46c7b..0b41c2c276eeb6677a31577ba84411b473786c0e 100644
--- a/pages/component/text/text-props.test.js
+++ b/pages/component/text/text-props.test.js
@@ -22,7 +22,7 @@ describe('text-props', () => {
expect(width).toBe(0)
expect(height).toBe(0)
}
- await page.callMethod("setTextEmpty")
+ await page.callMethod("setEmptyText")
await page.waitFor(100)
const element2 = await page.$('#empty-text2')
if (element2 != null) {
@@ -35,15 +35,30 @@ describe('text-props', () => {
})
})
- it('text nested', async () => {
+ it('nested text', async () => {
await page.setData({
autoTest: true
})
- await page.callMethod("setTextNested")
+ await page.callMethod("setNestedText")
await page.waitFor(100)
- const element = await page.$('#text-nested')
+ const element = await page.$('#nested-text')
if (element != null) {
- expect(await element.text()).toBe("修改三级节点")
+ expect(await element.text()).toBe("修改三级节点文本")
+ }
+ await page.setData({
+ autoTest: false
+ })
+ })
+
+ it('height text', async () => {
+ await page.setData({
+ autoTest: true
+ })
+ await page.callMethod("setHeightText")
+ await page.waitFor(100)
+ const element = await page.$('#height-text')
+ if (element != null) {
+ expect(await element.text()).toBe("修改设置高度文本")
}
await page.setData({
autoTest: false
diff --git a/pages/component/text/text-props.uvue b/pages/component/text/text-props.uvue
index 2caa46dd437d2e2f728911031e5fe4ff3662410a..5d8c55c723cb9ea5fb1afa39b210b9e0392f960f 100644
--- a/pages/component/text/text-props.uvue
+++ b/pages/component/text/text-props.uvue
@@ -104,12 +104,13 @@
{{emptyText}}
一级节点
+ >一级节点文本
二级节点
- {{nestedText}}
+ >二级节点文本
+ {{nestedText}}
+ {{heightText}}
@@ -125,17 +126,21 @@ export default {
singleLineText: 'uni-app x,终极跨平台方案',
// 自动化测试
autoTest: false,
- nestedText: '三级节点',
- emptyText: 'empty'
+ nestedText: '三级节点文本',
+ emptyText: '空文本',
+ heightText: '设置高度文本'
}
},
methods: {
// 自动化测试
- setTextNested() {
- this.nestedText = "修改三级节点";
+ setNestedText() {
+ this.nestedText = "修改三级节点文本";
},
- setTextEmpty() {
+ setEmptyText() {
this.emptyText = "";
+ },
+ setHeightText() {
+ this.heightText = "修改设置高度文本";
}
}
}