diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/test/GetAllFormsInfo.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/test/GetAllFormsInfo.test.ets index f38f9e7cb52e3a4d3a932134072146acc6aacaea..28b756d6c3fbf729236f865246b880d7ba516485 100644 --- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/test/GetAllFormsInfo.test.ets +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formswithoutpermtest/entry/src/main/ets/test/GetAllFormsInfo.test.ets @@ -17,7 +17,7 @@ import formHost from '@ohos.application.formHost'; import { describe, expect, it } from '@ohos/hypium' export const getAllFormsInfoTest = (describeName, filterParameter) => { - const ERR_OK_CODE = 0; + const ERR_OK_CODE = 2; const ERR_OK = `success`; describe(`${describeName}`, () => { @@ -35,7 +35,7 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => { try { formHost.getAllFormsInfo((error, data) => { console.log(`${callbackName} getAllFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); - expect(JSON.stringify(data)).assertEqual(`[]`); + expect(JSON.stringify(data)).assertEqual(undefined); expect(error.code).assertEqual(ERR_OK_CODE); done(); console.log(`==========${callbackName} ${describeName} end==========`); @@ -58,13 +58,13 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => { try { const data = await formHost.getAllFormsInfo(); console.log(`${promiseName} getAllFormsInfo data: ${JSON.stringify(data)}`); - expect(JSON.stringify(data)).assertEqual(`[]`); + expect().assertFail(); done(); console.log(`==========${promiseName} ${describeName} end==========`); } catch (error) { console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); console.log(`${promiseName} should not reach here`); - expect().assertFail(); + expect(error.code).assertEqual(ERR_OK_CODE); done() } });