提交 0c369257 编写于 作者: shutao-dc's avatar shutao-dc

update list-view-multiplex.test.js

上级 9934166d
......@@ -17,5 +17,16 @@ describe('component-native-list-view', () => {
await page.callMethod('listViewScrollByY', 5000)
await page.waitFor(400)
await page.callMethod('listViewScrollByY', 100)
})
//检测延迟显示listv-view后list-item是否正常显示
it('check_list_item_v_show', async () => {
await page.callMethod('delayShow')
await page.waitFor(async () => {
return await page.data('list_show') === true;
});
await page.waitFor(200)
const image = await program.screenshot();
expect(image).toMatchImageSnapshot();
})
})
<template>
<list-view id="listview" style="flex: 1;" show-scrollbar=false @scrolltolower="onScrollTolower">
<scroll-view scroll-x="true" style="flex-direction: row;">
<button class="button_item" @click="delayShow">测试延时显示</button>
</scroll-view>
<list-view v-show="list_show" id="listview" style="flex: 1;" show-scrollbar=false @scrolltolower="onScrollTolower">
<list-item v-for="index in item_count" class="item" @click="itemClick(index)">
<text >item-------<text>{{index}}</text></text>
</list-item>
......@@ -11,6 +14,7 @@
data() {
return {
item_count: 20,
list_show: true,
listViewElement: null as UniListViewElement|null
}
},
......@@ -29,6 +33,14 @@
},
itemClick(index: number) {
console.log("itemTextClick---"+index)
},
delayShow() {
this.list_show = !this.list_show
this.item_count += 20
//延时显示list-view 测试list-item延时显示bug
setTimeout(()=>{
this.list_show = !this.list_show
}, 400)
}
}
}
......@@ -41,5 +53,8 @@
background-color: #fff;
border-radius: 5px;
}
.button_item {
width: 200px;
}
</style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册