From 46fa19cce7ca1c687e4f86610a7e897ac364d00b Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Tue, 19 Mar 2024 13:12:18 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E5=A2=9E=E5=8A=A0picker-view=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B=E9=A1=B5=E9=9D=A2=E9=87=8D=E6=96=B0=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/picker-view/picker-view.test.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/pages/component/picker-view/picker-view.test.js b/pages/component/picker-view/picker-view.test.js index b5a5c460..fbd20937 100644 --- a/pages/component/picker-view/picker-view.test.js +++ b/pages/component/picker-view/picker-view.test.js @@ -4,10 +4,12 @@ function getData(key = '') { resolve(key ? data[key] : data) }) } + +const PAGE_PATH = '/pages/component/picker-view/picker-view' let page beforeAll(async () => { - page = await program.reLaunch('/pages/component/picker-view/picker-view') + page = await program.reLaunch(PAGE_PATH) await page.waitFor('view') }) @@ -60,5 +62,20 @@ describe('PickerView.uvue', () => { maskBottomStyle: 'background: #ffffff;', }) expect(await el.attribute('mask-bottom-style')).toBe('background: #ffffff;') + }) + + it('reopen-picker-view-page', async () => { + await program.navigateBack() + page = await program.navigateTo(PAGE_PATH) + await page.waitFor(500) + const date = new Date() + const { + year, + month, + day + } = await page.data() + expect(year).toEqual(date.getFullYear()) + expect(month).toEqual(date.getMonth() + 1) + expect(day).toEqual(date.getDate()) }) }) -- GitLab