gentest support for position: static + initial test
Summary: I am about to embark on supporting `position: static` in Yoga. The enum exists already (and is the default position type, lol) but does not actually do anything and just behaves like `position: relative`. My approach here is to write a bunch of tests to test for the various behaviors of static positions and then develop on Yoga afterwards to get those tests passing. To do this, we need to make a few changes to the gentest files as there is not support for adding `position: static` at the moment: * Make it so that the gentest code can physically write `YGPositionTypeStatic` if it encounters `position: static` in the style * Make it so that gentest.js knows that Yoga's default is actually static. This way the code generated in the tests will actually label nodes for non default values * Explicitly label the position type even when it is not declared in the style prop (with the exception of the default) * Regenerate all the tests Additionally I added the first, basic test: making sure insets do nothing on a statically positioned element. Reviewed By: NickGerleman Differential Revision: D50437855 fbshipit-source-id: 0e8bbf1c224d477ea4592b7563d0b70d2ffa79c8
This commit is contained in:
committed by
Facebook GitHub Bot
parent
7e91004b90
commit
2ea4c043fd
@@ -33,10 +33,12 @@ test('align_items_stretch', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||||
@@ -79,10 +81,12 @@ test('align_items_center', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -126,10 +130,12 @@ test('align_items_flex_start', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.FlexStart);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -173,10 +179,12 @@ test('align_items_flex_end', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.FlexEnd);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(10);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -221,15 +229,18 @@ test('align_baseline', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -284,20 +295,24 @@ test('align_baseline_child', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(50);
|
||||
root_child1_child0.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
@@ -362,37 +377,44 @@ test('align_baseline_child_multiline', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(60);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setFlexDirection(FlexDirection.Row);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexWrap(Wrap.Wrap);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(25);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(25);
|
||||
root_child1_child0.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
const root_child1_child1 = Yoga.Node.create(config);
|
||||
root_child1_child1.setPositionType(PositionType.Relative);
|
||||
root_child1_child1.setWidth(25);
|
||||
root_child1_child1.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child1, 1);
|
||||
|
||||
const root_child1_child2 = Yoga.Node.create(config);
|
||||
root_child1_child2.setPositionType(PositionType.Relative);
|
||||
root_child1_child2.setWidth(25);
|
||||
root_child1_child2.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child2, 2);
|
||||
|
||||
const root_child1_child3 = Yoga.Node.create(config);
|
||||
root_child1_child3.setPositionType(PositionType.Relative);
|
||||
root_child1_child3.setWidth(25);
|
||||
root_child1_child3.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child3, 3);
|
||||
@@ -487,39 +509,46 @@ test('align_baseline_child_multiline_override', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(60);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setFlexDirection(FlexDirection.Row);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexWrap(Wrap.Wrap);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(25);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(25);
|
||||
root_child1_child0.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
const root_child1_child1 = Yoga.Node.create(config);
|
||||
root_child1_child1.setAlignSelf(Align.Baseline);
|
||||
root_child1_child1.setPositionType(PositionType.Relative);
|
||||
root_child1_child1.setWidth(25);
|
||||
root_child1_child1.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child1, 1);
|
||||
|
||||
const root_child1_child2 = Yoga.Node.create(config);
|
||||
root_child1_child2.setPositionType(PositionType.Relative);
|
||||
root_child1_child2.setWidth(25);
|
||||
root_child1_child2.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child2, 2);
|
||||
|
||||
const root_child1_child3 = Yoga.Node.create(config);
|
||||
root_child1_child3.setAlignSelf(Align.Baseline);
|
||||
root_child1_child3.setPositionType(PositionType.Relative);
|
||||
root_child1_child3.setWidth(25);
|
||||
root_child1_child3.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child3, 3);
|
||||
@@ -614,38 +643,45 @@ test('align_baseline_child_multiline_no_override_on_secondline', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(60);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setFlexDirection(FlexDirection.Row);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setFlexWrap(Wrap.Wrap);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(25);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(25);
|
||||
root_child1_child0.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
const root_child1_child1 = Yoga.Node.create(config);
|
||||
root_child1_child1.setPositionType(PositionType.Relative);
|
||||
root_child1_child1.setWidth(25);
|
||||
root_child1_child1.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child1, 1);
|
||||
|
||||
const root_child1_child2 = Yoga.Node.create(config);
|
||||
root_child1_child2.setPositionType(PositionType.Relative);
|
||||
root_child1_child2.setWidth(25);
|
||||
root_child1_child2.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child2, 2);
|
||||
|
||||
const root_child1_child3 = Yoga.Node.create(config);
|
||||
root_child1_child3.setAlignSelf(Align.Baseline);
|
||||
root_child1_child3.setPositionType(PositionType.Relative);
|
||||
root_child1_child3.setWidth(25);
|
||||
root_child1_child3.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child3, 3);
|
||||
@@ -740,21 +776,25 @@ test('align_baseline_child_top', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setPosition(Edge.Top, 10);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(50);
|
||||
root_child1_child0.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
@@ -819,21 +859,25 @@ test('align_baseline_child_top2', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setPosition(Edge.Top, 5);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(50);
|
||||
root_child1_child0.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
@@ -898,25 +942,30 @@ test('align_baseline_double_nested_child', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(50);
|
||||
root_child0_child0.setHeight(20);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(50);
|
||||
root_child1_child0.setHeight(15);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
@@ -990,15 +1039,18 @@ test('align_baseline_column', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -1053,10 +1105,12 @@ test('align_baseline_child_margin', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setMargin(Edge.Left, 5);
|
||||
root_child0.setMargin(Edge.Top, 5);
|
||||
root_child0.setMargin(Edge.Right, 5);
|
||||
@@ -1066,11 +1120,13 @@ test('align_baseline_child_margin', () => {
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setMargin(Edge.Left, 1);
|
||||
root_child1_child0.setMargin(Edge.Top, 1);
|
||||
root_child1_child0.setMargin(Edge.Right, 1);
|
||||
@@ -1139,6 +1195,7 @@ test('align_baseline_child_padding', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setPadding(Edge.Left, 5);
|
||||
root.setPadding(Edge.Top, 5);
|
||||
root.setPadding(Edge.Right, 5);
|
||||
@@ -1147,11 +1204,13 @@ test('align_baseline_child_padding', () => {
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setPadding(Edge.Left, 5);
|
||||
root_child1.setPadding(Edge.Top, 5);
|
||||
root_child1.setPadding(Edge.Right, 5);
|
||||
@@ -1161,6 +1220,7 @@ test('align_baseline_child_padding', () => {
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(50);
|
||||
root_child1_child0.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
@@ -1225,36 +1285,43 @@ test('align_baseline_multiline', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(50);
|
||||
root_child1_child0.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(50);
|
||||
root_child2.setHeight(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child2_child0 = Yoga.Node.create(config);
|
||||
root_child2_child0.setPositionType(PositionType.Relative);
|
||||
root_child2_child0.setWidth(50);
|
||||
root_child2_child0.setHeight(10);
|
||||
root_child2.insertChild(root_child2_child0, 0);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(50);
|
||||
root_child3.setHeight(50);
|
||||
root.insertChild(root_child3, 3);
|
||||
@@ -1348,36 +1415,43 @@ test.skip('align_baseline_multiline_column', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(30);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(20);
|
||||
root_child1_child0.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(40);
|
||||
root_child2.setHeight(70);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child2_child0 = Yoga.Node.create(config);
|
||||
root_child2_child0.setPositionType(PositionType.Relative);
|
||||
root_child2_child0.setWidth(10);
|
||||
root_child2_child0.setHeight(10);
|
||||
root_child2.insertChild(root_child2_child0, 0);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(50);
|
||||
root_child3.setHeight(20);
|
||||
root.insertChild(root_child3, 3);
|
||||
@@ -1471,36 +1545,43 @@ test.skip('align_baseline_multiline_column2', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(30);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(20);
|
||||
root_child1_child0.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(40);
|
||||
root_child2.setHeight(70);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child2_child0 = Yoga.Node.create(config);
|
||||
root_child2_child0.setPositionType(PositionType.Relative);
|
||||
root_child2_child0.setWidth(10);
|
||||
root_child2_child0.setHeight(10);
|
||||
root_child2.insertChild(root_child2_child0, 0);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(50);
|
||||
root_child3.setHeight(20);
|
||||
root.insertChild(root_child3, 3);
|
||||
@@ -1595,36 +1676,43 @@ test('align_baseline_multiline_row_and_column', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(FlexDirection.Row);
|
||||
root.setAlignItems(Align.Baseline);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setFlexWrap(Wrap.Wrap);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPositionType(PositionType.Relative);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
const root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setPositionType(PositionType.Relative);
|
||||
root_child1_child0.setWidth(50);
|
||||
root_child1_child0.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setPositionType(PositionType.Relative);
|
||||
root_child2.setWidth(50);
|
||||
root_child2.setHeight(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
const root_child2_child0 = Yoga.Node.create(config);
|
||||
root_child2_child0.setPositionType(PositionType.Relative);
|
||||
root_child2_child0.setWidth(50);
|
||||
root_child2_child0.setHeight(10);
|
||||
root_child2.insertChild(root_child2_child0, 0);
|
||||
|
||||
const root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setPositionType(PositionType.Relative);
|
||||
root_child3.setWidth(50);
|
||||
root_child3.setHeight(20);
|
||||
root.insertChild(root_child3, 3);
|
||||
@@ -1719,14 +1807,17 @@ test('align_items_center_child_with_margin_bigger_than_parent', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(52);
|
||||
root.setHeight(52);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setAlignItems(Align.Center);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setMargin(Edge.Left, 10);
|
||||
root_child0_child0.setMargin(Edge.Right, 10);
|
||||
root_child0_child0.setWidth(52);
|
||||
@@ -1783,14 +1874,17 @@ test('align_items_flex_end_child_with_margin_bigger_than_parent', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(52);
|
||||
root.setHeight(52);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setAlignItems(Align.FlexEnd);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setMargin(Edge.Left, 10);
|
||||
root_child0_child0.setMargin(Edge.Right, 10);
|
||||
root_child0_child0.setWidth(52);
|
||||
@@ -1847,14 +1941,17 @@ test('align_items_center_child_without_margin_bigger_than_parent', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(52);
|
||||
root.setHeight(52);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setAlignItems(Align.Center);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(72);
|
||||
root_child0_child0.setHeight(72);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
@@ -1909,14 +2006,17 @@ test('align_items_flex_end_child_without_margin_bigger_than_parent', () => {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setJustifyContent(Justify.Center);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(52);
|
||||
root.setHeight(52);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setAlignItems(Align.FlexEnd);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setWidth(72);
|
||||
root_child0_child0.setHeight(72);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
@@ -1970,21 +2070,25 @@ test('align_center_should_size_based_on_content', () => {
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Align.Center);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setMargin(Edge.Top, 20);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setJustifyContent(Justify.Center);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexShrink(1);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0.setFlexShrink(1);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0.setWidth(20);
|
||||
root_child0_child0_child0.setHeight(20);
|
||||
root_child0_child0.insertChild(root_child0_child0_child0, 0);
|
||||
@@ -2047,21 +2151,25 @@ test('align_stretch_should_size_based_on_parent', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setMargin(Edge.Top, 20);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setJustifyContent(Justify.Center);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root_child0.setFlexShrink(1);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0.setFlexShrink(1);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0.setWidth(20);
|
||||
root_child0_child0_child0.setHeight(20);
|
||||
root_child0_child0.insertChild(root_child0_child0_child0, 0);
|
||||
@@ -2124,19 +2232,23 @@ test('align_flex_start_with_shrinking_children', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(500);
|
||||
root.setHeight(500);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setAlignItems(Align.FlexStart);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0.setFlexShrink(1);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0_child0.setFlexShrink(1);
|
||||
root_child0_child0.insertChild(root_child0_child0_child0, 0);
|
||||
@@ -2199,18 +2311,22 @@ test('align_flex_start_with_stretching_children', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(500);
|
||||
root.setHeight(500);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0.setFlexShrink(1);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0_child0.setFlexShrink(1);
|
||||
root_child0_child0.insertChild(root_child0_child0_child0, 0);
|
||||
@@ -2273,19 +2389,23 @@ test('align_flex_start_with_shrinking_children_with_stretch', () => {
|
||||
|
||||
try {
|
||||
root = Yoga.Node.create(config);
|
||||
root.setPositionType(PositionType.Absolute);
|
||||
root.setWidth(500);
|
||||
root.setHeight(500);
|
||||
|
||||
const root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setAlignItems(Align.FlexStart);
|
||||
root_child0.setPositionType(PositionType.Relative);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
const root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0.setFlexShrink(1);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
const root_child0_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0_child0.setPositionType(PositionType.Relative);
|
||||
root_child0_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0_child0.setFlexShrink(1);
|
||||
root_child0_child0.insertChild(root_child0_child0_child0, 0);
|
||||
|
Reference in New Issue
Block a user