diff --git a/pages/component/navigator/navigator.test.js b/pages/component/navigator/navigator.test.js new file mode 100644 index 0000000000000000000000000000000000000000..f424dded594c0b5e9b5e017735101b0ee7221cfa --- /dev/null +++ b/pages/component/navigator/navigator.test.js @@ -0,0 +1,30 @@ +const PAGE_PATH = '/pages/component/navigator/navigator' +const PAGE_PATH_NAVIGATE = '/pages/component/navigator/navigate' +const PAGE_PATH_REDIRECT = '/pages/component/navigator/redirect' + +describe('navigator', () => { + let page + beforeAll(async () => {}) + it('navigate', async () => { + page = await program.reLaunch(PAGE_PATH) + await page.waitFor(500) + + const btnNavigate = await page.$('.navigate') + await btnNavigate.tap() + await page.waitFor(100) + + const currentPage = await program.currentPage() + expect(currentPage.path).toBe(PAGE_PATH_NAVIGATE.substring(1)) + }) + it('redirect', async () => { + page = await program.reLaunch(PAGE_PATH) + await page.waitFor(500) + + const btnRedirect = await page.$('.redirect') + await btnRedirect.tap() + await page.waitFor(100) + + const currentPage = await program.currentPage() + expect(currentPage.path).toBe(PAGE_PATH_REDIRECT.substring(1)) + }) +}) diff --git a/pages/component/navigator/navigator.uvue b/pages/component/navigator/navigator.uvue index 81680683b4e3b4491db9c7156c906119de4d23f9..da656d03c7d9c5b29e53840156dc7b31fe83ec2d 100644 --- a/pages/component/navigator/navigator.uvue +++ b/pages/component/navigator/navigator.uvue @@ -2,10 +2,10 @@ - + - +