提交 1f59f1b3 编写于 作者: DCloud-yinjiacheng's avatar DCloud-yinjiacheng

更新text示例和自动化测试用例

上级 9394e36f
const PAGE_PATH = '/pages/component/text/text-props' const PAGE_PATH = '/pages/component/text/text-props'
describe('text-props', () => { describe('text-props', () => {
let page
beforeAll(async () => { beforeAll(async () => {
const page = await program.navigateTo(PAGE_PATH) page = await program.navigateTo(PAGE_PATH)
await page.waitFor(1000) await page.waitFor(1000)
}) })
it('screenshot', async () => { it('screenshot', async () => {
const image = await program.screenshot({ fullPage: true }) const image = await program.screenshot({ fullPage: true })
expect(image).toMatchImageSnapshot() 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)
}
})
}) })
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
<view class="uni-title"> <view class="uni-title">
<text class="uni-subtitle-text">截断(clip)</text> <text class="uni-subtitle-text">截断(clip)</text>
</view> </view>
<view class="text-box" style="height: 100px"> <view class="text-box">
<text class="uni-flex-item" style="text-overflow: clip">{{ <text class="uni-flex-item" style="text-overflow: clip; white-space: nowrap;">{{
multiLineText multiLineText
}}</text> }}</text>
</view> </view>
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
<view class="uni-title"> <view class="uni-title">
<text class="uni-subtitle-text">截断(ellipsis)</text> <text class="uni-subtitle-text">截断(ellipsis)</text>
</view> </view>
<view class="text-box" style="height: 100px"> <view class="text-box">
<text class="uni-flex-item" style="text-overflow: ellipsis">{{ <text class="uni-flex-item" style="text-overflow: ellipsis; white-space: nowrap;">{{
multiLineText multiLineText
}}</text> }}</text>
</view> </view>
...@@ -96,6 +96,10 @@ ...@@ -96,6 +96,10 @@
<text class="text-padding" style="width: 200px;height: 100px;">hello uni-app x</text> <text class="text-padding" style="width: 200px;height: 100px;">hello uni-app x</text>
</view> </view>
<view class="uni-row">
<text id="empty-text"></text>
</view>
</view> </view>
</scroll-view> </scroll-view>
</template> </template>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册