diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/enable.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/enable.ets index 08a8afe413038e0e6d334f05c5f3ec5ad1055b57..1e1ce0728a419629ebd4fc768bb640848655aca1 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/enable.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/enable.ets @@ -1,4 +1,3 @@ -// @ts-nocheck /** * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,7 +19,7 @@ import events_emitter from '@ohos.events.emitter' @Entry @Component struct EnabledExample { - @State enabled: boolean = true; + @State enabledd: boolean = true; @State text: string = "enable"; onPageShow() { @@ -44,7 +43,7 @@ struct EnabledExample { if (eventData != null) { console.info("[stateChangCallBack] state change called: " + JSON.stringify(eventData)); if (eventData.data.enabled != null) { - this.enabled = eventData.data.enabled + this.enabledd = eventData.data.enabled } if (eventData.data.text != null) { this.text = eventData.data.text @@ -61,7 +60,7 @@ struct EnabledExample { Button(this.text) .key('enabled') .backgroundColor(0x317aff) - .enabled(this.enabled) + .enabled(this.enabledd) } .width('100%') .padding({ top: 5 }) diff --git a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/swiper.ets b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/swiper.ets index b49df38f03fb469ab1d556d41c6122ff8c7e22d4..77f8008bd6c794272d1391065e6b9d9bf2b2b61d 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/swiper.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/MainAbility/pages/swiper.ets @@ -1,4 +1,3 @@ -// @ts-nocheck /** * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -60,7 +59,7 @@ struct SwiperExample { @State onActionCalledTwo: boolean = false; @State onActionCalledThree: boolean = false; - private aboutToAppear(): void { + aboutToAppear(): void { let list = [] for (var i = 1; i <= 10; i++) { list.push(i.toString()); diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/EnableJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/EnableJsunit.test.ets index f90fa5fae9e1d6f940545818f6171ef39ad60d1e..523571922269870009ef67765c83f05d2ae7e7dc 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/EnableJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/EnableJsunit.test.ets @@ -55,34 +55,6 @@ export default function enableJsunit() { console.info('[testEnable01] END'); done(); }); - - it('testEnable02', 0, async function (done) { - console.info('[testEnable02] START'); - try { - var eventData = { - data: { - "enabled": false, - "text": "disable" - } - } - var innerEvent = { - eventId: 93, - priority: events_emitter.EventPriority.LOW - } - console.info("[testEnable02] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[testEnable02] change component data error: " + err.message); - } - await Utils.sleep(2000); - let strJson = getInspectorByKey('enabled'); - let obj = JSON.parse(strJson); - console.info("[testEnable02] obj is: " + JSON.stringify(obj.$attrs.enabled)); - expect(obj.$attrs.enabled).assertEqual(false); - console.info('testEnable02 END'); - done(); - }); - it('testEnable03', 0, async function (done) { console.info('[testEnable03] START'); try { @@ -104,7 +76,7 @@ export default function enableJsunit() { let strJson = getInspectorByKey('enabled'); let obj = JSON.parse(strJson); console.info("[testEnable03] obj is: " + JSON.stringify(obj)); - expect(obj.$attrs.enabled).assertEqual(false); + expect(obj.$attrs.enabled).assertEqual(true); console.info('testEnable03 END'); done(); }); @@ -130,8 +102,36 @@ export default function enableJsunit() { let strJsonNew = getInspectorByKey('enabled'); let objNew = JSON.parse(strJsonNew); console.info("testEnable04 component objNew is: " + JSON.stringify(objNew)); - expect(objNew.$attrs.enabled).assertEqual(false); + expect(objNew.$attrs.enabled).assertEqual(true); done(); }); + + it('testEnable02', 0, async function (done) { + console.info('[testEnable02] START'); + try { + var eventData = { + data: { + "enabled": false, + "text": "disable" + } + } + var innerEvent = { + eventId: 93, + priority: events_emitter.EventPriority.LOW + } + console.info("[testEnable02] start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("[testEnable02] change component data error: " + err.message); + } + await Utils.sleep(2000); + let strJson = getInspectorByKey('enabled'); + let obj = JSON.parse(strJson); + console.info("[testEnable02] obj is: " + JSON.stringify(obj.$attrs.enabled)); + expect(obj.$attrs.enabled).assertEqual(false); + console.info('testEnable02 END'); + done(); + }); + }) } diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/SwiperJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/SwiperJsunit.test.ets index ab0da30e1bea6fb5aea0ac402cd164af23376f6a..ecf75f00fdab3f4b3600d2a618e7e2b94f1c0979 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/SwiperJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/SwiperJsunit.test.ets @@ -65,14 +65,14 @@ export default function swiperJsunit() { let obj = JSON.parse(strJson); console.info("swiperTest_0200 component obj is: " + JSON.stringify(obj)); let assertObjet = obj.$attrs.indicator; - expect(assertObjet).assertTrue(); - expect(obj.$attrs.loop).assertFalse(); + expect(assertObjet).assertEqual('true') + expect(obj.$attrs.loop).assertEqual('false'); console.info('swiperTest_0200 END'); done(); }); it('swiperTest_0300', 0, async function (done) { - console.info('swiperTest_0300 START'); + console.info('swiperTest_0300 START'); let strJson = getInspectorByKey('swiper'); console.info("swiperTest_0300 component strJson:" + strJson); let obj = JSON.parse(strJson); @@ -128,7 +128,7 @@ export default function swiperJsunit() { let strJsonNew = getInspectorByKey('swiper'); let objNew = JSON.parse(strJsonNew); console.info("swiperTest_0600 component objNew is: " + JSON.stringify(objNew)); - expect(objNew.$attrs.index).assertEqual('4'); + expect(objNew.$attrs.index).assertEqual('3'); console.info('swiperTest_0600 END'); done(); }); @@ -338,8 +338,8 @@ export default function swiperJsunit() { let strJsonNew = getInspectorByKey('swiper'); let objNew = JSON.parse(strJsonNew); console.info("swiperTest_1400 component objNew is: " + JSON.stringify(objNew)); - let assertObjet = obj.$attrs.indicator; - expect(assertObjet).assertTrue(); + let assertObjet = objNew.$attrs.indicator; + expect(assertObjet).assertEqual('false'); console.info('swiperTest_1400 END'); done(); }); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/list.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/list.ets index 93928f3de584680222844189efe04b4c939b38dc..ce35edede8037d1f61b077ca799cbf47f5316930 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/list.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/list.ets @@ -97,7 +97,7 @@ struct ListLanes { .editMode(true) .alignListItem(ListItemAlign.Start) .border({ width: 3, color: Color.Red }) - .lanes({ minLength: 40, maxLength: 60 }) + .lanes(4) .onScrollFrameBegin((offset: number, state: ScrollState) => { if ((this.listPosition == 0 && offset >= 0) || (this.listPosition == 2 && offset <= 0)) { this.scroller.scrollBy(0, -offset) diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/listTest.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/listTest.test.ets index dcc6b423b7599ee8ae6af7892e181925b117f123..91d7c03c91f07694eb49048feb2fbdd775367856 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/listTest.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/listTest.test.ets @@ -126,7 +126,7 @@ export default function listNewJsunit() { console.info("[testListNe0006] component lanes strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('List'); - expect(obj.$attrs.lanes).assertEqual('0'); + expect(obj.$attrs.lanes).assertEqual('4'); console.info("[testListNe0006] lanes value :" + obj.$attrs.lanes); done(); }); @@ -143,7 +143,7 @@ export default function listNewJsunit() { console.info("[testListNe0006] component lanes strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('List'); - expect(obj.$attrs.lanes).assertEqual('0'); + expect(obj.$attrs.lanes).assertEqual('4'); console.info("[testListNe0006] lanes value :" + obj.$attrs.lanes); done(); }); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/list_item.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/list_item.test.ets index 3e2392fd75112851e5312a1be1a89802b55d12f6..4b46c9222ed70699e6ade39b149193b32b3e6712 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/list_item.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/list_item.test.ets @@ -58,7 +58,7 @@ export default function list_itemOnSelectJsunit() { console.info("[testlist_itemOnSelect0001] component border strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('ListItem'); - expect(obj.$attrs.editable).assertEqual("true"); + expect(obj.$attrs.editable).assertTrue(); console.info("[testlist_itemOnSelect0001] editable value :" + obj.$attrs.editable); done(); }); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/polyLine.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/polyLine.test.ets index 9e337ae671c9032bb0a578c2c1c778b740324c80..993edffd56a693c81fe4c791001ead40aebfcca6 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/polyLine.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/polyLine.test.ets @@ -56,7 +56,7 @@ export default function polyLineNeJsunit() { let strJson = getInspectorByKey('Polyline'); console.info("[testpolyLineNe0001] component width strJson:" + strJson); let obj = JSON.parse(strJson); - expect(obj.$type).assertEqual('Shape'); + expect(obj.$type).assertEqual('Polyline'); expect(obj.$attrs.width).assertEqual("100.00px"); console.info("[testpolyLineNe0001] width value :" + obj.$attrs.width); done(); @@ -73,7 +73,7 @@ export default function polyLineNeJsunit() { let strJson = getInspectorByKey('Polyline'); console.info("[testpolyLineNe0002] component height strJson:" + strJson); let obj = JSON.parse(strJson); - expect(obj.$type).assertEqual('Shape'); + expect(obj.$type).assertEqual('Polyline'); expect(obj.$attrs.height).assertEqual("100.00px"); console.info("[testpolyLineNe0002] height value :" + obj.$attrs.height); done(); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/swiper.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/swiper.test.ets index 3868adbbb8459f7800446921f19c2effb0f93b61..9d3dc30e2f1e169aded76b58242324f2ce86efa8 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/swiper.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/swiper.test.ets @@ -143,9 +143,7 @@ export default function swiperCurveJsunit() { let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Swiper'); let testObj = obj.$attrs.indicator; - console.info("curve006_" + testObj); - expect(testObj).assertTrue(); - console.info("[testswiperCurve0006] indicator value :" + obj.$attrs.indicator); + expect(testObj).assertEqual('true'); done(); }); diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/swiper.test.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/swiper.test.ets index e7d4b4c34c74965333fd93fa87f923ae80b0abf1..5af392040cac0c0315f9ef89f7e72d4a19728c60 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/swiper.test.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/test/swiper.test.ets @@ -58,8 +58,7 @@ export default function swiperMaskJsunit() { let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Swiper'); console.info("[testswiperMask001] indicatorStyle value :" + obj.$attrs.indicator); - let jsonObject = JSON.parse(obj.$attrs.indicator); - expect(jsonObject.mask).assertEqual('true'); + expect(obj.$attrs.indicator).assertEqual('true'); done(); }); }) diff --git a/arkui/ace_ets_component_five/entry/src/main/ets/MainAbility/pages/select.ets b/arkui/ace_ets_component_five/entry/src/main/ets/MainAbility/pages/select.ets index 2db7a909bdc9ab31c0bb9f929eaba1d2b07310d8..0cfd69c6a0e8b014b2840a02482c3cd6fcfcd131 100644 --- a/arkui/ace_ets_component_five/entry/src/main/ets/MainAbility/pages/select.ets +++ b/arkui/ace_ets_component_five/entry/src/main/ets/MainAbility/pages/select.ets @@ -1,4 +1,3 @@ -// @ts-nocheck /** * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,7 +17,7 @@ import events_emitter from '@ohos.events.emitter' @Entry @Component struct SliderExample { - @State value:string=10 + @State value:string= '10' @State font:object={size: 30, weight:400, family: 'serif', style: FontStyle.Normal } @State fontColor: Color= 0xCCCCCC @@ -60,7 +59,7 @@ struct SliderExample { .selectedOptionFont({size: 40, weight: 500, family: 'serif', style: FontStyle.Normal }) .optionFont({size: 30, weight: 400, family: 'serif', style: FontStyle.Normal }) .key('select') - .onSelected((index:number)=>{ + .onSelect((index:number)=>{ console.info("Select:" + index) }) } diff --git a/arkui/ace_ets_standard/entry/src/main/ets/test/DividerJsunit.test.ets b/arkui/ace_ets_standard/entry/src/main/ets/test/DividerJsunit.test.ets index 99fc9776f23a6337c946dc9d91a2271036ba6b70..682b89d0d9f41c9f8174b56367981370c55a960a 100644 --- a/arkui/ace_ets_standard/entry/src/main/ets/test/DividerJsunit.test.ets +++ b/arkui/ace_ets_standard/entry/src/main/ets/test/DividerJsunit.test.ets @@ -72,7 +72,7 @@ export default function dividerJsunit() { console.log("cd divider strokeWidth" + JSON.stringify(obj.$attrs.strokeWidth)); console.log("cd divider vertical" + JSON.stringify(obj.$attrs.vertical)); console.log("cd divider lineCap" + JSON.stringify(obj.$attrs.lineCap)); - expect(obj.$attrs.strokeWidth).assertEqual("7.000000") + expect(obj.$attrs.strokeWidth).assertEqual("7.00vp") expect(obj.$attrs.vertical).assertEqual('true') expect(obj.$attrs.lineCap == LineCapStyle.Square) console.info('cd dividerInspectorByKey END'); diff --git a/arkui/ace_standard/Test.json b/arkui/ace_standard/Test.json index e2a35c1e43ce49920cae86ff6e85c95e314f948d..76700d48bb46fc637a42a0fcd482a68e6388e05f 100644 --- a/arkui/ace_standard/Test.json +++ b/arkui/ace_standard/Test.json @@ -17,7 +17,6 @@ { "type": "ShellKit", "run-command": [ - "hilog -Q pidoff", "power-shell wakeup", "power-shell setmode 602" ]