提交 35c78146 编写于 作者: E e

修改用例

Signed-off-by: Ne <qianwangdq@isoftstone.com>
上级 38e635d1
...@@ -48,6 +48,5 @@ struct AlignCenter_AddAlign { ...@@ -48,6 +48,5 @@ struct AlignCenter_AddAlign {
.align(this.DadAddAlign) .align(this.DadAddAlign)
} }
.width("100%") .width("100%")
.backgroundColor(0xAFEEE)
} }
} }
...@@ -36,7 +36,6 @@ struct AlignCenter_AddAllSpace { ...@@ -36,7 +36,6 @@ struct AlignCenter_AddAllSpace {
build() { build() {
Column() { Column() {
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) { Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Center_AddAllSpace_011") Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Center_AddAllSpace_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_AddAllSpace_012") Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_AddAllSpace_012")
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Center_AddAllSpace_013") Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Center_AddAllSpace_013")
...@@ -50,8 +49,6 @@ struct AlignCenter_AddAllSpace { ...@@ -50,8 +49,6 @@ struct AlignCenter_AddAllSpace {
} }
.key("Center_AddAllSpace_01_Box") .key("Center_AddAllSpace_01_Box")
.width("100%") .width("100%")
.height(200)
.backgroundColor(0xAFEEE)
.alignItems(HorizontalAlign.Start) .alignItems(HorizontalAlign.Start)
} }
} }
...@@ -60,21 +60,6 @@ struct AlignCenter_AddLayoutWeight { ...@@ -60,21 +60,6 @@ struct AlignCenter_AddLayoutWeight {
.width(500) .width(500)
.height(200) .height(200)
.backgroundColor(0xAFEEEE) .backgroundColor(0xAFEEEE)
Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) {
Text('1')
.width(150)
.height(50)
.backgroundColor(0xF5DEB3)
.key("Center_AddLayoutWeight_021")
.layoutWeight(this.OneLayoutWeight1)
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_AddLayoutWeight_022")
.layoutWeight(this.OneLayoutWeight2)
Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Center_AddLayoutWeight_023")
}
.key("Center_AddLayoutWeight_02")
.width(500)
.height(200)
.backgroundColor(0xAFEEEE)
} }
.width("100%") .width("100%")
} }
......
...@@ -48,8 +48,6 @@ struct AlignCenter_AddMargin { ...@@ -48,8 +48,6 @@ struct AlignCenter_AddMargin {
} }
.key("Center_AddMargin_01_Box") .key("Center_AddMargin_01_Box")
.width("100%") .width("100%")
.height(200)
.backgroundColor(0xAFEEE)
.alignItems(HorizontalAlign.Start) .alignItems(HorizontalAlign.Start)
} }
} }
...@@ -35,7 +35,7 @@ struct AlignCenter_AddPadding { ...@@ -35,7 +35,7 @@ struct AlignCenter_AddPadding {
@State justifyContent: FlexAlign = FlexAlign.Center @State justifyContent: FlexAlign = FlexAlign.Center
build() { build() {
Column() { Column() {
Text('alignContent:Center').fontSize(9).fontColor(0xCCCCCC).width('100%') Text('justifyContent:FlexAlign.Center').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({ justifyContent: this.justifyContent, direction:FlexDirection.Row }) { Flex({ justifyContent: this.justifyContent, direction:FlexDirection.Row }) {
Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Center_AddPadding_011") Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Center_AddPadding_011")
Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_AddPadding_012") Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Center_AddPadding_012")
......
...@@ -90,17 +90,17 @@ export default function AlignCenter_AddLayoutWeight() { ...@@ -90,17 +90,17 @@ export default function AlignCenter_AddLayoutWeight() {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1600] START'); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1600] START');
globalThis.value.message.notify({name:'OneLayoutWeight1', value:1}); globalThis.value.message.notify({name:'OneLayoutWeight1', value:1});
globalThis.value.message.notify({name:'OneLayoutWeight2', value:2}); globalThis.value.message.notify({name:'OneLayoutWeight2', value:2});
globalThis.value.message.notify({name:'OneLayoutWeight3', value:2}); globalThis.value.message.notify({name:'OneLayoutWeight3', value:0});
await CommonFunc.sleep(3000); await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('Center_AddLayoutWeight_01'); let strJson = getInspectorByKey('Center_AddLayoutWeight_01');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Flex'); expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row'); expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.Center'); expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.Center');
let Center_AddLayoutWeight_011 = CommonFunc.getComponentRect('Center_AddLayoutWeight_021'); let Center_AddLayoutWeight_011 = CommonFunc.getComponentRect('Center_AddLayoutWeight_011');
let Center_AddLayoutWeight_012 = CommonFunc.getComponentRect('Center_AddLayoutWeight_022'); let Center_AddLayoutWeight_012 = CommonFunc.getComponentRect('Center_AddLayoutWeight_012');
let Center_AddLayoutWeight_013 = CommonFunc.getComponentRect('Center_AddLayoutWeight_023'); let Center_AddLayoutWeight_013 = CommonFunc.getComponentRect('Center_AddLayoutWeight_013');
let Center_AddLayoutWeight_01 = CommonFunc.getComponentRect('Center_AddLayoutWeight_02'); let Center_AddLayoutWeight_01 = CommonFunc.getComponentRect('Center_AddLayoutWeight_01');
expect(Center_AddLayoutWeight_011.top).assertEqual(Center_AddLayoutWeight_012.top); expect(Center_AddLayoutWeight_011.top).assertEqual(Center_AddLayoutWeight_012.top);
expect(Center_AddLayoutWeight_013.top).assertEqual(Center_AddLayoutWeight_012.top); expect(Center_AddLayoutWeight_013.top).assertEqual(Center_AddLayoutWeight_012.top);
expect(Center_AddLayoutWeight_011.top).assertEqual(Center_AddLayoutWeight_01.top); expect(Center_AddLayoutWeight_011.top).assertEqual(Center_AddLayoutWeight_01.top);
......
...@@ -101,16 +101,16 @@ export default function AlignCenter_AddOneMargin() { ...@@ -101,16 +101,16 @@ export default function AlignCenter_AddOneMargin() {
let Center_AddOneMargin_01 = CommonFunc.getComponentRect('Center_AddOneMargin_01'); let Center_AddOneMargin_01 = CommonFunc.getComponentRect('Center_AddOneMargin_01');
expect(Center_AddOneMargin_01.top).assertEqual(Center_AddOneMargin_012.top); expect(Center_AddOneMargin_01.top).assertEqual(Center_AddOneMargin_012.top);
expect(Center_AddOneMargin_013.top).assertEqual(Center_AddOneMargin_012.top); expect(Center_AddOneMargin_013.top).assertEqual(Center_AddOneMargin_012.top);
expect(Center_AddOneMargin_011.left - Center_AddOneMargin_01.left).assertEqual(vp2px(30)); expect(Center_AddOneMargin_011.left - Center_AddOneMargin_01.left).assertEqual(vp2px(500/17));
expect(Center_AddOneMargin_011.top - Center_AddOneMargin_01.top).assertEqual(vp2px(30)); expect(Center_AddOneMargin_011.top - Center_AddOneMargin_01.top).assertEqual(vp2px(30));
expect(Center_AddOneMargin_012.left - Center_AddOneMargin_011.right).assertEqual(vp2px(30)); expect(Center_AddOneMargin_012.left - Center_AddOneMargin_011.right).assertEqual(vp2px(500/17));
expect(Center_AddOneMargin_012.right).assertEqual(Center_AddOneMargin_013.left); expect(Center_AddOneMargin_012.right).assertEqual(Center_AddOneMargin_013.left);
expect(Center_AddOneMargin_011.bottom - Center_AddOneMargin_011.top).assertEqual(vp2px(50)); expect(Center_AddOneMargin_011.bottom - Center_AddOneMargin_011.top).assertEqual(vp2px(50));
expect(Center_AddOneMargin_012.bottom - Center_AddOneMargin_012.top).assertEqual(vp2px(100)); expect(Center_AddOneMargin_012.bottom - Center_AddOneMargin_012.top).assertEqual(vp2px(100));
expect(Center_AddOneMargin_013.bottom - Center_AddOneMargin_013.top).assertEqual(vp2px(150)); expect(Center_AddOneMargin_013.bottom - Center_AddOneMargin_013.top).assertEqual(vp2px(150));
expect(Center_AddOneMargin_011.right - Center_AddOneMargin_011.left).assertEqual(vp2px(440/3)); expect(Center_AddOneMargin_011.right - Center_AddOneMargin_011.left).assertEqual(vp2px(2500/17));
expect(Center_AddOneMargin_012.right - Center_AddOneMargin_012.left).assertEqual(vp2px(440/3)); expect(Center_AddOneMargin_012.right - Center_AddOneMargin_012.left).assertEqual(vp2px(2500/17));
expect(Center_AddOneMargin_013.right - Center_AddOneMargin_013.left).assertEqual(vp2px(440/3)); expect(Center_AddOneMargin_013.right - Center_AddOneMargin_013.left).assertEqual(vp2px(2500/17));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1500] END'); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1500] END');
done(); done();
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册