From a3c5bc848ff318516288ae972e614a60c3c0c059 Mon Sep 17 00:00:00 2001 From: yanglifeng1217 Date: Wed, 19 Apr 2023 15:41:57 +0800 Subject: [PATCH] Signed-off-by: yanglifeng1217 --- .../hap/src/main/js/test/KvManagerKVCallbackJsTest.js | 8 ++++++-- .../hap/src/main/js/test/KvManagerCallbackJsunit.test.js | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvManagerKVCallbackJsTest.js b/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvManagerKVCallbackJsTest.js index 6dbee2dd2..417eb504a 100644 --- a/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvManagerKVCallbackJsTest.js +++ b/distributeddatamgr/distributedKVStoretest/distributedKVStorejstest/hap/src/main/js/test/KvManagerKVCallbackJsTest.js @@ -82,6 +82,10 @@ describe('kvManagerCallbackTest', function () { expect((err == undefined) && (store != null)).assertTrue(); console.info('SUB_DDM_DKV_KVMANAGER_GETKVSTORE_0100 getKVStore success'); kvStore = store; + kvStore.getSecurityLevel().then((data) => { + console.info('SUB_DDM_DKV_KVMANAGER_GETKVSTORE_0100 securityLevel = ' + data); + expect((data == factory.SecurityLevel.S2)).assertTrue(); + }); done(); }); } catch (e) { @@ -105,8 +109,8 @@ describe('kvManagerCallbackTest', function () { console.info('SUB_DDM_DKV_KVMANAGER_GETKVSTORE_0200 getKVStore success'); expect(null).assertFail(); } else { - expect((err != undefined)).assertTrue(); - console.info('SUB_DDM_DKV_KVMANAGER_GETKVSTORE_0200 getKVStore fail'); + expect((err.code == 401)).assertTrue(); + console.info('getKVStore fail' + `, error code is ${err.code}, message is ${err.message}`); } done(); }); diff --git a/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/KvManagerCallbackJsunit.test.js b/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/KvManagerCallbackJsunit.test.js index 7e546f7ba..ce8068507 100644 --- a/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/KvManagerCallbackJsunit.test.js +++ b/distributeddatamgr/kvStoretest/kvStorejstest/hap/src/main/js/test/KvManagerCallbackJsunit.test.js @@ -85,6 +85,10 @@ describe('kvManagerCallbackTest', function () { expect((err == undefined) && (store != null)).assertTrue(); console.info('testKVManagerGetKVStore101 getKVStore success'); kvStore = store; + kvStore.getSecurityLevel().then((data) => { + console.info('testKVManagerGetKVStore101 securityLevel = ' + data); + expect((data == factory.SecurityLevel.S2)).assertTrue(); + }); done(); }); } catch (e) { -- GitLab