From 2b203fd52d8acf56d87a48a0dbae0c15cd5d2a02 Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Thu, 21 Sep 2023 15:15:00 +0800 Subject: [PATCH] feat: update uniCloud test case --- .../unicloud-database.test.js | 18 ++++++++++-------- .../unicloud-database/unicloud-database.uvue | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/pages/API/unicloud-database/unicloud-database.test.js b/pages/API/unicloud-database/unicloud-database.test.js index 1af7f5da..f0be3dfd 100644 --- a/pages/API/unicloud-database/unicloud-database.test.js +++ b/pages/API/unicloud-database/unicloud-database.test.js @@ -10,17 +10,17 @@ describe('unicloud-database', () => { await page.callMethod('dbRemove') await page.waitFor(3000) await page.callMethod('dbAdd') - await page.waitFor(1000) + await page.waitFor(2000) await page.callMethod('dbBatchAdd') - await page.waitFor(1000) + await page.waitFor(2000) await page.callMethod('dbGet') - await page.waitFor(1000) + await page.waitFor(2000) await page.callMethod('dbGetWithCommand') - await page.waitFor(1000) + await page.waitFor(2000) await page.callMethod('dbUpdate') - await page.waitFor(1000) + await page.waitFor(2000) await page.callMethod('dbRemove') - await page.waitFor(1000) + await page.waitFor(2000) const { addId, @@ -32,6 +32,8 @@ describe('unicloud-database', () => { removeDeleted, } = await page.data() + console.error((await page.data()).batchAddinserted) + expect(addId.length > 0).toBe(true) expect(batchAddIds.length).toBe(2) expect(batchAddinserted).toBe(2) @@ -44,9 +46,9 @@ describe('unicloud-database', () => { it('databaseLookup', async () => { await page.callMethod('dbLookupInit') - await page.waitFor(1000) + await page.waitFor(3000) await page.callMethod('dbLookup') - await page.waitFor(1000) + await page.waitFor(2000) const { lookupData diff --git a/pages/API/unicloud-database/unicloud-database.uvue b/pages/API/unicloud-database/unicloud-database.uvue index c11e4b64..0fb2e259 100644 --- a/pages/API/unicloud-database/unicloud-database.uvue +++ b/pages/API/unicloud-database/unicloud-database.uvue @@ -91,7 +91,7 @@ this.batchAddIds = res.ids this.batchAddinserted = res.inserted uni.showModal({ - content: `新增成功,id列表: ${res.ids.join(',')}`, + content: `新增成功条数${res.inserted}, id列表: ${res.ids.join(',')}`, showCancel: false }) }) -- GitLab