From dbd2662cc7ffdb83884188c957e69208373b0d5d Mon Sep 17 00:00:00 2001 From: Anne_LXM <54163582+anne-lxm@users.noreply.github.com> Date: Thu, 14 Dec 2023 16:30:39 +0800 Subject: [PATCH] Update edit.test.js --- pages/user-info/edit.test.js | 43 ++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/pages/user-info/edit.test.js b/pages/user-info/edit.test.js index 2e3d24b..72546ee 100644 --- a/pages/user-info/edit.test.js +++ b/pages/user-info/edit.test.js @@ -9,26 +9,27 @@ describe('pages/user-info/detail.vue', () => { it('修改表单内容', async () => { const getQuery = await page.query console.log('getQuery: ',getQuery); - if(!getQuery.id || getQuery.hobby_valuetotext.length<0)return; - await page.setData({ - "formData": { - "username":"林小明加", - "gender":2, - "birth_date": Date.now(), - "weight":56, - "mobile":"17766666666", - "email":"1076998866@qq.com", - "url":"https://uniapp.dcloud.net.cn/", - "favorite_book_id": "4", - "address_code": "110105", - "party_member": true, - "hobby":["dance","Sing","draw"], - "comment": "好的更新了" - } - }) - await page.waitFor(1000) - const res = await page.callMethod('submit') - console.log('res: ',res.updated); - expect(res.updated).toBe(1) + if(getQuery.id || getQuery.hobby_valuetotext.length>0){ + await page.setData({ + "formData": { + "username":"林小明加", + "gender":2, + "birth_date": Date.now(), + "weight":56, + "mobile":"17766666666", + "email":"1076998866@qq.com", + "url":"https://uniapp.dcloud.net.cn/", + "favorite_book_id": "4", + "address_code": "110105", + "party_member": true, + "hobby":["dance","Sing","draw"], + "comment": "好的更新了" + } + }) + await page.waitFor(300) + const res = await page.callMethod('submit') + console.log('res: ',res.updated); + expect(res.updated).toBe(1) + } }) }) \ No newline at end of file -- GitLab