From f40c520735d69956ae3fa31fc6449ba6ed42a93e Mon Sep 17 00:00:00 2001 From: shutao Date: Thu, 30 Nov 2023 20:09:35 +0800 Subject: [PATCH] =?UTF-8?q?update=20sticky-section=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sticky-section/sticky-section.test.js | 12 +++++++++- .../sticky-section/sticky-section.uvue | 23 +++++++++++++++---- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/pages/component/sticky-section/sticky-section.test.js b/pages/component/sticky-section/sticky-section.test.js index c7e82b48..bf8d7b32 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 aa6666b0..5cd10d01 100644 --- a/pages/component/sticky-section/sticky-section.uvue +++ b/pages/component/sticky-section/sticky-section.uvue @@ -1,14 +1,18 @@