提交 541aa057 编写于 作者: G gwx1146427

【account】【master】修改JSAPI的UN测试用例

Signed-off-by: Ngwx1146427 <guoyongqiang8@huawei.com>
上级 9b18c5bc
......@@ -122,25 +122,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();
})
})
/**
......@@ -156,9 +162,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 = {
......@@ -166,8 +174,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();
});
});
......
......@@ -124,7 +124,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')
......
......@@ -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;
......
......@@ -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;
......
......@@ -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)=>{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册