diff --git a/pages/component/list-view/list-view-multiplex.test.js b/pages/component/list-view/list-view-multiplex.test.js index b60a5c36fc373b9a662576cdbd560e1717c67438..e6e3b1295a3585632aa6292e92c2f2794d4769f4 100644 --- a/pages/component/list-view/list-view-multiplex.test.js +++ b/pages/component/list-view/list-view-multiplex.test.js @@ -28,5 +28,16 @@ describe('component-native-list-view', () => { await page.waitFor(200) const image = await program.screenshot(); expect(image).toMatchImageSnapshot(); + }) + + //检测修改item子元素后,item是否正常调整高度 + it('check_switch_item_content', async () => { + await page.callMethod('switchItemContent') + await page.waitFor(async () => { + return await page.data('displayArrow') === true; + }); + await page.waitFor(600) + const image = await program.screenshot(); + expect(image).toMatchImageSnapshot(); }) }) diff --git a/pages/component/list-view/list-view-multiplex.uvue b/pages/component/list-view/list-view-multiplex.uvue index 28949b6313eb890384676e7debad371347e89847..e72c34b5f09a0e8dd890f55f98855f6c173a59e5 100644 --- a/pages/component/list-view/list-view-multiplex.uvue +++ b/pages/component/list-view/list-view-multiplex.uvue @@ -1,10 +1,12 @@ @@ -15,7 +17,8 @@ return { item_count: 20, list_show: true, - listViewElement: null as UniListViewElement|null + listViewElement: null as UniListViewElement|null, + displayArrow: false } }, onReady() { @@ -41,6 +44,9 @@ setTimeout(()=>{ this.list_show = !this.list_show }, 400) + }, + switchItemContent() { + this.displayArrow = !this.displayArrow } } }