diff --git a/distributeddatamgr/Pasteboardjsapitest/entry/src/main/ets/test/PasteBoeadPixelMapJsunit.test.ets b/distributeddatamgr/Pasteboardjsapitest/entry/src/main/ets/test/PasteBoeadPixelMapJsunit.test.ets index 122710d1cdc18897d238ef5ecda2eab660872d2d..bf09ad3282ee54bff046489b5012eada12860997 100644 --- a/distributeddatamgr/Pasteboardjsapitest/entry/src/main/ets/test/PasteBoeadPixelMapJsunit.test.ets +++ b/distributeddatamgr/Pasteboardjsapitest/entry/src/main/ets/test/PasteBoeadPixelMapJsunit.test.ets @@ -172,6 +172,8 @@ export default function pasteBoardTest(){ expect(uri).assertEqual(data.getRecordAt(0).uri) expect('text/uri').assertEqual(data.getRecordAt(0).mimeType) console.info(data.getRecordAt(0).mimeType) + console.info(data.getProperty().mimeTypes[0]); + expect("text/uri").assertEqual(data.getProperty().mimeTypes[0]); }) }) }) diff --git a/distributeddatamgr/preferencesjstest/hap/src/main/js/test/PreferencesCallBackJsunit.test.js b/distributeddatamgr/preferencesjstest/hap/src/main/js/test/PreferencesCallBackJsunit.test.js index e55d79395fb8f83d7e7d89df8d0562dd9473765a..5304dcfb38f4ab114bf314ed5d826ef7512d340c 100644 --- a/distributeddatamgr/preferencesjstest/hap/src/main/js/test/PreferencesCallBackJsunit.test.js +++ b/distributeddatamgr/preferencesjstest/hap/src/main/js/test/PreferencesCallBackJsunit.test.js @@ -487,5 +487,19 @@ describe('preferencesCallBackTest', function () { }) done(); }) + + /** + * @tc.name get defaultValue callback interface test + * @tc.number SUB_DDM_Preferences_Get_CallBack_0250 + * @tc.desc get defaultValue callback interface test + */ + it('testPreferencesGetDefValue0173', 0, async function (done) { + await mPreferences.clear(); + await mPreferences.get(KEY_TEST_BOOLEAN_ELEMENT, true, function (err, ret) { + expect(true).assertEqual(ret); + done(); + }) + }) + }) } \ No newline at end of file diff --git a/distributeddatamgr/preferencesjstest/hap/src/main/js/test/PreferencesPromiseJsunit.test.js b/distributeddatamgr/preferencesjstest/hap/src/main/js/test/PreferencesPromiseJsunit.test.js index 877cb992ba96e0beaaca4264433945738adcdb6c..ed3f2692c2ea5c1d329def1090caa35fcb3054ca 100644 --- a/distributeddatamgr/preferencesjstest/hap/src/main/js/test/PreferencesPromiseJsunit.test.js +++ b/distributeddatamgr/preferencesjstest/hap/src/main/js/test/PreferencesPromiseJsunit.test.js @@ -450,5 +450,22 @@ describe('preferencesPromiseTest', function () { await promise; done(); }) + + /** + * @tc.name get string promise interface test + * @tc.number SUB_DDM_Preferences_Get_Promise_0210 + * @tc.desc get string promise interface test + */ + it('testPreferencesGetDefValue00162', 0, async function (done) { + await mPreferences.clear(); + const promise = mPreferences.get(KEY_TEST_BOOLEAN_ELEMENT, true); + promise.then((ret) => { + expect(true).assertEqual(ret); + }).catch((err) => { + expect(null).assertFail(); + }); + await promise; + done(); + }) }) } \ No newline at end of file diff --git a/distributeddatamgr/preferencesjstest/hap/src/main/js/test/StorageCallBackJsunit.test.js b/distributeddatamgr/preferencesjstest/hap/src/main/js/test/StorageCallBackJsunit.test.js index d4576c2bb212755dcebf214362f1f74dea7a59c7..8119b0901a0a7e60798ba8e14769addb2ac00183 100644 --- a/distributeddatamgr/preferencesjstest/hap/src/main/js/test/StorageCallBackJsunit.test.js +++ b/distributeddatamgr/preferencesjstest/hap/src/main/js/test/StorageCallBackJsunit.test.js @@ -333,5 +333,18 @@ describe('storageCallBackTest', function () { }); done(); }) + + /** + * @tc.name get defaultValue callback interface test + * @tc.number SUB_DDM_AppDataFWK_JSPreferences_CallBack_0190 + * @tc.desc get defaultValue callback interface test + */ + it('testGetDefValue0192', 0, async function (done) { + await mPref.clear(); + await mPref.get(KEY_TEST_BOOLEAN_ELEMENT, true, function (err, ret) { + expect(true).assertEqual(ret); + done(); + }) + }) }) } diff --git a/distributeddatamgr/preferencesjstest/hap/src/main/js/test/StoragePromiseJsunit.test.js b/distributeddatamgr/preferencesjstest/hap/src/main/js/test/StoragePromiseJsunit.test.js index 5f968862f1d7c891940ebd376ddc4fec39a326d3..bddc402152574f850c0eb05241e05f428d35594f 100644 --- a/distributeddatamgr/preferencesjstest/hap/src/main/js/test/StoragePromiseJsunit.test.js +++ b/distributeddatamgr/preferencesjstest/hap/src/main/js/test/StoragePromiseJsunit.test.js @@ -491,5 +491,22 @@ describe('storagePromiseTest', function () { expect(MAX_VALUE_LENGTH).assertEqual(mPref.getSync("test", "defaultvalue")); done(); }) + + /** + * @tc.name get string promise interface test + * @tc.number SUB_DDM_AppDataFWK_JSPreferences_Storage_0260 + * @tc.desc get string promise interface test + */ + it('testGetDefValue0260', 0, async function (done) { + await mPref.clear(); + const promise = mPref.get(KEY_TEST_BOOLEAN_ELEMENT, true); + promise.then((ret) => { + expect(true).assertEqual(ret); + }).catch((err) => { + expect(null).assertFail(); + }); + await promise; + done(); + }) }) } diff --git a/distributeddatamgr/preferencesjstest/hap/src/main/js/test/StorageSyncJsunit.test.js b/distributeddatamgr/preferencesjstest/hap/src/main/js/test/StorageSyncJsunit.test.js index 75df1645efa798ea97cea117d9494a7d7ac10cac..35cd4f61a6d801649514ad75120ea53e16583ee9 100644 --- a/distributeddatamgr/preferencesjstest/hap/src/main/js/test/StorageSyncJsunit.test.js +++ b/distributeddatamgr/preferencesjstest/hap/src/main/js/test/StorageSyncJsunit.test.js @@ -287,4 +287,16 @@ describe('storageSyncTest', function () { mPref.off('change', observer); mPref.putSync(KEY_TEST_STRING_ELEMENT, "abc"); }) + + /** + * @tc.name get defaultValue callback interface test + * @tc.number SUB_DDM_AppDataFWK_JSPreferences_Sync_0170 + * @tc.desc get defaultValue callback interface test + */ + it('testGetDefValue001', 0, async function (done) { + await mPref.clear(); + var ret = mPref.getSync(KEY_TEST_BOOLEAN_ELEMENT, true) + expect(ret).assertTrue(); + done(); + }) })} diff --git a/distributeddatamgr/relationalStorejstest/hap/src/main/js/test/RdbstoreTransactionJsunit.test.js b/distributeddatamgr/relationalStorejstest/hap/src/main/js/test/RdbstoreTransactionJsunit.test.js index 2f7f827d192e1e88d4dcbfdea3b23b5442d22b21..5c3a89475a354cb1ff4eded1fe75a1b2ba3bc096 100644 --- a/distributeddatamgr/relationalStorejstest/hap/src/main/js/test/RdbstoreTransactionJsunit.test.js +++ b/distributeddatamgr/relationalStorejstest/hap/src/main/js/test/RdbstoreTransactionJsunit.test.js @@ -20,7 +20,7 @@ const TAG = "[RDB_JSKITS_TEST]" const CREATE_TABLE_TEST = "CREATE TABLE IF NOT EXISTS test (" + "id INTEGER PRIMARY KEY, " + "name TEXT NOT NULL, " + "age INTEGER, " + "salary REAL, " + "blobType BLOB)"; const STORE_CONFIG = { - name: "RdbInsertTest.db", + name: "rdbstoreTransactionTest.db", } var rdbStore = undefined; @@ -41,7 +41,7 @@ describe('rdbstoreTransactionTest', function () { console.info(TAG + 'afterEach') await rdbStore.executeSql("DELETE FROM test"); rdbStore = null - await dataRdb.deleteRdbStore("Delete.db"); + await dataRdb.deleteRdbStore("rdbstoreTransactionTest.db"); }) afterAll(async function () { diff --git a/distributeddatamgr/relationalStorejstest/hap/src/main/js/test/RdbstoreUpdateJsunit.test.js b/distributeddatamgr/relationalStorejstest/hap/src/main/js/test/RdbstoreUpdateJsunit.test.js index 68519afd9b241d392d054e6a8655ce836f01d736..633d856a202281f9ff7a58f70416556e7cf6cfc3 100644 --- a/distributeddatamgr/relationalStorejstest/hap/src/main/js/test/RdbstoreUpdateJsunit.test.js +++ b/distributeddatamgr/relationalStorejstest/hap/src/main/js/test/RdbstoreUpdateJsunit.test.js @@ -38,7 +38,7 @@ describe('rdbStoreUpdateTest', function () { console.info(TAG + 'afterEach') await rdbStore.executeSql("DELETE FROM test"); rdbStore = null - await dataRdb.deleteRdbStore("Delete.db"); + await dataRdb.deleteRdbStore("UpdataTest.db"); }) afterAll(async function () {