提交 fab8e902 编写于 作者: H hekun

submit the test code

Signed-off-by: Nhekun <hekun18@huawei.com>
上级 583b5665
......@@ -77,37 +77,6 @@ export default function flexExceed_CenterJsunit() {
done();
});
/**
* @tc.number SUB_ACE_FLEXALIGNITEMS_CENTER_0700
* @tc.name testFlexItemAlignCenterSetMarPadExceed
* @tc.desc Subcomponent outside when parent component set margin and padding.
*/
it('testFlexItemAlignCenterSetMarPadExceed', 0, async function (done) {
console.info('new testFlexItemAlignCenterSetMarPadExceed START');
globalThis.value.message.notify({name:'padding', value:30});
globalThis.value.message.notify({name:'margin', value:30});
await CommonFunc.sleep(2000);
let strJson1 = getInspectorByKey('flexExceed01');
let obj1 = JSON.parse(strJson1);
let textExceed01 = CommonFunc.getComponentRect('textExceed01');
let textExceed02 = CommonFunc.getComponentRect('textExceed02');
let textExceed03 = CommonFunc.getComponentRect('textExceed03');
let flexExceed01 = CommonFunc.getComponentRect('flexExceed01');
expect(Math.round(textExceed01.left - flexExceed01.left)).assertEqual(vp2px(30))
expect(textExceed03.right).assertLess(flexExceed01.right)
expect(textExceed01.top - flexExceed01.top).assertEqual(flexExceed01.bottom - textExceed01.bottom)
expect(textExceed02.top - flexExceed01.top).assertEqual(flexExceed01.bottom - textExceed02.bottom)
expect(textExceed03.top - flexExceed01.top).assertEqual(flexExceed01.bottom - textExceed03.bottom)
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(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Center')
console.info('new testFlexItemAlignCenterSetMarPadExceed END');
done();
});
})
}
......@@ -76,36 +76,5 @@ export default function flexPadding_CenterJsunit() {
done();
});
/**
* @tc.number SUB_ACE_FLEXALIGNITEMS_CENTER_0400
* @tc.name testFlexItemAlignCenterParentSetPaddingExceed
* @tc.desc Parent component set paddding,subcomponent exceedS the parent component.
*/
it('testFlexItemAlignCenterParentSetPaddingExceed', 0, async function (done) {
console.info('new testFlexItemAlignCenterParentSetPaddingExceed START');
globalThis.value.message.notify({name:'padding', value:30});
await CommonFunc.sleep(2000);
let strJson1 = getInspectorByKey('flexPadding01');
let obj1 = JSON.parse(strJson1);
let textFlexPadding01 = CommonFunc.getComponentRect('textFlexPadding01');
let textFlexPadding02 = CommonFunc.getComponentRect('textFlexPadding02');
let textFlexPadding03 = CommonFunc.getComponentRect('textFlexPadding03');
let flexPadding01 = CommonFunc.getComponentRect('flexPadding01');
expect(Math.round(textFlexPadding01.left - flexPadding01.left)).assertEqual(vp2px(30))
expect(Math.round(flexPadding01.right - textFlexPadding03.right)).assertEqual(vp2px(30))
expect(textFlexPadding01.top - flexPadding01.top).assertEqual(flexPadding01.bottom - textFlexPadding01.bottom)
expect(textFlexPadding02.top - flexPadding01.top).assertEqual(flexPadding01.bottom - textFlexPadding02.bottom)
expect(textFlexPadding03.top - flexPadding01.top).assertEqual(flexPadding01.bottom - textFlexPadding03.bottom)
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(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Center')
console.info('new testFlexItemAlignCenterParentSetPaddingExceed END');
done();
});
})
}
......@@ -77,38 +77,6 @@ export default function flexExceed_EndJsunit() {
done();
});
/**
* @tc.number SUB_ACE_FLEXALIGNITEMS_END_0700
* @tc.name testFlexItemAlignEndSetMarPadExceed
* @tc.desc Subcomponent outside when parent component set margin and padding.
*/
it('testFlexItemAlignEndSetMarPadExceed', 0, async function (done) {
console.info('new testFlexItemAlignEndSetMarPadExceed START');
globalThis.value.message.notify({name:'padding', value:30});
globalThis.value.message.notify({name:'margin', value:30});
await CommonFunc.sleep(2000);
let strJson1 = getInspectorByKey('flexExceed01');
let obj1 = JSON.parse(strJson1);
let textExceed01 = CommonFunc.getComponentRect('textExceed01');
let textExceed02 = CommonFunc.getComponentRect('textExceed02');
let textExceed03 = CommonFunc.getComponentRect('textExceed03');
let flexExceed01 = CommonFunc.getComponentRect('flexExceed01');
expect(textExceed01.bottom).assertEqual(textExceed02.bottom)
expect(textExceed02.bottom).assertEqual(textExceed03.bottom)
expect(flexExceed01.bottom - textExceed01.bottom).assertEqual(vp2px(30))
expect(textExceed01.left - flexExceed01.left).assertEqual(vp2px(30))
expect(textExceed01.bottom - textExceed01.top).assertEqual(vp2px(50))
expect(textExceed02.bottom - textExceed02.top).assertEqual(vp2px(100))
expect(textExceed03.bottom - textExceed03.top).assertEqual(vp2px(150))
expect(textExceed01.right - textExceed01.left).assertEqual(vp2px(440/3))
expect(textExceed02.right - textExceed02.left).assertEqual(vp2px(440/3))
expect(textExceed03.right - textExceed03.left).assertEqual(vp2px(440/3))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.End')
console.info('new testFlexItemAlignEndSetMarPadExceed END');
done();
});
})
}
......@@ -81,39 +81,6 @@ export default function flexPadding_EndJsunit() {
done();
});
/**
* @tc.number SUB_ACE_FLEXALIGNITEMS_END_0400
* @tc.name testFlexItemAlignEndParentSetPaddingExceed
* @tc.desc Parent component set paddding,subcomponent exceedS the parent component.
*/
it('testFlexItemAlignEndParentSetPaddingExceed', 0, async function (done) {
console.info('new testFlexItemAlignEndParentSetPaddingExceed START');
globalThis.value.message.notify({name:'padding', value:30});
await CommonFunc.sleep(2000);
let strJson1 = getInspectorByKey('flexPadding01');
let obj1 = JSON.parse(strJson1);
let strJson2 = getInspectorByKey('textFlexPadding01');
let obj2 = JSON.parse(strJson2);
let textFlexPadding01 = CommonFunc.getComponentRect('textFlexPadding01')
let textFlexPadding02 = CommonFunc.getComponentRect('textFlexPadding02')
let textFlexPadding03 = CommonFunc.getComponentRect('textFlexPadding03')
let flexPadding01 = CommonFunc.getComponentRect('flexPadding01')
expect(textFlexPadding01.bottom).assertEqual(textFlexPadding02.bottom)
expect(textFlexPadding02.bottom).assertEqual(textFlexPadding03.bottom)
expect(Math.round(flexPadding01.bottom - textFlexPadding01.bottom)).assertEqual(vp2px(30))
expect(Math.round(textFlexPadding01.left - flexPadding01.left)).assertEqual(vp2px(30))
expect(textFlexPadding03.right).assertLess(flexPadding01.right)
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(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.End')
console.info('new testFlexItemAlignEndParentSetPaddingExceed END');
done();
});
})
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册