未验证 提交 a979bf36 编写于 作者: 姜欢欢 提交者: Gitee

update SmsMmsJsunit.test.ets.

Signed-off-by: N姜欢欢 <jianghuanhuan@huawei.com>
上级 0a5d0310
......@@ -15,6 +15,7 @@
import { describe, expect, it } from '@ohos/hypium';
import sms from '@ohos.telephony.sms';
import radio from '@ohos.telephony.radio';
import sim from '@ohos.telephony.sim';
export default function smsUiJsunit() {
describe('smsUiJsunit', function () {
......@@ -131,20 +132,18 @@ export default function smsUiJsunit() {
sms.getDefaultSmsSimId((err, data) => {
if(err){
console.info("Telephony_Sms_getDefaultSmsSimId_CallBack_0100 err = " + JSON.stringify(data));
radio.isRadioOn(0, (err, data) => {
console.info('Telephony_Sms_getDefaultSmsSimId_CallBack_0100 isRadioOn err' + JSON.stringify(err) + ' data ' + JSON.stringify(data));
if (!err) {
expect().assertFail();
}
});
expect(true).assertTrue();
done();
return;
}
console.log(`Telephony_Sms_getDefaultSmsSimId_CallBack_0100 callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
expect(true).assertTrue();
sim.hasSimCard(0, (err, data) => {
console.log(`Telephony_Sms_getDefaultSmsSimId_CallBack_0100 hasSimCard callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
expect(data).assertTrue();
done();
});
});
});
/**
* @tc.number Telephony_Sms_getDefaultSmsSimId_Promise_0100
* @tc.name Test getOpName interface
......@@ -154,16 +153,14 @@ export default function smsUiJsunit() {
let promise = sms.getDefaultSmsSimId();
promise.then(data => {
console.info("Telephony_Sms_getDefaultSmsSimId_Promise_0100 data = " + JSON.stringify(data));
expect(true).assertTrue();
sim.hasSimCard(0, (err, data) => {
console.log(`Telephony_Sms_getDefaultSmsSimId_Promise_0100 hasSimCard callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
expect(data).assertTrue();
done();
});
}).catch(err => {
console.info("Telephony_Sms_getDefaultSmsSimId_Promise_0100 err = " + JSON.stringify(err));
radio.isRadioOn(0, (err, data) => {
console.info('Telephony_Sms_getDefaultSmsSimId_Promise_0100 isRadioOn err' + JSON.stringify(err) + ' data ' + JSON.stringify(data));
if (!err) {
expect().assertFail();
}
});
expect(true).assertTrue();
done();
});
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册