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

!9385 qrcode xts默认值case fix

Merge pull request !9385 from tengfan/qrcode_xts_0718
...@@ -114,6 +114,12 @@ struct QrCode { ...@@ -114,6 +114,12 @@ struct QrCode {
.width(197) .width(197)
.height(197) .height(197)
.key("QrCodeBackgroundColor") .key("QrCodeBackgroundColor")
QRCode(`${this.qrCodeValue}`)
.color($r('sys.color.ohos_id_color_foreground'))
.backgroundColor($r('sys.color.ohos_id_color_background'))
.width(197)
.height(197)
.key("QrCodeDefault")
} }
.width('100%') .width('100%')
.height('100%') .height('100%')
......
...@@ -129,9 +129,12 @@ export default function qrCodeJsunit() { ...@@ -129,9 +129,12 @@ export default function qrCodeJsunit() {
} }
await Utils.sleep(2000); await Utils.sleep(2000);
var strJson = getInspectorByKey('QrCodeColor'); var strJson = getInspectorByKey('QrCodeColor');
var strJsonDefault = getInspectorByKey('QrCodeDefault');
var obj = JSON.parse(strJson); var obj = JSON.parse(strJson);
var objDefault = JSON.parse(strJsonDefault);
console.info("[test_qrCode_004] component obj is: " + JSON.stringify(obj)); console.info("[test_qrCode_004] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.color).assertEqual('#FF000000'); console.info("[test_qrCode_004] component objDefault is: " + JSON.stringify(objDefault));
expect(obj.$attrs.color).assertEqual(objDefault.$attrs.color);
done(); done();
}); });
...@@ -181,10 +184,13 @@ export default function qrCodeJsunit() { ...@@ -181,10 +184,13 @@ export default function qrCodeJsunit() {
} }
await Utils.sleep(2000); await Utils.sleep(2000);
var strJson = getInspectorByKey('QrCodeColor'); var strJson = getInspectorByKey('QrCodeColor');
var strJsonDefault = getInspectorByKey('QrCodeDefault');
var obj = JSON.parse(strJson); var obj = JSON.parse(strJson);
var objDefault = JSON.parse(strJsonDefault);
console.info("[test_qrCode_006] component obj is: " + JSON.stringify(obj)); console.info("[test_qrCode_006] component obj is: " + JSON.stringify(obj));
console.info("[test_qrCode_006] component objDefault is: " + JSON.stringify(objDefault));
// 非法入参默认初始值 // 非法入参默认初始值
expect(obj.$attrs.backgroundColor).assertEqual('#FFFFFFFF'); expect(obj.$attrs.backgroundColor).assertEqual(objDefault.$attrs.backgroundColor);
done(); done();
}); });
......
...@@ -60,6 +60,11 @@ struct QRCodePage { ...@@ -60,6 +60,11 @@ struct QRCodePage {
Text('backgroundColor').fontSize(9).width('90%').fontColor(0xCCCCCC).fontSize(30) Text('backgroundColor').fontSize(9).width('90%').fontColor(0xCCCCCC).fontSize(30)
QRCode(this.value).width(200).height(200).backgroundColor(this.backColor).key('qr2') QRCode(this.value).width(200).height(200).backgroundColor(this.backColor).key('qr2')
Text(this.text).fontSize(20).margin(10).key('text') Text(this.text).fontSize(20).margin(10).key('text')
QRCode(this.value).width(200).height(200)
.color($r('sys.color.ohos_id_color_foreground'))
.backgroundColor($r('sys.color.ohos_id_color_background'))
.key('qrDefault')
}.width('100%').margin({ top: 5 }) }.width('100%').margin({ top: 5 })
} }
} }
\ No newline at end of file
...@@ -47,12 +47,15 @@ export default function QRCodeJsunit() { ...@@ -47,12 +47,15 @@ export default function QRCodeJsunit() {
// Get the information of the QRCode component // Get the information of the QRCode component
console.info('[QRCodeJsunit_0100] START'); console.info('[QRCodeJsunit_0100] START');
let strJson = getInspectorByKey('qr'); let strJson = getInspectorByKey('qr');
let strJsonDefault = getInspectorByKey('qrDefault');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
let objDefault = JSON.parse(strJsonDefault);
console.info("[QRCodeJsunit_0100] component obj is: " + JSON.stringify(obj)); console.info("[QRCodeJsunit_0100] component obj is: " + JSON.stringify(obj));
console.info("[QRCodeJsunit_0100] component objDefault is: " + JSON.stringify(objDefault));
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
expect(obj.$attrs.value).assertEqual('normal'); expect(obj.$attrs.value).assertEqual('normal');
expect(obj.$attrs.color).assertEqual('#FF000000'); expect(obj.$attrs.color).assertEqual(objDefault.$attrs.color);
expect(obj.$attrs.backgroundColor).assertEqual('#FFFFFFFF'); expect(obj.$attrs.backgroundColor).assertEqual(objDefault.$attrs.backgroundColor);
console.info('[QRCodeJsunit_0100] END'); console.info('[QRCodeJsunit_0100] END');
done(); done();
}); });
...@@ -118,9 +121,12 @@ export default function QRCodeJsunit() { ...@@ -118,9 +121,12 @@ export default function QRCodeJsunit() {
globalThis.value.message.notify({name:'backgroundColor',value:'test'}) globalThis.value.message.notify({name:'backgroundColor',value:'test'})
await CommonFunc.sleep(2000); await CommonFunc.sleep(2000);
let strJson1 = getInspectorByKey('qr2'); let strJson1 = getInspectorByKey('qr2');
let strJsonDefault = getInspectorByKey('qrDefault');
let obj1 = JSON.parse(strJson1); let obj1 = JSON.parse(strJson1);
let objDefault = JSON.parse(strJsonDefault);
console.info("[QRCodeJsunit_0500] component obj1 is: " + JSON.stringify(obj1)); console.info("[QRCodeJsunit_0500] component obj1 is: " + JSON.stringify(obj1));
expect(obj1.$attrs.backgroundColor).assertEqual('#FFFFFFFF'); console.info("[QRCodeJsunit_0500] component objDefault is: " + JSON.stringify(objDefault));
expect(obj1.$attrs.backgroundColor).assertEqual(objDefault.$attrs.backgroundColor);
console.info('[QRCodeJsunit_0500] END'); console.info('[QRCodeJsunit_0500] END');
done(); done();
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册