diff --git a/pages/component/sticky-section/sticky-section.test.js b/pages/component/sticky-section/sticky-section.test.js index c7e82b4844a338690187de876abe696b9fec2519..bf8d7b327da2df3c312115c003036a8ef4dca964 100644 --- a/pages/component/sticky-section/sticky-section.test.js +++ b/pages/component/sticky-section/sticky-section.test.js @@ -11,6 +11,16 @@ describe('component-native-sticky-section', () => { await page.callMethod('listViewScrollByY', 1000) const image = await program.screenshot(); expect(image).toMatchImageSnapshot(); + }) + + it('check_goto_sticky_header', async () => { + //滚动回顶部 + await page.callMethod('toTop') + page.waitFor(100) + //跳转到id为C的StickyHeader位置 + await page.callMethod('gotoStickyHeader', 'C') + const image = await program.screenshot(); + expect(image).toMatchImageSnapshot(); }) } else { // TODO: web 端暂不支持 @@ -18,4 +28,4 @@ describe('component-native-sticky-section', () => { expect(1).toBe(1) }) } -}) \ No newline at end of file +}) diff --git a/pages/component/sticky-section/sticky-section.uvue b/pages/component/sticky-section/sticky-section.uvue index aa6666b020d7e33a396f3ac297ce3394a94c7bc8..5cd10d0106a67ecc055e307d5dc22017e296e56e 100644 --- a/pages/component/sticky-section/sticky-section.uvue +++ b/pages/component/sticky-section/sticky-section.uvue @@ -1,14 +1,18 @@