From 7f4c6693f1f1e39e99377aa663da47955675bc82 Mon Sep 17 00:00:00 2001 From: chengxingzhen Date: Mon, 14 Mar 2022 11:48:08 +0800 Subject: [PATCH] =?UTF-8?q?wantConstant:crateFormBindingData=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chengxingzhen --- .../src/main/js/test/FormsZeroJsunit.test.js | 21 ++++++++++ .../src/main/js/test/ActsGetWantAllTest.js | 39 +++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/js/test/FormsZeroJsunit.test.js b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/js/test/FormsZeroJsunit.test.js index 6dbf59aea..30f5ebdd4 100644 --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/js/test/FormsZeroJsunit.test.js +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/js/test/FormsZeroJsunit.test.js @@ -13,6 +13,7 @@ * limitations under the License. */ +import formBindingData from "@ohos.application.formBindingData" import formManager from '@ohos.ability.formManager' import {describe, it, expect} from 'deccjsunit/index' @@ -87,4 +88,24 @@ describe('ActsFormsZeroTest', function () { console.log("FMS_getFormsInfo_0300_promise end, ret:" + ret); }) + /** + * @tc.name CreateFormBindingData test + * @tc.number FMS_CreateFormBindingData_0100 + * @tc.desc Creates data and returns a data object + */ + it('FMS_CreateFormBindingData_0100', 0, async function (done) { + console.log("FMS_CreateFormBindingData_0100 begin"); + let dataObj = { + temperature:"22c", + "time":"22:00", + "test":22, + "test3":true + }; + let obj = formBindingData.createFormBindingData(JSON.stringify(dataObj)); + console.log('FMS_CreateFormBindingData_0100, obj.data:' + obj.data); + expect(JSON.stringify(dataObj)).assertEqual(obj.data); + done(); + console.log("FMS_CreateFormBindingData_0100 end"); + }) + }) diff --git a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/test/ActsGetWantAllTest.js b/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/test/ActsGetWantAllTest.js index 0de6aa904..a83300917 100755 --- a/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/test/ActsGetWantAllTest.js +++ b/aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/test/ActsGetWantAllTest.js @@ -1011,6 +1011,45 @@ describe('ActsGetWantTest', function () { } console.log('ACTS_GetWant_2000 end'); }); + + /** + * @tc.number: SUB_AA_OpenHarmony_wantConstantEnumeration_0100 + * @tc.name: Check the enumerated value ACTION_IMAGE_CAPTURE of wantConstant. + * @tc.desc: Check the enumerated value ACTION_IMAGE_CAPTURE of wantConstant. + */ + it('SUB_AA_OpenHarmony_wantConstantEnumeration_0100',0, async function (done) { + console.log("SUB_AA_OpenHarmony_wantConstantEnumeration_0100 --- start") + let image = wantConstant.Action.ACTION_IMAGE_CAPTURE + expect(image).assertEqual("ohos.want.action.imageCapture") + console.log("SUB_AA_OpenHarmony_wantConstantEnumeration_0100 --- end") + done() + }) + + /** + * @tc.number: SUB_AA_OpenHarmony_wantConstantEnumeration_0200 + * @tc.name: Check the enumerated value ACTION_VIDEO_CAPTURE of wantConstant. + * @tc.desc: Check the enumerated value ACTION_VIDEO_CAPTURE of wantCconstant. + */ + it('SUB_AA_OpenHarmony_wantConstantEnumeration_0200',0, async function (done) { + console.log("SUB_AA_OpenHarmony_wantConstantEnumeration_0200 --- start") + let video = wantConstant.Action.ACTION_VIDEO_CAPTURE + expect(video).assertEqual("ohos.want.action.videoCapture") + console.log("SUB_AA_OpenHarmony_wantConstantEnumeration_0200 --- end") + done() + }) + + /** + * @tc.number: SUB_AA_OpenHarmony_wantConstantEnumeration_0300 + * @tc.name: Check the enumerated value ACTION_APP_ACCOUNT_OAUTH of wantConstant. + * @tc.desc: Check the enumerated value ACTION_APP_ACCOUNT_OAUTH of wantConstant. + */ + it('SUB_AA_OpenHarmony_wantConstantEnumeration_0300',0, async function (done) { + console.log("SUB_AA_OpenHarmony_wantConstantEnumeration_0300 --- start") + let app = wantConstant.ACTION_APP_ACCOUNT_OAUTH + expect(app).assertEqual("ohos.account.appAccount.action.oauth") + console.log("SUB_AA_OpenHarmony_wantConstantEnumeration_0300 --- end") + done() + }) function checkOnAbilityResult(data) { console.info('====> ACTS_StartAbilityForResult_2000 start ability=====>' + JSON.stringify(data)) -- GitLab