From 6eb4ccd62a9772e004eb9b7431f26ba4ae79da5f Mon Sep 17 00:00:00 2001 From: bayanxing Date: Sat, 19 Feb 2022 17:46:52 +0800 Subject: [PATCH] add test cases Signed-off-by: bayanxing --- ace/ace_standard/src/main/config.json | 6 +- .../main/js/default/pages/div/prop/index.css | 347 +++++++++ .../main/js/default/pages/div/prop/index.hml | 165 +++++ .../main/js/default/pages/div/prop/index.js | 121 +++ .../default/pages/div/{ => router}/index.css | 0 .../default/pages/div/{ => router}/index.hml | 24 +- .../default/pages/div/{ => router}/index.js | 0 .../main/js/default/pages/div/style/index.css | 354 +++++++++ .../main/js/default/pages/div/style/index.hml | 111 +++ .../main/js/default/pages/div/style/index.js | 117 +++ .../src/main/js/default/test/List.test.js | 1 + .../default/test/commonComponentJsApi.test.js | 4 +- .../src/main/js/default/test/divProps.test.js | 688 ++++++++++++++++++ 13 files changed, 1922 insertions(+), 16 deletions(-) create mode 100644 ace/ace_standard/src/main/js/default/pages/div/prop/index.css create mode 100644 ace/ace_standard/src/main/js/default/pages/div/prop/index.hml create mode 100644 ace/ace_standard/src/main/js/default/pages/div/prop/index.js rename ace/ace_standard/src/main/js/default/pages/div/{ => router}/index.css (100%) rename ace/ace_standard/src/main/js/default/pages/div/{ => router}/index.hml (96%) rename ace/ace_standard/src/main/js/default/pages/div/{ => router}/index.js (100%) create mode 100644 ace/ace_standard/src/main/js/default/pages/div/style/index.css create mode 100644 ace/ace_standard/src/main/js/default/pages/div/style/index.hml create mode 100644 ace/ace_standard/src/main/js/default/pages/div/style/index.js create mode 100644 ace/ace_standard/src/main/js/default/test/divProps.test.js diff --git a/ace/ace_standard/src/main/config.json b/ace/ace_standard/src/main/config.json index b05531c3c..1dfb4a8b4 100755 --- a/ace/ace_standard/src/main/config.json +++ b/ace/ace_standard/src/main/config.json @@ -76,7 +76,7 @@ "pages/progress/index", "pages/qrcode/index", "pages/select/index", - "pages/div/index", + "pages/div/router/index", "pages/badge/index", "pages/dialog/index", "pages/form/index", @@ -120,7 +120,9 @@ "pages/animateMotion/index", "pages/animateTransform/index", "pages/textPath/index", - "pages/tspan/index" + "pages/tspan/index", + "pages/div/prop/index", + "pages/div/style/index" ], "name": "default", "window": { diff --git a/ace/ace_standard/src/main/js/default/pages/div/prop/index.css b/ace/ace_standard/src/main/js/default/pages/div/prop/index.css new file mode 100644 index 000000000..e815b3669 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/div/prop/index.css @@ -0,0 +1,347 @@ +/** + * Copyright (c) 2022 Shenzhen kaiHong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + flex-direction:row; + width:100%; + height:100%; +} + +.title{ + width: 100%; + font-size: 18px; + margin: 2px; + padding: 2px; + font-weight: bold; + text-align: center; +} + +.sub-title{ + width: 100%; + font-size: 14px; + text-align: left; + margin: 2px; + padding: 2px; +} + +.prop-container{ + flex-direction: column; + flex-weight: 1; +} + +#idProp { + flex-weight: 1; + background-color:#f00000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +.classProp { + flex-weight: 1; + background-color:#0f0000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#classPropNone { + flex-weight: 1; + background-color:#0000e0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#refProp { + flex-weight: 1; + background-color:#00f000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#refPropNone { + flex-weight: 1; + background-color:#00000e; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#disabledPropTrue { + flex-weight: 1; + background-color:#000f00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#disabledPropFalse { + flex-weight: 1; + background-color:#0000f0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#disabledPropNone { + flex-weight: 1; + background-color:#d00000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#focusablePropTrue { + flex-weight: 1; + background-color:#00000f; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#focusablePropFalse { + flex-weight: 1; + background-color:#ff0000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#focusablePropNone { + flex-weight: 1; + background-color:#0d0000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dataProp { + flex-weight: 1; + background-color:#0ff000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dataPropNone { + flex-weight: 1; + background-color:#00d000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#clickEffectPropSmall { + height: 15px; + background-color:#00ff00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#clickEffectPropMedium { + height: 15px; + background-color:#000ff0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#clickEffectPropLarge { + height: 15px; + background-color:#fff000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#clickEffectPropNone{ + height: 15px; + background-color:#000d00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dirPropRtl { + flex-weight: 1; + background-color:#0fff00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dirPropAuto { + flex-weight: 1; + background-color:#00fff0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dirPropLtr { + flex-weight: 1; + background-color:#000fff; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dirPropNone { + flex-weight: 1; + background-color:#0000d0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#forPropNull { + flex-weight: 1; + background-color:#ffff00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#forPropOne { + flex-weight: 1; + background-color:#00e000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#forPropThree { + flex-weight: 1; + background-color:#000e00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#ifPropTrue { + flex-weight: 1; + background-color:#0ffff0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#ifPropFalse { + flex-weight: 1; + background-color:#00ffff; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#ifPropNone { + flex-weight: 1; + background-color:#00000d; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#showPropTrue { + flex-weight: 1; + background-color:#e00000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#showPropFalse { + flex-weight: 1; + background-color:#0e0000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#showPropNone { + flex-weight: 1; + background-color:#c00000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +.specific-container{ + flex-direction: column; + flex-weight: 1; +} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/div/prop/index.hml b/ace/ace_standard/src/main/js/default/pages/div/prop/index.hml new file mode 100644 index 000000000..d53736f4d --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/div/prop/index.hml @@ -0,0 +1,165 @@ + + +
+
+ + div通用属性 + + + + 通用属性 -- id + +
+
+ + + 通用属性 -- class + +
+
+
+
+ + + + 通用属性 -- style + +
+
+ + + 通用属性 -- ref + +
+
+
+
+ + + 通用属性 -- disabled + +
+
+
+
+
+
+ + + 通用属性 -- focusable + +
+
+
+
+
+
+ + + 通用属性 -- data-* + +
+
+
+
+ + + 通用属性 -- click-effect + +
+
+
+
+
+
+
+
+ + + 通用属性 -- dir + +
+
+
+
+
+
+
+
+ + + 渲染属性 -- for + +
+
+
+
+
+
+ + + 渲染属性 -- if + +
+
+ + + 渲染属性 -- show + +
+
+
+
+
+
+
+ +
+
+
+ + div特有属性 + +
+
diff --git a/ace/ace_standard/src/main/js/default/pages/div/prop/index.js b/ace/ace_standard/src/main/js/default/pages/div/prop/index.js new file mode 100644 index 000000000..5625ecb45 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/div/prop/index.js @@ -0,0 +1,121 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import prompt from '@system.prompt'; + +export default { + data:{ + listOne:[{}], + listThree:[{},{},{}], + idProp : null, + classProp : null, + classPropNone : null, + styleProp : null, + refProp : null, + refPropNone : null, + disabledPropTrue : null, + disabledPropFalse : null, + disabledPropNone : null, + focusablePropTrue : null, + focusablePropFalse : null, + focusablePropNone : null, + dataProp : null, + dataPropNone : null, + clickEffectPropSmall : null, + clickEffectPropMedium : null, + clickEffectPropLarge : null, + clickEffectPropNone : null, + dirPropRtl : null, + dirPropAuto : null, + dirPropLtr : null, + dirPropNone : null, + forPropNull : null, + forPropOne : null, + forPropThree : null, + ifPropTrue : null, + ifPropFalse : null, + ifPropNone : null, + showPropTrue : null, + showPropFalse : null, + showPropNone : null + }, + + onShow(){ + this.getCommonPropValues(); + globalThis.value = { + idProp : this.idProp, + classProp : this.classProp, + classPropNone : this.classPropNone, + styleProp : this.styleProp, + refProp : this.refProp, + refPropNone : this.refPropNone, + disabledPropTrue : this.disabledPropTrue, + disabledPropFalse : this.disabledPropFalse, + disabledPropNone : this.disabledPropNone, + focusablePropTrue : this.focusablePropTrue, + focusablePropFalse : this.focusablePropFalse, + focusablePropNone : this.focusablePropNone, + dataProp : this.dataProp, + dataPropNone : this.dataPropNone, + clickEffectPropSmall : this.clickEffectPropSmall, + clickEffectPropMedium : this.clickEffectPropMedium, + clickEffectPropLarge : this.clickEffectPropLarge, + clickEffectPropNone : this.clickEffectPropNone, + dirPropRtl : this.dirPropRtl, + dirPropAuto : this.dirPropAuto, + dirPropLtr : this.dirPropLtr, + dirPropNone : this.dirPropNone, + forPropNull : this.forPropNull, + forPropOne : this.forPropOne, + forPropThree : this.forPropThree, + ifPropTrue : this.ifPropTrue, + showPropTrue : this.showPropTrue, + showPropFalse : this.showPropFalse, + showPropNone : this.showPropNone + } + }, + + getCommonPropValues(){ + this.idProp = this.$element("idProp").getInspector() + this.classProp = this.$element("classProp").getInspector() + this.classPropNone = this.$element("classPropNone").getInspector() + this.styleProp = this.$element("styleProp").getInspector() + this.refProp = this.$element("refProp").getInspector() + this.refPropNone = this.$element("refPropNone").getInspector() + this.disabledPropTrue = this.$element("disabledPropTrue").getInspector() + this.disabledPropFalse = this.$element("disabledPropFalse").getInspector() + this.disabledPropNone = this.$element("disabledPropNone").getInspector() + this.focusablePropTrue = this.$element("focusablePropTrue").getInspector() + this.focusablePropFalse = this.$element("focusablePropFalse").getInspector() + this.focusablePropNone = this.$element("focusablePropNone").getInspector() + this.dataProp = this.$element("dataProp").getInspector() + this.dataPropNone = this.$element("dataPropNone").getInspector() + this.clickEffectPropSmall = this.$element("clickEffectPropSmall").getInspector() + this.clickEffectPropMedium = this.$element("clickEffectPropMedium").getInspector() + this.clickEffectPropLarge = this.$element("clickEffectPropLarge").getInspector() + this.clickEffectPropNone = this.$element("clickEffectPropNone").getInspector() + this.dirPropRtl = this.$element("dirPropRtl").getInspector() + this.dirPropAuto = this.$element("dirPropAuto").getInspector() + this.dirPropLtr = this.$element("dirPropLtr").getInspector() + this.dirPropNone = this.$element("dirPropNone").getInspector() + this.forPropNull = this.$element("forPropNull").getInspector() + this.forPropOne = this.$element("forPropOne").getInspector() + this.forPropThree = this.$element("forPropThree").getInspector() + this.ifPropTrue = this.$element("ifPropTrue").getInspector() + this.showPropTrue = this.$element("showPropTrue").getInspector() + this.showPropFalse = this.$element("showPropFalse").getInspector() + this.showPropNone = this.$element("showPropNone").getInspector() + }, +} diff --git a/ace/ace_standard/src/main/js/default/pages/div/index.css b/ace/ace_standard/src/main/js/default/pages/div/router/index.css similarity index 100% rename from ace/ace_standard/src/main/js/default/pages/div/index.css rename to ace/ace_standard/src/main/js/default/pages/div/router/index.css diff --git a/ace/ace_standard/src/main/js/default/pages/div/index.hml b/ace/ace_standard/src/main/js/default/pages/div/router/index.hml similarity index 96% rename from ace/ace_standard/src/main/js/default/pages/div/index.hml rename to ace/ace_standard/src/main/js/default/pages/div/router/index.hml index 44c740e3f..edfb36f17 100644 --- a/ace/ace_standard/src/main/js/default/pages/div/index.hml +++ b/ace/ace_standard/src/main/js/default/pages/div/router/index.hml @@ -1,5 +1,5 @@ + +
+
+ + div通用样式 + + + + 通用样式 1-8 \n width height padding margin border opacity align-self + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + 通用样式9-20 \n display flex z-index position + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + 通用样式21-23 box-shadow + +
+
+
+
+
+
+
+
+ + + 通用样式23-25 visibility clip-path + +
+
+
+
+ + + 通用样式26-31 background + +
+
+
+
+
+
+
+
+
+
+ + + 通用样式32 clip-path image-fill mask-image + +
+
+
+
+ diff --git a/ace/ace_standard/src/main/js/default/pages/div/style/index.js b/ace/ace_standard/src/main/js/default/pages/div/style/index.js new file mode 100644 index 000000000..8452f14bb --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/div/style/index.js @@ -0,0 +1,117 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export default { + data:{ + styleOne : null, + styleTwo : null, + styleThree : null, + styleFour : null, + styleFive : null, + styleSix : null, + styleSeven : null, + styleEight : null, + styleNine : null, + styleTen : null, + styleEleven : null, + styleTwelve : null, + styleThirteen : null, + styleFourteen : null, + styleFifteen : null, + styleSixteen : null, + styleSeventeen : null, + styleEighteen : null, + styleNineteen : null, + styleTwenty : null, + styleTwentyOne : null, + styleTwentyTwo : null, + styleTwentyThree : null, + styleTwentyFour : null, + styleTwentyFive : null, + styleTwentySix : null, + styleTwentySeven : null, + styleTwentyNine : null, + styleThirty : null, + styleThirtyOne : null, + styleThirtyTwo : null + }, + + onShow(){ + this.getCommonStyleValues(); + globalThis.value = { + styleOne : this.styleOne, + styleTwo : this.styleTwo, + styleThree : this.styleThree, + styleFour : this.styleFour, + styleFive : this.styleFive, + styleSix : this.styleSix, + styleSeven : this.styleSeven, + styleEight : this.styleEight, + styleNine : this.styleNine, + styleTen : this.styleTen, + styleEleven : this.styleEleven, + styleTwelve : this.styleTwelve, + styleThirteen : this.styleThirteen, + styleFourteen : this.styleFourteen, + styleFifteen : this.styleFifteen, + styleSixteen : this.styleSixteen, + styleSeventeen : this.styleSeventeen, + styleEighteen : this.styleEighteen, + styleNineteen : this.styleNineteen, + styleTwenty : this.styleTwenty, + styleTwentyOne : this.styleTwentyOne, + styleTwentyTwo : this.styleTwentyTwo, + styleTwentyThree : this.styleTwentyThree, + styleTwentyFour : this.styleTwentyFour, + styleTwentyFive : this.styleTwentyFive, + styleTwentySix : this.styleTwentySix, + styleThirty : this.styleThirty, + styleThirtyOne : this.styleThirtyOne, + styleThirtyTwo : this.styleThirtyTwo + } + }, + + getCommonStyleValues(){ + this.styleOne = this.$element("styleOne").getInspector() + this.styleTwo = this.$element("styleTwo").getInspector() + this.styleThree = this.$element("styleThree").getInspector() + this.styleFour = this.$element("styleFour").getInspector() + this.styleFive = this.$element("styleFive").getInspector() + this.styleSix = this.$element("styleSix").getInspector() + this.styleSeven = this.$element("styleSeven").getInspector() + this.styleEight = this.$element("styleEight").getInspector() + this.styleNine = this.$element("styleNine").getInspector() + this.styleTen = this.$element("styleTen").getInspector() + this.styleEleven = this.$element("styleEleven").getInspector() + this.styleTwelve = this.$element("styleTwelve").getInspector() + this.styleThirteen = this.$element("styleThirteen").getInspector() + this.styleFourteen = this.$element("styleFourteen").getInspector() + this.styleFifteen = this.$element("styleFifteen").getInspector() + this.styleSixteen = this.$element("styleSixteen").getInspector() + this.styleSeventeen = this.$element("styleSeventeen").getInspector() + this.styleEighteen = this.$element("styleEighteen").getInspector() + this.styleNineteen = this.$element("styleNineteen").getInspector() + this.styleTwenty = this.$element("styleTwenty").getInspector() + this.styleTwentyOne = this.$element("styleTwentyOne").getInspector() + this.styleTwentyTwo = this.$element("styleTwentyTwo").getInspector() + this.styleTwentyThree = this.$element("styleTwentyThree").getInspector() + this.styleTwentyFour = this.$element("styleTwentyFour").getInspector() + this.styleTwentyFive = this.$element("styleTwentyFive").getInspector() + this.styleTwentySix = this.$element("styleTwentySix").getInspector() + this.styleThirty = this.$element("styleThirty").getInspector() + this.styleThirtyOne = this.$element("styleThirtyOne").getInspector() + this.styleThirtyTwo = this.$element("styleThirtyTwo").getInspector() + }, +} diff --git a/ace/ace_standard/src/main/js/default/test/List.test.js b/ace/ace_standard/src/main/js/default/test/List.test.js index b5203caf2..d5e71c783 100755 --- a/ace/ace_standard/src/main/js/default/test/List.test.js +++ b/ace/ace_standard/src/main/js/default/test/List.test.js @@ -16,3 +16,4 @@ require('./basicabilityapi.test.js') require('./mediaquery.test.js') require('./commonComponentJsApi.test.js') +require('./divProps.test.js') diff --git a/ace/ace_standard/src/main/js/default/test/commonComponentJsApi.test.js b/ace/ace_standard/src/main/js/default/test/commonComponentJsApi.test.js index 7528cdc8c..64500a161 100644 --- a/ace/ace_standard/src/main/js/default/test/commonComponentJsApi.test.js +++ b/ace/ace_standard/src/main/js/default/test/commonComponentJsApi.test.js @@ -630,7 +630,7 @@ describe('aceJsTest', function () { it('testDivComponent', 0, async function (done) { let result; let options = { - uri: 'pages/div/index' + uri: 'pages/div/router/index' } try { result = router.push(options) @@ -641,7 +641,7 @@ describe('aceJsTest', function () { await sleep(5000) let pages = router.getState(); console.info("[router.div] getState" + JSON.stringify(pages)); - expect("pages/div/").assertEqual(pages.path); + expect("pages/div/router/").assertEqual(pages.path); done(); }); diff --git a/ace/ace_standard/src/main/js/default/test/divProps.test.js b/ace/ace_standard/src/main/js/default/test/divProps.test.js new file mode 100644 index 000000000..ce2a669b8 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/divProps.test.js @@ -0,0 +1,688 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + + +describe('divPropsJsTest', function () { + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + }; + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('[divPropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/div/prop/index' + } + try { + result = router.push(options) + console.info("push divProps page success " + JSON.stringify(result)); + } catch (err) { + console.error("push divProps page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('[divPropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivIdProp + * @tc.desc ACE + */ + it('testDivIdProp', 0, async function (done) { + console.info('testDivIdProp START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('idProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivClassProp + * @tc.desc ACE + */ + it('testDivClassProp', 0, async function (done) { + console.info('testDivClassProp START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classProp); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('classProp') + expect(obj.$attrs.className).assertEqual('classProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivClassPropNone + * @tc.desc ACE + */ + it('testDivClassPropNone', 0, async function (done) { + console.info('testDivClassPropNone START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classPropNone); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('classPropNone') + expect(obj.$attrs.className).assertEqual(undefined) + console.info("[divProps] get className value is: " + JSON.stringify(obj.$attrs.className)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivStyleProp + * @tc.desc ACEs + */ +// it('testDivStyleProp', 0, async function (done) { +// console.info('testDivStyleProp START'); +// console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); +// +// let obj = JSON.parse(globalThis.value.styleProp); +// console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); +// console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); +// +// expect(obj.$type).assertEqual('div') +// expect(obj.$attrs.id).assertEqual('styleProp') +// expect(obj.$attrs.style).assertEqual(undefined) +// console.info("[divProps] get style value is: " + JSON.stringify(obj.$attrs.style)); +// +// expect(obj.$styles.width).assertEqual(undefined); +// console.info("[divProps] get style width value is: " + JSON.stringify(obj.$styles.width)); +// expect(obj.$styles.height).assertEqual(undefined); +// console.info("[divProps] get style height value is: " + JSON.stringify(obj.$styles.height)); +// expect(obj.$styles.get('background-color')).assertEqual(undefined); +// console.info("[divProps] get style background-color value is: " + JSON.stringify(obj.$styles.get('background-color'))); +// done(); +// }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivRefProp + * @tc.desc ACE + */ + it('testDivRefProp', 0, async function (done) { + console.info('testDivRefProp START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refProp); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('refProp') + expect(obj.$attrs.ref).assertEqual('refProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivRefPropNone + * @tc.desc ACE + */ + it('testDivRefPropNone', 0, async function (done) { + console.info('testDivRefPropNone START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refPropNone); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('refPropNone') + expect(obj.$attrs.ref).assertEqual(undefined) + console.info("[divProps] get ref value is: " + JSON.stringify(obj.$attrs.ref)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivDisabledPropTrue + * @tc.desc ACE + */ + it('testDivDisabledPropTrue', 0, async function (done) { + console.info('testDivDisabledPropTrue START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropTrue); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('disabledPropTrue') + expect(obj.$attrs.disabled).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivDisabledPropFalse + * @tc.desc ACE + */ + it('testDivDisabledPropFalse', 0, async function (done) { + console.info('testDivDisabledPropFalse START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropFalse); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('disabledPropFalse') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivDisabledPropNone + * @tc.desc ACE + */ + it('testDivDisabledPropNone', 0, async function (done) { + console.info('testDivDisabledPropNone START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropNone); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('disabledPropNone') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivFocusablePropTrue + * @tc.desc ACE + */ + it('testDivFocusablePropTrue', 0, async function (done) { + console.info('testDivFocusablePropTrue START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropTrue); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('focusablePropTrue') + expect(obj.$attrs.focusable).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivFocusablePropFalse + * @tc.desc ACE + */ + it('testDivFocusablePropFalse', 0, async function (done) { + console.info('testDivFocusablePropFalse START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropFalse); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('focusablePropFalse') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivFocusablePropNone + * @tc.desc ACE + */ + it('testDivFocusablePropNone', 0, async function (done) { + console.info('testDivFocusablePropNone START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropNone); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('focusablePropNone') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivDataProp + * @tc.desc ACE + */ + it('testDivDataProp', 0, async function (done) { + console.info('testDivDataProp START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataProp); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('dataProp') + expect(obj.$attrs.dataDiv).assertEqual(undefined); + console.info("[divProps] get dataDiv value is: " + JSON.stringify(obj.$attrs.dataDiv)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivDataPropNone + * @tc.desc ACE + */ + it('testDivDataPropNone', 0, async function (done) { + console.info('testDivDataPropNone START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataPropNone); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('dataPropNone') + expect(obj.$attrs.dataDiv).assertEqual(undefined) + console.info("[divProps] get dataDiv value is: " + JSON.stringify(obj.$attrs.dataDiv)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivClickEffectPropSmall + * @tc.desc ACE + */ + it('testDivClickEffectPropSmall', 0, async function (done) { + console.info('testDivClickEffectPropSmall START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropSmall); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('clickEffectPropSmall') + expect(obj.$attrs.clickEffect).assertEqual('spring-small') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivClickEffectPropMedium + * @tc.desc ACE + */ + it('testDivClickEffectPropMedium', 0, async function (done) { + console.info('testDivClickEffectPropMedium START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropMedium); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('clickEffectPropMedium') + expect(obj.$attrs.clickEffect).assertEqual('spring-medium') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivClickEffectPropLarge + * @tc.desc ACE + */ + it('testDivClickEffectPropLarge', 0, async function (done) { + console.info('testDivClickEffectPropLarge START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropLarge); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('clickEffectPropLarge') + expect(obj.$attrs.clickEffect).assertEqual('spring-large') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivClickEffectPropNone + * @tc.desc ACE + */ + it('testDivClickEffectPropNone', 0, async function (done) { + console.info('testDivClickEffectPropNone START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropNone); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('clickEffectPropNone') + expect(obj.$attrs.clickEffect).assertEqual(undefined) + console.info("[divProps] get clickEffect value is: " + JSON.stringify(obj.$attrs.clickEffect)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivDirPropRtl + * @tc.desc ACE + */ + it('testDivDirPropRtl', 0, async function (done) { + console.info('testDivDirPropRtl START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropRtl); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('dirPropRtl') + expect(obj.$attrs.dir).assertEqual('rtl') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivDirPropLtr + * @tc.desc ACE + */ + it('testDivDirPropLtr', 0, async function (done) { + console.info('testDivDirPropLtr START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropLtr); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('dirPropLtr') + expect(obj.$attrs.dir).assertEqual('ltr') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivDirPropAuto + * @tc.desc ACE + */ + it('testDivDirPropAuto', 0, async function (done) { + console.info('testDivDirPropAuto START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropAuto); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('dirPropAuto') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivDirPropNone + * @tc.desc ACE + */ + it('testDivDirPropNone', 0, async function (done) { + console.info('testDivDirPropNone START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropNone); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('dirPropNone') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivForPropNull + * @tc.desc ACE + */ + it('testDivForPropNull', 0, async function (done) { + console.info('testDivForPropNull START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropNull); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('forPropNull') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[divProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivForPropOne + * @tc.desc ACE + */ + it('testDivForPropOne', 0, async function (done) { + console.info('testDivForPropOne START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropOne); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('forPropOne') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[divProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivForPropThree + * @tc.desc ACE + */ + it('testDivForPropThree', 0, async function (done) { + console.info('testDivForPropThree START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropThree); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('forPropThree') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[divProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivIfPropTrue + * @tc.desc ACE + */ + it('testDivIfPropTrue', 0, async function (done) { + console.info('testDivIfPropTrue START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.ifPropTrue); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('ifPropTrue') + expect(obj.$attrs.if).assertEqual(undefined) + console.info("[divProps] get for value is: " + JSON.stringify(obj.$attrs.if)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivIfPropFalse + * @tc.desc ACE + */ + // it('testDivIfPropFalse', 0, async function (done) { + // console.info('testDivIfPropFalse START'); + // console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + // + // let obj = JSON.parse(globalThis.value.ifPropFalse); + // console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + // console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + // + // expect(obj.$type).assertEqual('div') + // expect(obj.$attrs.id).assertEqual('ifPropFalse') + // expect(obj.$attrs.if).assertEqual(false) + // done(); + // }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivIfPropNone + * @tc.desc ACE + */ + // it('testDivIfPropNone', 0, async function (done) { + // console.info('testDivIfPropNone START'); + // console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + // + // let obj = JSON.parse(globalThis.value.ifPropNone); + // console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + // console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + // + // expect(obj.$type).assertEqual('div') + // expect(obj.$attrs.id).assertEqual('ifPropNone') + // expect(obj.$attrs.if).assertEqual(false) + // done(); + // }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivShowPropTrue + * @tc.desc ACE + */ + it('testDivShowPropTrue', 0, async function (done) { + console.info('testDivShowPropTrue START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropTrue); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('showPropTrue') + expect(obj.$attrs.show).assertEqual('true') + console.info("[divProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivShowPropFalse + * @tc.desc ACE + */ + it('testDivShowPropFalse', 0, async function (done) { + console.info('testDivShowPropFalse START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropFalse); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('showPropFalse') + expect(obj.$attrs.show).assertEqual('false') + console.info("[divProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDivShowPropNone + * @tc.desc ACE + */ + it('testDivShowPropNone', 0, async function (done) { + console.info('testDivShowPropNone START'); + console.info("[divProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropNone); + console.info("[divProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[divProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('div') + expect(obj.$attrs.id).assertEqual('showPropNone') + expect(obj.$attrs.show).assertEqual('false') + console.info("[divProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); +}); -- GitLab