From ec2dca883b5cf543f07120fd65db2fe0fa0a4e95 Mon Sep 17 00:00:00 2001 From: zhaimengchao Date: Tue, 4 Apr 2023 16:25:03 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20f81cd06=20from=20https://gitee.com/zhai?= =?UTF-8?q?mengchao/xts=5Facts/pulls/8351=20=E3=80=90account=E3=80=91?= =?UTF-8?q?=E3=80=90master=E3=80=91checkAccountLabels=20=E7=BC=BA=E5=A4=B1?= =?UTF-8?q?=E6=96=AD=E8=A8=80=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhaimengchao --- .../src/main/js/test/Authenticator.test.js | 13 +++++++++---- .../src/main/js/test/Authenticator.test.js | 15 ++++++++++----- 2 files changed, 19 insertions(+), 9 deletions(-) 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 a0829fd83..6473a6ab1 100644 --- a/account/appaccount/actsaccountoperatetest/src/main/js/test/Authenticator.test.js +++ b/account/appaccount/actsaccountoperatetest/src/main/js/test/Authenticator.test.js @@ -70,7 +70,8 @@ export default function ActsAccountAppAccess() { appAccountManager.checkAccountLabels(name, owner, ['level4'], (err, data)=>{ console.debug("====>ActsAccountCheckAccountLabels_0100 err:" + JSON.stringify(err)); expect(err).assertEqual(null); - console.debug("====>ActsAccountCheckAccountLabels_0100 data:" + JSON.stringify(data)); + console.debug("====>ActsAccountCheckAccountLabels_0100 data:" + JSON.stringify(data)); + expect(data).assertEqual(true); appAccountManager.removeAccount(name, (err) =>{ console.debug("====>ActsAccountCheckAccountLabels_0100 removeAccount_err:" + JSON.stringify(err)) expect(err).assertEqual(null); @@ -98,7 +99,8 @@ export default function ActsAccountAppAccess() { appAccountManager.checkAccountLabels(name, owner, ['20-30'], (err, data)=>{ console.debug("====>ActsAccountCheckAccountLabels_0200 err:" + JSON.stringify(err)); expect(err).assertEqual(null); - console.debug("====>ActsAccountCheckAccountLabels_0200 data:" + JSON.stringify(data)); + console.debug("====>ActsAccountCheckAccountLabels_0200 data:" + JSON.stringify(data)); + expect(data).assertEqual(false); appAccountManager.removeAccount(name, (err) =>{ console.debug("====>ActsAccountCheckAccountLabels_0200 removeAccount_err:" + JSON.stringify(err)) expect(err).assertEqual(null); @@ -125,8 +127,8 @@ export default function ActsAccountAppAccess() { appAccountManager.checkAccountLabels('CheckAccountLabels_0300', owner, ['male'], (err, data)=>{ console.debug("====>ActsAccountCheckAccountLabels_0300 err:" + JSON.stringify(err)); expect(err).assertEqual(null); - console.debug("====>ActsAccountCheckAccountLabels_0300 data:" + JSON.stringify(data)); - expect(data).assertEqual(false) + console.debug("====>ActsAccountCheckAccountLabels_0300 data:" + JSON.stringify(data)); + expect(data).assertEqual(false); appAccountManager.removeAccount("CheckAccountLabels_0300", (err) =>{ console.debug("====>ActsAccountCheckAccountLabels_0300 removeAccount_err:" + JSON.stringify(err)) expect(err).assertEqual(null); @@ -152,6 +154,7 @@ export default function ActsAccountAppAccess() { console.debug("====>ActsAccountCheckAccountLabels_0400 add_account_success"); appAccountManager.checkAccountLabels(name, owner, ['level4']).then((data) =>{ console.debug("====>ActsAccountCheckAccountLabels_0400 data:" + JSON.stringify(data)); + expect(data).assertEqual(true); appAccountManager.removeAccount(name).then((data) =>{ console.debug("====>ActsAccountCheckAccountLabels_0400 delete_account_success"); done(); @@ -185,6 +188,7 @@ export default function ActsAccountAppAccess() { console.debug("====>ActsAccountCheckAccountLabels_0500 add_account_success"); appAccountManager.checkAccountLabels(name, owner, ['20-30']).then((data) =>{ console.debug("====>ActsAccountCheckAccountLabels_0500 data:" + JSON.stringify(data)); + expect(data).assertEqual(false); expect(account.Constants.KEY_REQUIRED_LABELS).assertEqual('requiredLabels') expect(account.Constants.KEY_BOOLEAN_RESULT).assertEqual('booleanResult') appAccountManager.removeAccount(name).then((data) =>{ @@ -220,6 +224,7 @@ export default function ActsAccountAppAccess() { console.debug("====>ActsAccountCheckAccountLabels_0600 add_account_success:" + JSON.stringify(data)); appAccountManager.checkAccountLabels('CheckAccountLabels_0600', owner, ['male']).then((data) =>{ console.debug("====>ActsAccountCheckAccountLabels_0600 data:" + JSON.stringify(data)); + expect(data).assertEqual(false); appAccountManager.removeAccount('CheckAccountLabels_0600').then((data) =>{ console.debug("====>ActsAccountCheckAccountLabels_0600 delete_account_success"); done(); 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 e9ee49326..4fd80ba18 100644 --- a/account/appaccount/actsaccounttest/src/main/js/test/Authenticator.test.js +++ b/account/appaccount/actsaccounttest/src/main/js/test/Authenticator.test.js @@ -69,7 +69,8 @@ export default function ActsAccountAuthenticator() { appAccountManager.checkAccountLabels(name, owner, ['level4'], (err, data)=>{ console.debug("====>ActsAccountCheckAccountLabels_0100 err:" + JSON.stringify(err)); expect(err).assertEqual(null); - console.debug("====>ActsAccountCheckAccountLabels_0100 data:" + JSON.stringify(data)); + console.debug("====>ActsAccountCheckAccountLabels_0100 data:" + JSON.stringify(data)); + expect(data).assertEqual(true); appAccountManager.deleteAccount(name, (err) =>{ console.debug("====>ActsAccountCheckAccountLabels_0100 deleteAccount_err:" + JSON.stringify(err)) expect(err).assertEqual(null); @@ -97,7 +98,8 @@ export default function ActsAccountAuthenticator() { appAccountManager.checkAccountLabels(name, owner, ['20-30'], (err, data)=>{ console.debug("====>ActsAccountCheckAccountLabels_0200 err:" + JSON.stringify(err)); expect(err).assertEqual(null); - console.debug("====>ActsAccountCheckAccountLabels_0200 data:" + JSON.stringify(data)); + console.debug("====>ActsAccountCheckAccountLabels_0200 data:" + JSON.stringify(data)); + expect(data).assertEqual(false); appAccountManager.deleteAccount(name, (err) =>{ console.debug("====>ActsAccountCheckAccountLabels_0200 deleteAccount_err:" + JSON.stringify(err)) expect(err).assertEqual(null); @@ -124,8 +126,8 @@ export default function ActsAccountAuthenticator() { appAccountManager.checkAccountLabels('CheckAccountLabels_0300', owner, ['male'], (err, data)=>{ console.debug("====>ActsAccountCheckAccountLabels_0300 err:" + JSON.stringify(err)); expect(err).assertEqual(null); - console.debug("====>ActsAccountCheckAccountLabels_0300 data:" + JSON.stringify(data)); - expect(data).assertEqual(false) + console.debug("====>ActsAccountCheckAccountLabels_0300 data:" + JSON.stringify(data)); + expect(data).assertEqual(false); appAccountManager.deleteAccount("CheckAccountLabels_0300", (err) =>{ console.debug("====>ActsAccountCheckAccountLabels_0300 deleteAccount_err:" + JSON.stringify(err)) expect(err).assertEqual(null); @@ -151,6 +153,7 @@ export default function ActsAccountAuthenticator() { console.debug("====>ActsAccountCheckAccountLabels_0400 add_account_success"); appAccountManager.checkAccountLabels(name, owner, ['level4']).then((data) =>{ console.debug("====>ActsAccountCheckAccountLabels_0400 data:" + JSON.stringify(data)); + expect(data).assertEqual(true); appAccountManager.deleteAccount(name).then((data) =>{ console.debug("====>ActsAccountCheckAccountLabels_0400 delete_account_success"); }).catch((err) =>{ @@ -164,7 +167,7 @@ export default function ActsAccountAuthenticator() { }) }).catch((err) => { console.debug("====>ActsAccountCheckAccountLabels_0400 add_account_err:" + JSON.stringify(err)) - expect(err.code!=0).assertTrue(); + expect().assertFail(); done(); }) }); @@ -182,6 +185,7 @@ export default function ActsAccountAuthenticator() { console.debug("====>ActsAccountCheckAccountLabels_0500 add_account_success"); appAccountManager.checkAccountLabels(name, owner, ['20-30']).then((data) =>{ console.debug("====>ActsAccountCheckAccountLabels_0500 data:" + JSON.stringify(data)); + expect(data).assertEqual(false); expect(account.Constants.KEY_REQUIRED_LABELS).assertEqual('requiredLabels') expect(account.Constants.KEY_BOOLEAN_RESULT).assertEqual('booleanResult') appAccountManager.deleteAccount(name).then((data) =>{ @@ -215,6 +219,7 @@ export default function ActsAccountAuthenticator() { console.debug("====>ActsAccountCheckAccountLabels_0600 add_account_success:" + JSON.stringify(data)); appAccountManager.checkAccountLabels('CheckAccountLabels_0600', owner, ['male']).then((data) =>{ console.debug("====>ActsAccountCheckAccountLabels_0600 data:" + JSON.stringify(data)); + expect(data).assertEqual(false); appAccountManager.deleteAccount('CheckAccountLabels_0600').then((data) =>{ console.debug("====>ActsAccountCheckAccountLabels_0600 delete_account_success"); }).catch((err) =>{ -- GitLab