From e103320540be270d4d8e980c354c752de7bf92fc Mon Sep 17 00:00:00 2001 From: zhangshuqi Date: Tue, 30 May 2023 18:35:35 +0800 Subject: [PATCH] fixed 6ff2991 from https://gitee.com/hk-js/xts_acts_stage/pulls/8834 fixed Signed-off-by: zhangshuqi --- .../ColumnSetLayoutWeight_SubChange.test.ets | 6 +-- .../AlignContentFlexP_Fixed_Margin.test.ets | 10 ++--- .../AlignContentFlexP_Fixed_Offset.test.ets | 12 ++--- ...lignContentFlexP_Fixed_Visibility.test.ets | 8 ++-- .../AlignContentFlexP_fixed.test.ets | 8 ++-- .../FlexTextMarginJsunit.test.ets | 18 ++++---- .../FlexTextMarginJsunit.test.ets | 6 +-- .../ItemAlign_Start/FlexExceedJsunit.test.ets | 6 +-- .../FlexPaddingJsunit.test.ets | 6 +-- .../FlexTextMarginJsunit.test.ets | 6 +-- .../FlexExceedJsunit.test.ets | 6 +-- .../FlexPaddingJsunit.test.ets | 6 +-- .../FlexTextMarginJsunit.test.ets | 6 +-- .../Row_FlexAlign.test.ets | 44 +++++++++---------- 14 files changed, 74 insertions(+), 74 deletions(-) diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Column/subComponentChanged/ColumnSetLayoutWeight_SubChange.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Column/subComponentChanged/ColumnSetLayoutWeight_SubChange.test.ets index 1285e8798..0a608043b 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Column/subComponentChanged/ColumnSetLayoutWeight_SubChange.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Column/subComponentChanged/ColumnSetLayoutWeight_SubChange.test.ets @@ -65,9 +65,9 @@ export default function ColumnSetLayoutWeight_SubChange() { expect(Math.round(setLayoutWeight3.top - setLayoutWeight2.bottom)).assertEqual(vp2px(30)) expect(setLayoutWeight.bottom).assertEqual(setLayoutWeight3.bottom) - expect(Math.round(setLayoutWeight1.bottom - setLayoutWeight1.top)).assertEqual(vp2px(510/3)) - expect(Math.round(setLayoutWeight2.bottom - setLayoutWeight2.top)).assertEqual(vp2px(340/3)) - expect(Math.round(setLayoutWeight3.bottom - setLayoutWeight3.top)).assertEqual(vp2px(170/3)) + expect(Math.round(setLayoutWeight1.bottom - setLayoutWeight1.top)).assertEqual(Math.round(vp2px(510/3))) + expect(Math.round(setLayoutWeight2.bottom - setLayoutWeight2.top)).assertEqual(Math.round(vp2px(340/3))) + expect(Math.round(setLayoutWeight3.bottom - setLayoutWeight3.top)).assertEqual(Math.round(vp2px(170/3))) console.info('new testColumnSetLayoutWeightWithRateThreeTwoOne END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceEvenly/AlignContentFlexP_Fixed_Margin.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceEvenly/AlignContentFlexP_Fixed_Margin.test.ets index 208b390e1..8e3c7ef33 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceEvenly/AlignContentFlexP_Fixed_Margin.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceEvenly/AlignContentFlexP_Fixed_Margin.test.ets @@ -101,17 +101,17 @@ export default function AlignContentFlexP_Fixed_Margin() { expect(obj.$attrs.constructor.direction).assertEqual("FlexDirection.Row"); expect(obj.$attrs.constructor.alignContent).assertEqual("FlexAlign.SpaceEvenly"); - expect(AlignContentFlexSpaceEvenly_flex001.bottom - AlignContentFlexSpaceEvenly_4.bottom) - .assertEqual(AlignContentFlexSpaceEvenly_2.top - AlignContentFlexSpaceEvenly_flex001.top); + expect(Math.round(AlignContentFlexSpaceEvenly_flex001.bottom - AlignContentFlexSpaceEvenly_4.bottom)) + .assertEqual(Math.round(AlignContentFlexSpaceEvenly_2.top - AlignContentFlexSpaceEvenly_flex001.top)); - expect(AlignContentFlexSpaceEvenly_4.top - AlignContentFlexSpaceEvenly_3.bottom) - .assertEqual(AlignContentFlexSpaceEvenly_2.top - AlignContentFlexSpaceEvenly_flex001.top); + expect(Math.round(AlignContentFlexSpaceEvenly_4.top - AlignContentFlexSpaceEvenly_3.bottom)) + .assertEqual(Math.round(AlignContentFlexSpaceEvenly_2.top - AlignContentFlexSpaceEvenly_flex001.top)); expect(Math.round(AlignContentFlexSpaceEvenly_1.left - AlignContentFlexSpaceEvenly_flex001.left)) .assertEqual(vp2px(10)); expect(Math.round(AlignContentFlexSpaceEvenly_1.top - AlignContentFlexSpaceEvenly_flex001.top)) - .assertEqual(vp2px(50/3)+vp2px(10)); + .assertEqual(Math.round(vp2px(50/3)+vp2px(10))); console.info('testAlignContentSpaceEvenlyFlexFixedMarginSatisfy END'); done(); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceEvenly/AlignContentFlexP_Fixed_Offset.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceEvenly/AlignContentFlexP_Fixed_Offset.test.ets index d8b773053..b3248640f 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceEvenly/AlignContentFlexP_Fixed_Offset.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceEvenly/AlignContentFlexP_Fixed_Offset.test.ets @@ -102,8 +102,8 @@ export default function AlignContentFlexP_Fixed_Offset() { expect(Math.round(AlignContentFlexSpaceEvenly_2.left - AlignContentFlexSpaceEvenly_flex001.left)) .assertEqual(vp2px(150)); - expect(AlignContentFlexSpaceEvenly_flex001.bottom - AlignContentFlexSpaceEvenly_4.bottom) - .assertEqual(vp2px(50/3)); + expect(Math.round(AlignContentFlexSpaceEvenly_flex001.bottom - AlignContentFlexSpaceEvenly_4.bottom)) + .assertEqual(Math.round(vp2px(50/3))); expect(Math.round((AlignContentFlexSpaceEvenly_1.right - AlignContentFlexSpaceEvenly_2.left)*10)/10) .assertEqual(vp2px(15)); @@ -111,11 +111,11 @@ export default function AlignContentFlexP_Fixed_Offset() { expect(Math.round(AlignContentFlexSpaceEvenly_1.top - AlignContentFlexSpaceEvenly_2.top)) .assertEqual(vp2px(30)); - expect(AlignContentFlexSpaceEvenly_flex001.bottom - AlignContentFlexSpaceEvenly_4.bottom) - .assertEqual(AlignContentFlexSpaceEvenly_2.top - AlignContentFlexSpaceEvenly_flex001.top); + expect(Math.round(AlignContentFlexSpaceEvenly_flex001.bottom - AlignContentFlexSpaceEvenly_4.bottom)) + .assertEqual(Math.round(AlignContentFlexSpaceEvenly_2.top - AlignContentFlexSpaceEvenly_flex001.top)); - expect(AlignContentFlexSpaceEvenly_4.top - AlignContentFlexSpaceEvenly_3.bottom) - .assertEqual(AlignContentFlexSpaceEvenly_2.top - AlignContentFlexSpaceEvenly_flex001.top); + expect(Math.round(AlignContentFlexSpaceEvenly_4.top - AlignContentFlexSpaceEvenly_3.bottom)) + .assertEqual(Math.round(AlignContentFlexSpaceEvenly_2.top - AlignContentFlexSpaceEvenly_flex001.top)); console.info('testAlignContentSpaceEvenlyFlexPfixedOffset END'); done(); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceEvenly/AlignContentFlexP_Fixed_Visibility.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceEvenly/AlignContentFlexP_Fixed_Visibility.test.ets index 4577279f2..745cfacf6 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceEvenly/AlignContentFlexP_Fixed_Visibility.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceEvenly/AlignContentFlexP_Fixed_Visibility.test.ets @@ -97,11 +97,11 @@ export default function AlignContentFlexP_Fixed_Visibility() { expect(obj.$attrs.constructor.alignContent).assertEqual("FlexAlign.SpaceEvenly"); expect(textObj.$attrs.visibility).assertEqual("Visibility.Hidden"); - expect(AlignContentFlexSpaceEvenly_flex001.bottom - AlignContentFlexSpaceEvenly_4.bottom) - .assertEqual(AlignContentFlexSpaceEvenly_3.top - AlignContentFlexSpaceEvenly_flex001.top); + expect(Math.round(AlignContentFlexSpaceEvenly_flex001.bottom - AlignContentFlexSpaceEvenly_4.bottom)) + .assertEqual(Math.round(AlignContentFlexSpaceEvenly_3.top - AlignContentFlexSpaceEvenly_flex001.top)); - expect(AlignContentFlexSpaceEvenly_4.top - AlignContentFlexSpaceEvenly_3.bottom) - .assertEqual(AlignContentFlexSpaceEvenly_3.top - AlignContentFlexSpaceEvenly_flex001.top); + expect(Math.round(AlignContentFlexSpaceEvenly_4.top - AlignContentFlexSpaceEvenly_3.bottom)) + .assertEqual(Math.round(AlignContentFlexSpaceEvenly_3.top - AlignContentFlexSpaceEvenly_flex001.top)); expect(Math.round(AlignContentFlexSpaceEvenly_2.left - AlignContentFlexSpaceEvenly_flex001.left)) .assertEqual(vp2px(150)); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceEvenly/AlignContentFlexP_fixed.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceEvenly/AlignContentFlexP_fixed.test.ets index 6eb6e9f4e..7d88a72ea 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceEvenly/AlignContentFlexP_fixed.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceEvenly/AlignContentFlexP_fixed.test.ets @@ -102,11 +102,11 @@ export default function AlignContentFlexP_fixed() { expect(obj.$attrs.constructor.direction).assertEqual("FlexDirection.Row"); expect(obj.$attrs.constructor.alignContent).assertEqual("FlexAlign.SpaceEvenly"); - expect(AlignContentFlexSpaceEvenly_flex001.bottom - AlignContentFlexSpaceEvenly_4.bottom) - .assertEqual(AlignContentFlexSpaceEvenly_1.top - AlignContentFlexSpaceEvenly_flex001.top); + expect(Math.round(AlignContentFlexSpaceEvenly_flex001.bottom - AlignContentFlexSpaceEvenly_4.bottom)) + .assertEqual(Math.round(AlignContentFlexSpaceEvenly_1.top - AlignContentFlexSpaceEvenly_flex001.top)); - expect(AlignContentFlexSpaceEvenly_4.top - AlignContentFlexSpaceEvenly_3.bottom) - .assertEqual(AlignContentFlexSpaceEvenly_1.top - AlignContentFlexSpaceEvenly_flex001.top); + expect(Math.round(AlignContentFlexSpaceEvenly_4.top - AlignContentFlexSpaceEvenly_3.bottom)) + .assertEqual(Math.round(AlignContentFlexSpaceEvenly_1.top - AlignContentFlexSpaceEvenly_flex001.top)); console.info('testAlignContentSpaceEvenlyFlexFixedSatisfy END'); done(); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Center/FlexTextMarginJsunit.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Center/FlexTextMarginJsunit.test.ets index cb8801c24..24bc369c8 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Center/FlexTextMarginJsunit.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Center/FlexTextMarginJsunit.test.ets @@ -64,9 +64,9 @@ export default function flexTextMargin_CenterJsunit() { expect(textMargin03.left).assertEqual(textMargin02.right) expect(Math.round(flexTextMargin01.right - textMargin03.right)).assertEqual(vp2px(30)) - expect(textMargin01.top - flexTextMargin01.top).assertEqual(flexTextMargin01.bottom - textMargin01.bottom) - expect(textMargin02.top - flexTextMargin01.top).assertEqual(flexTextMargin01.bottom - textMargin02.bottom) - expect(textMargin03.top - flexTextMargin01.top).assertEqual(flexTextMargin01.bottom - textMargin03.bottom) + expect(Math.round(textMargin01.top - flexTextMargin01.top)).assertEqual(Math.round(flexTextMargin01.bottom - textMargin01.bottom)) + expect(Math.round(textMargin02.top - flexTextMargin01.top)).assertEqual(Math.round(flexTextMargin01.bottom - textMargin02.bottom)) + expect(Math.round(textMargin03.top - flexTextMargin01.top)).assertEqual(Math.round(flexTextMargin01.bottom - textMargin03.bottom)) expect(Math.round(textMargin01.bottom - textMargin01.top)).assertEqual(vp2px(50)) expect(Math.round(textMargin02.bottom - textMargin02.top)).assertEqual(vp2px(100)) expect(Math.round(textMargin03.bottom - textMargin03.top)).assertEqual(vp2px(150)) @@ -98,15 +98,15 @@ export default function flexTextMargin_CenterJsunit() { expect(Math.round(textMargin02.left - textMargin01.right)).assertEqual(vp2px(30)) expect(textMargin03.left).assertEqual(textMargin02.right) expect(textMargin03.right).assertEqual(flexTextMargin01.right) - expect(textMargin01.top - flexTextMargin01.top).assertEqual(flexTextMargin01.bottom - textMargin01.bottom) - expect(textMargin02.top - flexTextMargin01.top).assertEqual(flexTextMargin01.bottom - textMargin02.bottom) - expect(textMargin03.top - flexTextMargin01.top).assertEqual(flexTextMargin01.bottom - textMargin03.bottom) + expect(Math.round(textMargin01.top - flexTextMargin01.top)).assertEqual(Math.round(flexTextMargin01.bottom - textMargin01.bottom)) + expect(Math.round(textMargin02.top - flexTextMargin01.top)).assertEqual(Math.round(flexTextMargin01.bottom - textMargin02.bottom)) + expect(Math.round(textMargin03.top - flexTextMargin01.top)).assertEqual(Math.round(flexTextMargin01.bottom - textMargin03.bottom)) expect(Math.round(textMargin01.bottom - textMargin01.top)).assertEqual(vp2px(50)) expect(Math.round(textMargin02.bottom - textMargin02.top)).assertEqual(vp2px(100)) expect(Math.round(textMargin03.bottom - textMargin03.top)).assertEqual(vp2px(150)) - expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(vp2px(440/3)) - expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(vp2px(440/3)) - expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(vp2px(440/3)) + expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(Math.round(vp2px(440/3))) + expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(Math.round(vp2px(440/3))) + expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(Math.round(vp2px(440/3))) expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Center') console.info('new testFlexItemAlignCenterSubSetMarginExceed END'); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_End/FlexTextMarginJsunit.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_End/FlexTextMarginJsunit.test.ets index 2de4ffe3b..1dd97bedc 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_End/FlexTextMarginJsunit.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_End/FlexTextMarginJsunit.test.ets @@ -106,9 +106,9 @@ export default function flexTextMargin_EndJsunit() { expect(Math.round(textMargin01.bottom - textMargin01.top)).assertEqual(vp2px(50)) expect(Math.round(textMargin02.bottom - textMargin02.top)).assertEqual(vp2px(100)) expect(Math.round(textMargin03.bottom - textMargin03.top)).assertEqual(vp2px(150)) - expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(vp2px(440/3)) - expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(vp2px(440/3)) - expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(vp2px(440/3)) + expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(Math.round(vp2px(440/3))) + expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(Math.round(vp2px(440/3))) + expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(Math.round(vp2px(440/3))) expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.End') console.info('new testFlexItemAlignEndSubSetMarginExceed END'); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Start/FlexExceedJsunit.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Start/FlexExceedJsunit.test.ets index 47d54fbb9..315e6383f 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Start/FlexExceedJsunit.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Start/FlexExceedJsunit.test.ets @@ -111,9 +111,9 @@ export default function flexExceed_StartJsunit() { expect(Math.round(textExceed01.bottom - textExceed01.top)).assertEqual(vp2px(50)) expect(Math.round(textExceed02.bottom - textExceed02.top)).assertEqual(vp2px(100)) expect(Math.round(textExceed03.bottom - textExceed03.top)).assertEqual(vp2px(150)) - expect(Math.round(textExceed01.right - textExceed01.left)).assertEqual(vp2px(440/3)) - expect(Math.round(textExceed02.right - textExceed02.left)).assertEqual(vp2px(440/3)) - expect(Math.round(textExceed03.right - textExceed03.left)).assertEqual(vp2px(440/3)) + expect(Math.round(textExceed01.right - textExceed01.left)).assertEqual(Math.round(vp2px(440/3))) + expect(Math.round(textExceed02.right - textExceed02.left)).assertEqual(Math.round(vp2px(440/3))) + expect(Math.round(textExceed03.right - textExceed03.left)).assertEqual(Math.round(vp2px(440/3))) expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Start') console.info('new testFlexItemAlignStartSetMarPadExceed END'); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Start/FlexPaddingJsunit.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Start/FlexPaddingJsunit.test.ets index b953a47b4..829b7f74e 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Start/FlexPaddingJsunit.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Start/FlexPaddingJsunit.test.ets @@ -110,9 +110,9 @@ export default function flexPadding_StartJsunit() { expect(Math.round(textFlexPadding01.bottom - textFlexPadding01.top)).assertEqual(vp2px(50)) expect(Math.round(textFlexPadding02.bottom - textFlexPadding02.top)).assertEqual(vp2px(100)) expect(Math.round(textFlexPadding03.bottom - textFlexPadding03.top)).assertEqual(vp2px(150)) - expect(Math.round(textFlexPadding01.right - textFlexPadding01.left)).assertEqual(vp2px(440/3)) - expect(Math.round(textFlexPadding02.right - textFlexPadding02.left)).assertEqual(vp2px(440/3)) - expect(Math.round(textFlexPadding03.right - textFlexPadding03.left)).assertEqual(vp2px(440/3)) + expect(Math.round(textFlexPadding01.right - textFlexPadding01.left)).assertEqual(Math.round(vp2px(440/3))) + expect(Math.round(textFlexPadding02.right - textFlexPadding02.left)).assertEqual(Math.round(vp2px(440/3))) + expect(Math.round(textFlexPadding03.right - textFlexPadding03.left)).assertEqual(Math.round(vp2px(440/3))) expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Start') console.info('new testFlexItemAlignStartParentSetPaddingExceed END'); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Start/FlexTextMarginJsunit.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Start/FlexTextMarginJsunit.test.ets index ec766accd..442ccafc6 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Start/FlexTextMarginJsunit.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Start/FlexTextMarginJsunit.test.ets @@ -107,9 +107,9 @@ export default function flexTextMargin_StartJsunit() { expect(Math.round(textMargin01.bottom - textMargin01.top)).assertEqual(vp2px(50)) expect(Math.round(textMargin02.bottom - textMargin02.top)).assertEqual(vp2px(100)) expect(Math.round(textMargin03.bottom - textMargin03.top)).assertEqual(vp2px(150)) - expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(vp2px(440/3)) - expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(vp2px(440/3)) - expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(vp2px(440/3)) + expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(Math.round(vp2px(440/3))) + expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(Math.round(vp2px(440/3))) + expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(Math.round(vp2px(440/3))) expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Start') console.info('new testFlexItemAlignStartSubSetMarginExceed END'); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Stretch/FlexExceedJsunit.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Stretch/FlexExceedJsunit.test.ets index 254f18133..2d6a4107b 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Stretch/FlexExceedJsunit.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Stretch/FlexExceedJsunit.test.ets @@ -111,9 +111,9 @@ export default function flexExceed_StretchJsunit() { expect(Math.round(textExceed01.bottom - textExceed01.top)).assertEqual(vp2px(140)) expect(Math.round(textExceed02.bottom - textExceed02.top)).assertEqual(vp2px(140)) expect(Math.round(textExceed03.bottom - textExceed03.top)).assertEqual(vp2px(140)) - expect(Math.round(textExceed01.right - textExceed01.left)).assertEqual(vp2px(440/3)) - expect(Math.round(textExceed02.right - textExceed02.left)).assertEqual(vp2px(440/3)) - expect(Math.round(textExceed03.right - textExceed03.left)).assertEqual(vp2px(440/3)) + expect(Math.round(textExceed01.right - textExceed01.left)).assertEqual(Math.round(vp2px(440/3))) + expect(Math.round(textExceed02.right - textExceed02.left)).assertEqual(Math.round(vp2px(440/3))) + expect(Math.round(textExceed03.right - textExceed03.left)).assertEqual(Math.round(vp2px(440/3))) expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Stretch') console.info('new testFlexItemAlignStretchSetMarPadExceed END'); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Stretch/FlexPaddingJsunit.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Stretch/FlexPaddingJsunit.test.ets index 89cf74522..74d835039 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Stretch/FlexPaddingJsunit.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Stretch/FlexPaddingJsunit.test.ets @@ -112,9 +112,9 @@ export default function flexPadding_StretchJsunit() { expect(Math.round(textFlexPadding01.bottom - textFlexPadding01.top)).assertEqual(vp2px(140)) expect(Math.round(textFlexPadding02.bottom - textFlexPadding02.top)).assertEqual(vp2px(140)) expect(Math.round(textFlexPadding03.bottom - textFlexPadding03.top)).assertEqual(vp2px(140)) - expect(Math.round(textFlexPadding01.right - textFlexPadding01.left)).assertEqual(vp2px(440/3)) - expect(Math.round(textFlexPadding02.right - textFlexPadding02.left)).assertEqual(vp2px(440/3)) - expect(Math.round(textFlexPadding03.right - textFlexPadding03.left)).assertEqual(vp2px(440/3)) + expect(Math.round(textFlexPadding01.right - textFlexPadding01.left)).assertEqual(Math.round(vp2px(440/3))) + expect(Math.round(textFlexPadding02.right - textFlexPadding02.left)).assertEqual(Math.round(vp2px(440/3))) + expect(Math.round(textFlexPadding03.right - textFlexPadding03.left)).assertEqual(Math.round(vp2px(440/3))) expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Stretch') console.info('new testFlexItemAlignStretchParentSetPaddingExceed END'); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Stretch/FlexTextMarginJsunit.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Stretch/FlexTextMarginJsunit.test.ets index 38078c563..d673e63cb 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Stretch/FlexTextMarginJsunit.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Stretch/FlexTextMarginJsunit.test.ets @@ -110,9 +110,9 @@ export default function flexTextMargin_StretchJsunit() { expect(Math.round(textMargin01.bottom - textMargin01.top)).assertEqual(vp2px(140)) expect(Math.round(textMargin02.bottom - textMargin02.top)).assertEqual(vp2px(200)) expect(Math.round(textMargin03.bottom - textMargin03.top)).assertEqual(vp2px(200)) - expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(vp2px(440/3)) - expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(vp2px(440/3)) - expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(vp2px(440/3)) + expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(Math.round(vp2px(440/3))) + expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(Math.round(vp2px(440/3))) + expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(Math.round(vp2px(440/3))) expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Stretch') console.info('new testFlexItemAlignStretchSubSetMarginExceed END'); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Row/parentComponentChanged/Row_FlexAlign.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Row/parentComponentChanged/Row_FlexAlign.test.ets index 4c2a21132..af65655db 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Row/parentComponentChanged/Row_FlexAlign.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Row/parentComponentChanged/Row_FlexAlign.test.ets @@ -83,9 +83,9 @@ export default function Row_FlexAlign() { expect(obj.$attrs.justifyContent).assertEqual("FlexAlign.Start"); expect(Text1.left).assertEqual(Row.left); - expect(Text1.top - Row.top).assertEqual(Row.bottom - Text1.bottom); - expect(Text2.top - Row.top).assertEqual(Row.bottom - Text2.bottom); - expect(Text3.top - Row.top).assertEqual(Row.bottom - Text3.bottom); + expect(Math.round(Text1.top - Row.top)).assertEqual(Math.round(Row.bottom - Text1.bottom)); + expect(Math.round(Text2.top - Row.top)).assertEqual(Math.round(Row.bottom - Text2.bottom)); + expect(Math.round(Text3.top - Row.top)).assertEqual(Math.round(Row.bottom - Text3.bottom)); expect(Math.round(Text2.left - Text1.right)).assertEqual(vp2px(10)); expect(Math.round(Text3.left - Text2.right)).assertEqual(vp2px(10)); @@ -127,10 +127,10 @@ export default function Row_FlexAlign() { expect(obj.$attrs.justifyContent).assertEqual("FlexAlign.Center"); - expect(Text1.left - Row.left).assertEqual(Row.right - Text3.right); - expect(Text1.top - Row.top).assertEqual(Row.bottom - Text1.bottom); - expect(Text2.top - Row.top).assertEqual(Row.bottom - Text2.bottom); - expect(Text3.top - Row.top).assertEqual(Row.bottom - Text3.bottom); + expect(Math.round(Text1.left - Row.left)).assertEqual(Math.round(Row.right - Text3.right)); + expect(Math.round(Text1.top - Row.top)).assertEqual(Math.round(Row.bottom - Text1.bottom)); + expect(Math.round(Text2.top - Row.top)).assertEqual(Math.round(Row.bottom - Text2.bottom)); + expect(Math.round(Text3.top - Row.top)).assertEqual(Math.round(Row.bottom - Text3.bottom)); expect(Math.round(Text2.left - Text1.right)).assertEqual(vp2px(10)); expect(Math.round(Text3.left - Text2.right)).assertEqual(vp2px(10)); @@ -171,9 +171,9 @@ export default function Row_FlexAlign() { expect(obj.$attrs.justifyContent).assertEqual("FlexAlign.End"); expect(Text3.right).assertEqual(Row.right); - expect(Text1.top - Row.top).assertEqual(Row.bottom - Text1.bottom); - expect(Text2.top - Row.top).assertEqual(Row.bottom - Text2.bottom); - expect(Text3.top - Row.top).assertEqual(Row.bottom - Text3.bottom); + expect(Math.round(Text1.top - Row.top)).assertEqual(Math.round(Row.bottom - Text1.bottom)); + expect(Math.round(Text2.top - Row.top)).assertEqual(Math.round(Row.bottom - Text2.bottom)); + expect(Math.round(Text3.top - Row.top)).assertEqual(Math.round(Row.bottom - Text3.bottom)); expect(Math.round(Text2.left - Text1.right)).assertEqual(vp2px(10)); expect(Math.round(Text3.left - Text2.right)).assertEqual(vp2px(10)); expect(Text1.left).assertLarger(Row.left); @@ -218,9 +218,9 @@ export default function Row_FlexAlign() { expect(Text3.right).assertEqual(Row.right); expect(Math.round((Text2.left - Text1.right)*10)/10).assertEqual(vp2px(25)); expect(Math.round((Text3.left - Text2.right)*10)/10).assertEqual(vp2px(25)); - expect(Text1.top - Row.top).assertEqual(Row.bottom - Text1.bottom); - expect(Text2.top - Row.top).assertEqual(Row.bottom - Text2.bottom); - expect(Text3.top - Row.top).assertEqual(Row.bottom - Text3.bottom); + expect(Math.round(Text1.top - Row.top)).assertEqual(Math.round(Row.bottom - Text1.bottom)); + expect(Math.round(Text2.top - Row.top)).assertEqual(Math.round(Row.bottom - Text2.bottom)); + expect(Math.round(Text3.top - Row.top)).assertEqual(Math.round(Row.bottom - Text3.bottom)); console.info('testRowJustifyContentFlexAlignSpaceBetween END'); done(); @@ -259,14 +259,14 @@ export default function Row_FlexAlign() { expect(obj.$attrs.justifyContent).assertEqual("FlexAlign.SpaceAround"); - expect(Text1.left - Row.left).assertEqual(Row.right - Text3.right); + expect(Math.round(Text1.left - Row.left)).assertEqual(Math.round(Row.right - Text3.right)); expect(Math.round((Text1.left - Row.left)*10)/10).assertEqual(Math.round(vp2px(50/6)*10)/10); - expect(Math.round(Text2.left - Text1.right)).assertEqual(vp2px(50/3)); - expect(Math.round(Text3.left - Text2.right)).assertEqual(vp2px(50/3)); + expect(Math.round(Text2.left - Text1.right)).assertEqual(Math.round(vp2px(50/3))); + expect(Math.round(Text3.left - Text2.right)).assertEqual(Math.round(vp2px(50/3))); - expect(Text1.top - Row.top).assertEqual(Row.bottom - Text1.bottom); - expect(Text2.top - Row.top).assertEqual(Row.bottom - Text2.bottom); - expect(Text3.top - Row.top).assertEqual(Row.bottom - Text3.bottom); + expect(Math.round(Text1.top - Row.top)).assertEqual(Math.round(Row.bottom - Text1.bottom)); + expect(Math.round(Text2.top - Row.top)).assertEqual(Math.round(Row.bottom - Text2.bottom)); + expect(Math.round(Text3.top - Row.top)).assertEqual(Math.round(Row.bottom - Text3.bottom)); console.info('testRowJustifyContentFlexAlignSpaceAround END'); done(); @@ -309,9 +309,9 @@ export default function Row_FlexAlign() { expect(Math.round((Text2.left - Text1.right)*100)/100).assertEqual(Math.round(vp2px(50/4)*100)/100); expect(Math.round((Text3.left - Text2.right)*100)/100).assertEqual(Math.round(vp2px(50/4)*100)/100); - expect(Text1.top - Row.top).assertEqual(Row.bottom - Text1.bottom); - expect(Text2.top - Row.top).assertEqual(Row.bottom - Text2.bottom); - expect(Text3.top - Row.top).assertEqual(Row.bottom - Text3.bottom); + expect(Math.round(Text1.top - Row.top)).assertEqual(Math.round(Row.bottom - Text1.bottom)); + expect(Math.round(Text2.top - Row.top)).assertEqual(Math.round(Row.bottom - Text2.bottom)); + expect(Math.round(Text3.top - Row.top)).assertEqual(Math.round(Row.bottom - Text3.bottom)); console.info('testRowJustifyContentFlexAlignSpaceEvenly END'); done(); -- GitLab