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

!5768 settingsdata新增接口用例覆盖

Merge pull request !5768 from 安宁/OpenHarmony-3.2-Beta3
# Copyright (C) 2021 Huawei Device Co., Ltd. # Copyright (C) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
......
# Copyright (C) 2021 Huawei Device Co., Ltd. # Copyright (C) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
......
# Copyright (c) 2021 Huawei Device Co., Ltd. # Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
......
...@@ -1183,5 +1183,74 @@ export default function settingUiJsunit() { ...@@ -1183,5 +1183,74 @@ export default function settingUiJsunit() {
return; return;
} }
}); });
it('settings_get_value_113',0,async function(done){
try{console.info('test settings_get_value_113 start');
settings.enableAirplaneMode(false,(err,data)=>{console.info('settings test enableAirplaneMode callback ssss');
console.info('settings test enableAirplaneMode callback err'+JSON.stringify(err.code));
expect(JSON.stringify(err.code)).assertEqual("801");
done();
})
}catch(err){console.info('settings test enableAirplaneMode try catch err');
expect(true).assertTrue();
done();
return;
}});
it('settings_get_value_114',0,async function(done){
try{
settings.enableAirplaneMode(false).then((data)=>{
console.info('settings test enableAirplaneMode promise data'+JSON.stringify(data));
expect(false).assertTrue();
done();
}).catch((err)=>{
console.info('settings test enableAirplaneMode promise err'+JSON.stringify(err.code));
expect(JSON.stringify(err.code)).assertEqual("801");
done();
return;
})
}catch(err){
console.info('settings test enableAirplaneMode try catch err'+JSON.stringify(err));
expect(true).assertTrue();
done();
return;
}
});
it('settings_get_value_115',0,async function (done) {
try{
settings.canShowFloating((err,data)=>{
console.info('settings test canShowFloating promise err'+JSON.stringify(err.code));
expect(JSON.stringify(err.code)).assertEqual("801");
done();
})
}catch(err){
console.info('settings test canShowFloating promise err'+toString(err));
expect(true).assertTrue();
done();
return;
}
});
it('settings_get_value_116',0,async function (done) {
try{
let str = {"code":801};
settings.canShowFloating().then((data)=>{
console.info('settings test canShowFloating promise err'+toString(data));
expect(toString(err)).assertEqual(str);
done();
}).catch((err)=>{
console.info('settings test canShowFloating promise err'+JSON.stringify(err.code));
expect(JSON.stringify(err.code)).assertEqual("801");
done();
return;
})
}catch(err){
console.info('settings test canShowFloating promise err'+toString(err));
expect(true).assertTrue();
done();
return;
}
});
}) })
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册