From ca46e2e13c658fd69297cfe7251c821df30235ba Mon Sep 17 00:00:00 2001 From: sunjiakun Date: Wed, 5 Jul 2023 16:00:32 +0800 Subject: [PATCH] fail change Signed-off-by: sunjiakun --- .../src/main/ets/TestAbility/pages/Index.ets | 8 ++++---- .../src/main/ets/test/AlphabetIndexer.ets | 19 ++++++++++--------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/arkui/ace_ets_components_ux/ace_ets_component_indexer/src/main/ets/TestAbility/pages/Index.ets b/arkui/ace_ets_components_ux/ace_ets_component_indexer/src/main/ets/TestAbility/pages/Index.ets index e503891b3..b6bdbeb91 100644 --- a/arkui/ace_ets_components_ux/ace_ets_component_indexer/src/main/ets/TestAbility/pages/Index.ets +++ b/arkui/ace_ets_components_ux/ace_ets_component_indexer/src/main/ets/TestAbility/pages/Index.ets @@ -166,7 +166,7 @@ struct AlphabetIndexerTest { .selectedFont({ size: 28, weight: FontWeight.Bold }) .color(0x000000) .selectedColor(0xFF1493) - .backgroundColor(0xF8F8FF) + .backgroundColor($r("sys.color.ohos_id_color_primary")) .selectedBackgroundColor(0xBEBEBE) .itemSize(26) .onSelect((index: number) => { @@ -203,7 +203,7 @@ struct AlphabetIndexerTest { .selectedFont({ size: 28, weight: FontWeight.Bold }) .color(0x000000) .selectedColor(0xFF1493) - .backgroundColor(0xF8F8FF) + .backgroundColor($r("sys.color.ohos_id_color_primary")) .selectedBackgroundColor(0xBEBEBE) .itemSize(26) .onSelect((index: number) => { @@ -244,7 +244,7 @@ struct AlphabetIndexerTest { .selectedFont({ size: 28, weight: FontWeight.Bold }) .color(0x000000) .selectedColor(0xFF1493) - .backgroundColor(0xF8F8FF) + .backgroundColor($r("sys.color.ohos_id_color_primary")) .selectedBackgroundColor(0xBEBEBE) .itemSize(26) .onSelect((index: number) => { @@ -285,7 +285,7 @@ struct AlphabetIndexerTest { .selectedFont({ size: 28, weight: FontWeight.Bold }) .color(0x000000) .selectedColor(0xFF1493) - .backgroundColor(0xF8F8FF) + .backgroundColor($r("sys.color.ohos_id_color_primary")) .selectedBackgroundColor(0xBEBEBE) .itemSize(26) .onSelect((index: number) => { diff --git a/arkui/ace_ets_components_ux/ace_ets_component_indexer/src/main/ets/test/AlphabetIndexer.ets b/arkui/ace_ets_components_ux/ace_ets_component_indexer/src/main/ets/test/AlphabetIndexer.ets index 5f96bb1da..f23f32f2f 100644 --- a/arkui/ace_ets_components_ux/ace_ets_component_indexer/src/main/ets/test/AlphabetIndexer.ets +++ b/arkui/ace_ets_components_ux/ace_ets_component_indexer/src/main/ets/test/AlphabetIndexer.ets @@ -77,8 +77,8 @@ export default function AlphabetIndexer() { console.info("ArkUI_AlphabetIndexer_0100 start"); let strJson = getInspectorByKey('alphabetIndexerTest1'); let obj = JSON.parse(strJson); - expect(obj.$attrs.popupSelectedColor).assertEqual("#FF182431"); - expect(obj.$attrs.popupUnselectedColor).assertEqual("#FF182431"); + expect(obj.$attrs.popupSelectedColor).assertEqual(obj.$attrs.backgroundColor); + expect(obj.$attrs.popupUnselectedColor).assertEqual(obj.$attrs.backgroundColor); expect(obj.$attrs.popupItemBackground).assertEqual("#FFFFFFFF"); expect(obj.$attrs.popupItemFontSize).assertEqual("24.00vp"); expect(obj.$attrs.popupItemFontWeight).assertEqual("FontWeight.Medium"); @@ -90,7 +90,8 @@ export default function AlphabetIndexer() { console.info("ArkUI_AlphabetIndexer_0600 start"); let strJson = getInspectorByKey('alphabetIndexerTest6'); let obj = JSON.parse(strJson); - expect(obj.$attrs.popupItemFontSize).assertEqual("30.00vp"); + let popupItemFontSize = obj.$attrs.popupItemFontSize; + expect(parseFloat(popupItemFontSize)).assertEqual(30) done(); }); @@ -123,7 +124,7 @@ export default function AlphabetIndexer() { await Utils.sleep(2000); let newJson = getInspectorByKey('alphabetIndexerTest2'); let obj = JSON.parse(newJson); - expect(obj.$attrs.popupSelectedColor).assertEqual("#FF182431"); + expect(obj.$attrs.popupSelectedColor).assertEqual(obj.$attrs.backgroundColor); done(); }); @@ -148,7 +149,7 @@ export default function AlphabetIndexer() { await Utils.sleep(2000); let newJson = getInspectorByKey('alphabetIndexerTest2'); let obj = JSON.parse(newJson); - expect(obj.$attrs.popupUnselectedColor).assertEqual("#FF182431"); + expect(obj.$attrs.popupUnselectedColor).assertEqual(obj.$attrs.backgroundColor); done(); }); @@ -273,7 +274,7 @@ export default function AlphabetIndexer() { await Utils.sleep(2000); let newJson = getInspectorByKey('alphabetIndexerTest3'); let obj = JSON.parse(newJson); - expect(obj.$attrs.popupSelectedColor).assertEqual("#FF182431"); + expect(obj.$attrs.popupSelectedColor).assertEqual(obj.$attrs.backgroundColor); done(); }); @@ -298,7 +299,7 @@ export default function AlphabetIndexer() { await Utils.sleep(2000); let newJson = getInspectorByKey('alphabetIndexerTest3'); let obj = JSON.parse(newJson); - expect(obj.$attrs.popupUnselectedColor).assertEqual("#FF182431"); + expect(obj.$attrs.popupUnselectedColor).assertEqual(obj.$attrs.backgroundColor); done(); }); @@ -423,7 +424,7 @@ export default function AlphabetIndexer() { await Utils.sleep(2000); let newJson = getInspectorByKey('alphabetIndexerTest4'); let obj = JSON.parse(newJson); - expect(obj.$attrs.popupSelectedColor).assertEqual("#FF182431"); + expect(obj.$attrs.popupSelectedColor).assertEqual(obj.$attrs.backgroundColor); done(); }); @@ -448,7 +449,7 @@ export default function AlphabetIndexer() { await Utils.sleep(2000); let newJson = getInspectorByKey('alphabetIndexerTest4'); let obj = JSON.parse(newJson); - expect(obj.$attrs.popupUnselectedColor).assertEqual("#FF182431"); + expect(obj.$attrs.popupUnselectedColor).assertEqual(obj.$attrs.backgroundColor); done(); }); -- GitLab