From 4c4af673c6f8b1eb944552c8ad49fade541afa10 Mon Sep 17 00:00:00 2001 From: shutao Date: Wed, 28 Feb 2024 16:19:41 +0800 Subject: [PATCH] =?UTF-8?q?list-view=E8=A1=A5=E5=85=85=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=B5=8B=E8=AF=95=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 18 ++++--- .../list-view/list-view-refresh.test.js | 24 +++++++++ .../list-view/list-view-refresh.uvue | 49 +++++++++++++++++++ pages/component/list-view/list-view.uvue | 6 ++- 4 files changed, 90 insertions(+), 7 deletions(-) create mode 100644 pages/component/list-view/list-view-refresh.test.js create mode 100644 pages/component/list-view/list-view-refresh.uvue diff --git a/pages.json b/pages.json index d922a3b1..99c42cc8 100644 --- a/pages.json +++ b/pages.json @@ -1080,7 +1080,7 @@ { "path": "pages/template/swiper-vertical-video/swiper-vertical-video", "style": { - "navigationStyle": "custom", + "navigationStyle": "custom", "navigationBarBackgroundColor": "transparent" } }, @@ -1096,7 +1096,7 @@ "path": "pages/template/scroll-fold-nav/scroll-fold-nav", "style": { "navigationStyle": "custom", - "navigationBarTextStyle": "black", + "navigationBarTextStyle": "black", "navigationBarBackgroundColor": "transparent" } }, @@ -1131,7 +1131,7 @@ { "path": "pages/template/pull-zoom-image/pull-zoom-image", "style": { - "navigationStyle": "custom", + "navigationStyle": "custom", "navigationBarBackgroundColor": "transparent" } }, @@ -1181,7 +1181,7 @@ "path": "pages/webview-screenshot-comparison/webview-screenshot-comparison", "style": { "navigationBarTitleText": "截图对比测试", - "navigationStyle": "custom", + "navigationStyle": "custom", "navigationBarBackgroundColor": "transparent" } }, @@ -1189,7 +1189,7 @@ "path": "pages/webview-screenshot/webview-screenshot", "style": { "navigationBarTitleText": "webview 截图测试", - "navigationStyle": "custom", + "navigationStyle": "custom", "navigationBarBackgroundColor": "transparent" } }, @@ -1214,8 +1214,14 @@ "navigationBarTitleText": "支付", "enablePullDownRefresh": false } + }, + { + "path": "pages/component/list-view/list-view-refresh", + "style": { + "navigationBarTitleText": "list-view-refresh", + "enablePullDownRefresh": false + } } - // #endif ], "globalStyle": { diff --git a/pages/component/list-view/list-view-refresh.test.js b/pages/component/list-view/list-view-refresh.test.js new file mode 100644 index 00000000..ff0a07ab --- /dev/null +++ b/pages/component/list-view/list-view-refresh.test.js @@ -0,0 +1,24 @@ +describe('component-native-list-view-refresh', () => { + if (process.env.uniTestPlatformInfo.startsWith('web')) { + it('dummyTest', async () => { + expect(1).toBe(1) + }) + return + } + let page + beforeAll(async () => { + //打开list-view测试页 + page = await program.reLaunch('/pages/component/list-view/list-view-refresh') + await page.waitFor(600) + }) + + it('check_list_view_refresh', async () => { + await page.waitFor(async () => { + return await page.data('refresherTriggered') === false; + }); + //等待下拉刷新结束 + await page.waitFor(500) + const image = await program.screenshot(); + expect(image).toMatchImageSnapshot(); + }) +}) diff --git a/pages/component/list-view/list-view-refresh.uvue b/pages/component/list-view/list-view-refresh.uvue new file mode 100644 index 00000000..9299b9fa --- /dev/null +++ b/pages/component/list-view/list-view-refresh.uvue @@ -0,0 +1,49 @@ + + + + diff --git a/pages/component/list-view/list-view.uvue b/pages/component/list-view/list-view.uvue index 6e0ca02c..40a59cce 100644 --- a/pages/component/list-view/list-view.uvue +++ b/pages/component/list-view/list-view.uvue @@ -182,7 +182,11 @@ @confirm="confirm_refresher_background_input"> - + + +