From 1e2ff0c317a5e21cbf8f9c0b01e680a353cdeefa Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Fri, 24 Nov 2023 12:09:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A1=A5=E5=85=85=E6=9C=AA=E8=AF=86?= =?UTF-8?q?=E5=88=AB=E7=BB=84=E4=BB=B6=E5=BD=93=E5=81=9A=20view=20?= =?UTF-8?q?=E5=A4=84=E7=90=86=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 7 ++++++ pages/index.uvue | 25 +++++++++++-------- .../unrecognized-component.test.js | 11 ++++++++ .../unrecognized-component.uvue | 3 +++ 4 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 pages/rendering/unrecognized-component/unrecognized-component.test.js create mode 100644 pages/rendering/unrecognized-component/unrecognized-component.uvue diff --git a/pages.json b/pages.json index e1c5697..301fbae 100644 --- a/pages.json +++ b/pages.json @@ -248,6 +248,13 @@ "enablePullDownRefresh": false } }, + { + "path": "pages/rendering/unrecognized-component/unrecognized-component", + "style": { + "navigationBarTitleText": "unrecognized-component", + "enablePullDownRefresh": false + } + }, { "path": "pages/rendering/component/component", "style": { diff --git a/pages/index.uvue b/pages/index.uvue index 816630e..aa5c385 100644 --- a/pages/index.uvue +++ b/pages/index.uvue @@ -220,11 +220,16 @@ url: 'slots', enable: true, }, - { - name: 'component', - url: 'component', - enable: true, - }, + { + name: 'component', + url: 'component', + enable: true, + }, + { + name: 'unrecognized component', + url: 'unrecognized-component', + enable: true, + }, ] as PageItem[], }, { @@ -371,11 +376,11 @@ getLifeCycleNum() : number { return state.lifeCycleNum }, - // 自动化测试 - checkLaunchPath() : boolean { - const app = getApp() - return app.checkLaunchPath() - }, + // 自动化测试 + checkLaunchPath() : boolean { + const app = getApp() + return app.checkLaunchPath() + }, }, } diff --git a/pages/rendering/unrecognized-component/unrecognized-component.test.js b/pages/rendering/unrecognized-component/unrecognized-component.test.js new file mode 100644 index 0000000..8766e52 --- /dev/null +++ b/pages/rendering/unrecognized-component/unrecognized-component.test.js @@ -0,0 +1,11 @@ +describe('/pages/rendering/unrecognized-component/unrecognized-component', () => { + let page + beforeAll(async () => { + page = await program.reLaunch('/pages/rendering/unrecognized-component/unrecognized-component') + await page.waitFor('text') + }) + it('unrecognized-component should be created as "view"', async () => { + const element = await page.$('text') + expect(await element.text()).toBe('text in unrecognized component') + }) +}); \ No newline at end of file diff --git a/pages/rendering/unrecognized-component/unrecognized-component.uvue b/pages/rendering/unrecognized-component/unrecognized-component.uvue new file mode 100644 index 0000000..ae15f72 --- /dev/null +++ b/pages/rendering/unrecognized-component/unrecognized-component.uvue @@ -0,0 +1,3 @@ + -- GitLab