From 9eb67dce75a0f61358f4d01c87941adb0c1bd5eb Mon Sep 17 00:00:00 2001 From: liangzhenyu123 Date: Fri, 22 Jul 2022 17:18:41 +0800 Subject: [PATCH] Signed-off-by: liangzhenyu123 --- .../default/test/RdbstoreInsertJsunit.test.js | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreInsertJsunit.test.js b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreInsertJsunit.test.js index ff5d25f53..6879b55c1 100644 --- a/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreInsertJsunit.test.js +++ b/distributeddatamgr/appdatamgrjstest/hap/src/main/js/default/test/RdbstoreInsertJsunit.test.js @@ -168,5 +168,32 @@ describe('rdbStoreInsertTest_test3', function () { done() console.log(TAG + "************* testRdbStoreInsert0003 end *************"); }) + + /** + * @tc.name rdb insert test + * @tc.number SUB_DDM_AppDataFWK_JSRDB_Insert_0040 + * @tc.desc rdb insert test + */ + it('testRdbStoreInsert0004', 0, async function (done) { + console.log(TAG + "************* testRdbStoreInsert0004 start *************"); + var u8 = new Uint8Array([1, 2, 3]) + const valueBucket = { + "name": "zhangsan", + "age": 18, + "salary": null, + "blobType": u8, + } + let insertPromise = rdbStore.insert("test", valueBucket) + insertPromise.then(async (ret) => { + expect(1).assertEqual(ret) + console.log(TAG + "insert first done: " + ret) + }).catch((err) => { + console.log(TAG + "insert with null table") + expect(null).assertFail() + }) + done(); + console.log(TAG + "************* testRdbStoreInsert0004 end *************"); + }) + console.log(TAG + "*************Unit Test End*************"); }) \ No newline at end of file -- GitLab