diff --git a/account/OsAccountTest_js/src/main/js/test/ActsDSGetSet.test.js b/account/OsAccountTest_js/src/main/js/test/ActsDSGetSet.test.js index 12b775a06f9ade0d957331c234835d6515d96aed..ea87ecca4b9b913826f8dca8d401e3823a49b5af 100644 --- a/account/OsAccountTest_js/src/main/js/test/ActsDSGetSet.test.js +++ b/account/OsAccountTest_js/src/main/js/test/ActsDSGetSet.test.js @@ -123,25 +123,31 @@ export default function ActsDAGetSetTest() { scalableData:{} }; accountAbility.setOsAccountDistributedInfo(obj).then(function () { - accountAbility.getOsAccountDistributedInfo(function (data) { + accountAbility.getOsAccountDistributedInfo(function (err, data) { + console.debug('====>setOsAccountDistributedInfo_test001 ccerr:' + JSON.stringify(err)) console.debug('====>setOsAccountDistributedInfo_test001 data:' + JSON.stringify(data)) expect(data.name).assertEqual('ZhangSan') - expect(data.id).assertEqual('12345') + expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') let obj = { id: '12345', name: 'ZhangSan', event: 'Ohos.account.event.LOGOUT' }; - accountAbility.setOsAccountDistributedInfo(obj).then(function (err) { - expect(err).assertEqual(null) - }); + accountAbility.setOsAccountDistributedInfo(obj).then(function () { + accountAbility.getOsAccountDistributedInfo(function (err, data) { + console.debug('====>setOsAccountDistributedInfo_test001 get ccerr:' + JSON.stringify(err)) + console.debug('====>setOsAccountDistributedInfo_test001 get ccdata:' + JSON.stringify(data)) + expect(err).assertEqual(null) + done(); + }) + }).catch((err) => { + console.debug('====>setOsAccountDistributedInfo_test001 ccerr:' + JSON.stringify(err)) + expect().assertFail(); + done(); + }) }); }); - accountAbility.getOsAccountDistributedInfo(function (data) { - console.debug('====>setOsAccountDistributedInfo_test001 get data:' + JSON.stringify(data)) - expect(data).assertEqual(null) - done(); - }) + }) /** @@ -157,9 +163,11 @@ export default function ActsDAGetSetTest() { event: 'Ohos.account.event.LOGIN', scalableData:{} }; - accountAbility.setOsAccountDistributedInfo(obj, function () { + accountAbility.setOsAccountDistributedInfo(obj, function (err) { + console.debug('====>setOsAccountDistributedInfo_test002 ccerr callback:' + JSON.stringify(err)) accountAbility.getOsAccountDistributedInfo(function (err, data) { - console.debug("====>setOsAccountDistributedInfo_test002 data:" + JSON.stringify(data)) + console.debug('====>setOsAccountDistributedInfo_test002 get ccerr:' + JSON.stringify(err)) + console.debug("====>setOsAccountDistributedInfo_test002 get data:" + JSON.stringify(data)) expect(data.name).assertEqual('ZhangSan') expect(data.id).assertEqual('5994471ABB01112AFCC18159F6CC74B4F511B99806DA59B3CAF5A9C173CACFC5') let obj = { @@ -167,8 +175,11 @@ export default function ActsDAGetSetTest() { name: 'ZhangSan', event: 'Ohos.account.event.LOGOUT' }; - accountAbility.setOsAccountDistributedInfo(obj).then(function (data) { - expect(data).assertEqual(null) + accountAbility.setOsAccountDistributedInfo(obj).then(function () { + done(); + }).catch((err) => { + console.debug('====>setOsAccountDistributedInfo_test002 set ccerr:' + JSON.stringify(err)) + expect().assertFail(); done(); }); }); diff --git a/account/OsAccountTest_js/src/main/js/test/OsAccount.test.js b/account/OsAccountTest_js/src/main/js/test/OsAccount.test.js old mode 100755 new mode 100644 index b16599c474c38fef2b6032130415a01d6c1c3893..d2b93072a8f363bcdeb4670b260a38ad50fc6db6 --- a/account/OsAccountTest_js/src/main/js/test/OsAccount.test.js +++ b/account/OsAccountTest_js/src/main/js/test/OsAccount.test.js @@ -125,7 +125,7 @@ export default function AccountTest() { scalableData:data }; accountAbility.updateOsAccountDistributedInfo(obj).then(function () { - accountAbility.queryOsAccountDistributedInfo(function (data) { + accountAbility.queryOsAccountDistributedInfo(function (err, data) { console.debug('====>account_updateOsAccountDistributedInfo_test001 data:' + JSON.stringify(data)) expect(data.name).assertEqual('ZhangSan') expect(data.id).assertEqual('12345') diff --git a/account/appaccount/actsaccountoperatetest/src/main/js/test/Authenticator.test.js b/account/appaccount/actsaccountoperatetest/src/main/js/test/Authenticator.test.js index 9f0ab901022b64f7b2ea661103664ad0b3169257..e1bce4553d3b9eba58cfdb1a12ca7d50cb6489c1 100644 --- a/account/appaccount/actsaccountoperatetest/src/main/js/test/Authenticator.test.js +++ b/account/appaccount/actsaccountoperatetest/src/main/js/test/Authenticator.test.js @@ -14,7 +14,7 @@ */ import account from '@ohos.account.appAccount' import featureAbility from '@ohos.ability.featureAbility' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' const NAMELIMIT = 512; const LENGTHLIMIT = 1024; diff --git a/account/appaccount/actsaccounttest/src/main/js/test/Authenticator.test.js b/account/appaccount/actsaccounttest/src/main/js/test/Authenticator.test.js index 5c6837b4436dfa224dabbb243935c4507ceffdbf..9a5e705b9f7ad705cc7a4281352234b6b98a19c3 100644 --- a/account/appaccount/actsaccounttest/src/main/js/test/Authenticator.test.js +++ b/account/appaccount/actsaccounttest/src/main/js/test/Authenticator.test.js @@ -14,7 +14,7 @@ */ import account from '@ohos.account.appAccount' import featureAbility from '@ohos.ability.featureAbility' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' const NAMELIMIT = 512; const LENGTHLIMIT = 1024; diff --git a/account/appaccount/sceneProject/actsaccountauthenticator/entry/src/main/js/MainAbility/pages/index/index.js b/account/appaccount/sceneProject/actsaccountauthenticator/entry/src/main/js/MainAbility/pages/index/index.js index c5186cf9c4537f9ffa869d250ee6ac168b7816c7..6163302b14072a21023660f089dcf19510a71cc3 100644 --- a/account/appaccount/sceneProject/actsaccountauthenticator/entry/src/main/js/MainAbility/pages/index/index.js +++ b/account/appaccount/sceneProject/actsaccountauthenticator/entry/src/main/js/MainAbility/pages/index/index.js @@ -19,10 +19,10 @@ export default { data: { title: "Hello World" }, - onInit() { + onShow() { this.title = this.$t('strings.world'); }, - onShow() { + onInit() { console.info('====>ServiceAbility onStart'); var accountMgr = account_appAccount.createAppAccountManager(); accountMgr.createAccount("zhangsan", async(data)=>{