diff --git a/pages/component/picker-view/picker-view.test.js b/pages/component/picker-view/picker-view.test.js index b5a5c4605cbe089ea00472b9eede905a1235b93f..fbd20937d06dc214ac9ca85c56e5b3a55a12fb5d 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()) }) })