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 e503891b38ebdc6f724be889951b3c7b09a51d11..b6bdbeb9108587061c4853387e03102a00615190 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 5f96bb1daad6faf2552c792b334bbadb4cddb91d..f23f32f2f499f1e3ea8a910edc73a9e3b1d58d9c 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(); });