未验证 提交 8113a52a 编写于 作者: O openharmony_ci 提交者: Gitee

!6487 fix formswithoutpermtest

Merge pull request !6487 from xinking129/master
......@@ -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()
}
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册