diff --git a/pages/component/sticky-section/sticky-section.test.js b/pages/component/sticky-section/sticky-section.test.js index bf8d7b327da2df3c312115c003036a8ef4dca964..6487cb140375f7c49f4614ab084f74ae147b2882 100644 --- a/pages/component/sticky-section/sticky-section.test.js +++ b/pages/component/sticky-section/sticky-section.test.js @@ -17,8 +17,14 @@ describe('component-native-sticky-section', () => { //滚动回顶部 await page.callMethod('toTop') page.waitFor(100) + await page.setData({ + scrolling: 'true' + }) //跳转到id为C的StickyHeader位置 await page.callMethod('gotoStickyHeader', 'C') + await page.waitFor(async () => { + return await page.data('scrolling') === false; + }); const image = await program.screenshot(); expect(image).toMatchImageSnapshot(); }) diff --git a/pages/component/sticky-section/sticky-section.uvue b/pages/component/sticky-section/sticky-section.uvue index 5cd10d0106a67ecc055e307d5dc22017e296e56e..dbc81c00ef4c529325f059f1740965ef987d882b 100644 --- a/pages/component/sticky-section/sticky-section.uvue +++ b/pages/component/sticky-section/sticky-section.uvue @@ -1,6 +1,6 @@