diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/RatingPage.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/RatingPage.ets index ea9c403eea4a4d05183bd18c5f39fc414bdb0dab..c70b3c725501973769bc309764a0988886297cab 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/RatingPage.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/RatingPage.ets @@ -18,7 +18,7 @@ import {MessageManager,Callback} from '../utils/MessageManager'; @Component struct RatingPage { @State rating: number = 3.5 - @State indicator : boolean = false + @State indicator : boolean = true @State stars: number = 5 @State stepSize: number = 0.5 @State text: string = 'no change' diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/RatingJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/RatingJsunit.test.ets index 2a051115982b98843b0e518022432f384a846717..2c0c2902e579b1ba680c60985dd6c7f43ae1f9b4 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/RatingJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/RatingJsunit.test.ets @@ -51,7 +51,7 @@ export default function RatingJsunit() { console.info("[RatingJsunit_0100] component obj is: " + JSON.stringify(obj)); await CommonFunc.sleep(1000); expect(obj.$attrs.rating).assertEqual('3.500000'); - expect(obj.$attrs.indicator).assertEqual('false'); + expect(obj.$attrs.indicator).assertEqual('true'); expect(obj.$attrs.stars).assertEqual('5'); expect(obj.$attrs.stepSize).assertEqual('0.500000'); expect(obj.$attrs.starStyle).assertEqual('{"backgroundUri":"resources/base/media/star_1.png","foregroundUri":"resources/base/media/star_2.png","secondaryUri":"resources/base/media/star_3.png"}'); @@ -134,7 +134,8 @@ export default function RatingJsunit() { console.info('[RatingJsunit_0600] START'); await CommonFunc.sleep(1000); // Modify the indicator value of the Rating component - globalThis.value.message.notify({name:'indicator',value:false}) + globalThis.value.message.notify({name:'rating',value:1}) + await CommonFunc.sleep(1000); let driver = await UiDriver.create() let textComponent1 = await driver.findComponent(BY.key('text')); diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/SearchJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/SearchJsunit.test.ets index 46ad6a42b5810b58b5631c95dcb826557869043a..eee2843caa70e065c7b741f6befbed6145791744 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/SearchJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/SearchJsunit.test.ets @@ -63,8 +63,8 @@ export default function SearchJsunit() { expect(obj.$attrs.searchButton).assertEqual('SEARCH'); expect(obj.$attrs.placeholderColor).assertEqual('#FF808080'); expect(obj.$attrs.value).assertEqual(''); - expect(obj.$attrs.placeholderFont).assertEqual('{ "style": "FontStyle.Normal", "size": "14.00fp", "weight": "400", "fontFamily ": "sans-serif" }'); - expect(obj.$attrs.textFont).assertEqual('{ "fontSize":"14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"FontWeight.400","fontFamily":"HarmonyOS Sans"}'); + expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"14.00fp","weight":"400","fontFamily":"sans-serif"}'); + expect(obj.$attrs.textFont).assertEqual('{"fontSize":"14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"FontWeight.400","fontFamily":"HarmonyOS Sans"}'); expect(obj.$attrs.textAlign).assertEqual('TextAlign.Start'); expect(obj.$attrs.copyOption).assertEqual('CopyOptions.InApp'); expect(obj.$attrs.placeholder).assertEqual('Type to search...'); @@ -113,8 +113,8 @@ export default function SearchJsunit() { expect(obj.$attrs.icon).assertEqual('./resources/base/media/star_3.png'); expect(obj.$attrs.searchButton).assertEqual('CLICK_SEARCH'); expect(obj.$attrs.value).assertEqual('hello'); - expect(obj.$attrs.placeholderFont).assertEqual('{ "style": "FontStyle.Normal", "size": "20.00fp", "weight": "500", "fontFamily ": "sans-serif" }'); - expect(obj.$attrs.textFont).assertEqual('{ "fontSize":"20.00fp","fontStyle":"FontStyle.Normal","fontWeight":"FontWeight.500","fontFamily":"HarmonyOS Sans"}'); + expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"20.00fp","weight":"500","fontFamily":"sans-serif"}'); + expect(obj.$attrs.textFont).assertEqual('{"fontSize":"20.00fp","fontStyle":"FontStyle.Normal","fontWeight":"FontWeight.500","fontFamily":"HarmonyOS Sans"}'); expect(obj.$attrs.textAlign).assertEqual('TextAlign.Center'); expect(obj.$attrs.copyOption).assertEqual('CopyOptions.LocalDevice'); expect(obj.$attrs.placeholderColor).assertEqual('#FF008000'); @@ -156,7 +156,7 @@ export default function SearchJsunit() { await textComponent4.click() let copy = await driver.findComponent(BY.key('copy')); let text3 = await copy.getText(); - expect(text3).assertEqual('onCopy:'); + expect(text3).assertEqual('onCopy:hello'); // Verify the onCut function of the Search component await textComponent1.longClick() @@ -226,8 +226,8 @@ export default function SearchJsunit() { expect(obj.$attrs.searchButton).assertEqual('10'); expect(obj.$attrs.placeholderColor).assertEqual('#FF00000A'); expect(obj.$attrs.value).assertEqual('hello'); - expect(obj.$attrs.placeholderFont).assertEqual('{ "style": "FontStyle.Normal", "size": "14.00fp", "weight": "400", "fontFamily ": "sans-serif" }'); - expect(obj.$attrs.textFont).assertEqual('{ "fontSize":"14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"FontWeight.400","fontFamily":"HarmonyOS Sans"}'); + expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"14.00fp","weight":"400","fontFamily":"sans-serif"}'); + expect(obj.$attrs.textFont).assertEqual('{"fontSize":"14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"FontWeight.400","fontFamily":"HarmonyOS Sans"}'); expect(obj.$attrs.textAlign).assertEqual('TextAlign.Start'); expect(obj.$attrs.copyOption).assertEqual(''); expect(obj.$attrs.placeholder).assertEqual('Click to search...');