From 6f9113308921077dbda78c2cc1a540401f06d90d Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Wed, 10 May 2023 21:10:46 -0700 Subject: [PATCH 1/2] Add `data-disabled` to test fixtures Summary: This can be marked in fixtures to skip a test without commenting it out. We add one more usage of this. The same functionality existed (unused) before for `experiments`, which I changed to `data-experiments`. Formatting of JS tests changed to be closer to what Prettier would output, and to remove usage of `Yoga.UNDEFINED` which doesn't existi and just resolves to `undefined` (this is converted to NaN by the wrapper layer). Differential Revision: D45723003 fbshipit-source-id: c014e1695d90fcb44d62f6a636ddbb0d86ec6eff --- .../tests/Facebook.Yoga/YGAlignItemsTest.cs | 10 +- .../Facebook.Yoga/YGMinMaxDimensionTest.cs | 115 +++++++ .../tests/Facebook.Yoga/YGPercentageTest.cs | 58 ++++ gentest/fixtures/YGAlignItemsTest.html | 6 +- gentest/fixtures/YGMinMaxDimensionTest.html | 12 +- gentest/fixtures/YGPercentageTest.html | 6 +- gentest/gentest-cpp.js | 7 +- gentest/gentest-cs.js | 5 +- gentest/gentest-java.js | 6 +- gentest/gentest-javascript.js | 11 +- gentest/gentest.js | 11 +- .../facebook/yoga/YGAbsolutePositionTest.java | 1 + .../com/facebook/yoga/YGAlignContentTest.java | 1 + .../com/facebook/yoga/YGAlignItemsTest.java | 11 +- .../com/facebook/yoga/YGAlignSelfTest.java | 1 + .../com/facebook/yoga/YGAndroidNewsFeed.java | 1 + .../tests/com/facebook/yoga/YGBorderTest.java | 1 + .../com/facebook/yoga/YGDimensionTest.java | 1 + .../com/facebook/yoga/YGDisplayTest.java | 1 + .../facebook/yoga/YGFlexDirectionTest.java | 1 + java/tests/com/facebook/yoga/YGFlexTest.java | 1 + .../com/facebook/yoga/YGFlexWrapTest.java | 1 + java/tests/com/facebook/yoga/YGGapTest.java | 1 + .../facebook/yoga/YGJustifyContentTest.java | 1 + .../tests/com/facebook/yoga/YGMarginTest.java | 1 + .../facebook/yoga/YGMinMaxDimensionTest.java | 114 +++++++ .../com/facebook/yoga/YGPaddingTest.java | 1 + .../com/facebook/yoga/YGPercentageTest.java | 58 ++++ .../com/facebook/yoga/YGRoundingTest.java | 1 + .../com/facebook/yoga/YGSizeOverflowTest.java | 1 + .../generated/YGAbsolutePositionTest.test.js | 192 +++++------ .../generated/YGAlignContentTest.test.js | 152 ++++----- .../tests/generated/YGAlignItemsTest.test.js | 232 ++++++------- .../tests/generated/YGAlignSelfTest.test.js | 40 +-- .../tests/generated/YGAndroidNewsFeed.test.js | 8 +- .../tests/generated/YGBorderTest.test.js | 40 +-- .../tests/generated/YGDimensionTest.test.js | 16 +- .../tests/generated/YGDisplayTest.test.js | 48 +-- .../generated/YGFlexDirectionTest.test.js | 48 +-- javascript/tests/generated/YGFlexTest.test.js | 80 ++--- .../tests/generated/YGFlexWrapTest.test.js | 160 ++++----- javascript/tests/generated/YGGapTest.test.js | 184 +++++----- .../generated/YGJustifyContentTest.test.js | 144 ++++---- .../tests/generated/YGMarginTest.test.js | 264 +++++++-------- .../generated/YGMinMaxDimensionTest.test.js | 315 ++++++++++++------ .../tests/generated/YGPaddingTest.test.js | 48 +-- .../tests/generated/YGPercentageTest.test.js | 214 +++++++----- .../tests/generated/YGRoundingTest.test.js | 104 +++--- .../generated/YGSizeOverflowTest.test.js | 24 +- tests/generated/YGAlignItemsTest.cpp | 12 +- tests/generated/YGMinMaxDimensionTest.cpp | 117 +++++++ tests/generated/YGPercentageTest.cpp | 59 ++++ 52 files changed, 1846 insertions(+), 1101 deletions(-) diff --git a/csharp/tests/Facebook.Yoga/YGAlignItemsTest.cs b/csharp/tests/Facebook.Yoga/YGAlignItemsTest.cs index 8e879acd..1740bb4b 100644 --- a/csharp/tests/Facebook.Yoga/YGAlignItemsTest.cs +++ b/csharp/tests/Facebook.Yoga/YGAlignItemsTest.cs @@ -1266,6 +1266,7 @@ namespace Facebook.Yoga } [Test] + [Ignore] public void Test_align_baseline_multiline_column() { YogaConfig config = new YogaConfig(); @@ -1358,7 +1359,7 @@ namespace Facebook.Yoga Assert.AreEqual(50f, root_child0.LayoutWidth); Assert.AreEqual(50f, root_child0.LayoutHeight); - Assert.AreEqual(70f, root_child1.LayoutX); + Assert.AreEqual(50f, root_child1.LayoutX); Assert.AreEqual(50f, root_child1.LayoutY); Assert.AreEqual(30f, root_child1.LayoutWidth); Assert.AreEqual(50f, root_child1.LayoutHeight); @@ -1368,7 +1369,7 @@ namespace Facebook.Yoga Assert.AreEqual(20f, root_child1_child0.LayoutWidth); Assert.AreEqual(20f, root_child1_child0.LayoutHeight); - Assert.AreEqual(10f, root_child2.LayoutX); + Assert.AreEqual(0f, root_child2.LayoutX); Assert.AreEqual(0f, root_child2.LayoutY); Assert.AreEqual(40f, root_child2.LayoutWidth); Assert.AreEqual(70f, root_child2.LayoutHeight); @@ -1385,6 +1386,7 @@ namespace Facebook.Yoga } [Test] + [Ignore] public void Test_align_baseline_multiline_column2() { YogaConfig config = new YogaConfig(); @@ -1477,7 +1479,7 @@ namespace Facebook.Yoga Assert.AreEqual(50f, root_child0.LayoutWidth); Assert.AreEqual(50f, root_child0.LayoutHeight); - Assert.AreEqual(70f, root_child1.LayoutX); + Assert.AreEqual(50f, root_child1.LayoutX); Assert.AreEqual(50f, root_child1.LayoutY); Assert.AreEqual(30f, root_child1.LayoutWidth); Assert.AreEqual(50f, root_child1.LayoutHeight); @@ -1487,7 +1489,7 @@ namespace Facebook.Yoga Assert.AreEqual(20f, root_child1_child0.LayoutWidth); Assert.AreEqual(20f, root_child1_child0.LayoutHeight); - Assert.AreEqual(10f, root_child2.LayoutX); + Assert.AreEqual(0f, root_child2.LayoutX); Assert.AreEqual(0f, root_child2.LayoutY); Assert.AreEqual(40f, root_child2.LayoutWidth); Assert.AreEqual(70f, root_child2.LayoutHeight); diff --git a/csharp/tests/Facebook.Yoga/YGMinMaxDimensionTest.cs b/csharp/tests/Facebook.Yoga/YGMinMaxDimensionTest.cs index af6f15e5..30b782b4 100644 --- a/csharp/tests/Facebook.Yoga/YGMinMaxDimensionTest.cs +++ b/csharp/tests/Facebook.Yoga/YGMinMaxDimensionTest.cs @@ -100,6 +100,121 @@ namespace Facebook.Yoga Assert.AreEqual(50f, root_child0.LayoutHeight); } + [Test] + [Ignore] + public void Test_min_height() + { + YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); + + YogaNode root = new YogaNode(config); + root.Width = 100; + root.Height = 100; + + YogaNode root_child0 = new YogaNode(config); + root_child0.FlexGrow = 1; + root_child0.MinHeight = 60; + root.Insert(0, root_child0); + + YogaNode root_child1 = new YogaNode(config); + root_child1.FlexGrow = 1; + root.Insert(1, root_child1); + root.StyleDirection = YogaDirection.LTR; + root.CalculateLayout(); + + Assert.AreEqual(0f, root.LayoutX); + Assert.AreEqual(0f, root.LayoutY); + Assert.AreEqual(100f, root.LayoutWidth); + Assert.AreEqual(100f, root.LayoutHeight); + + Assert.AreEqual(0f, root_child0.LayoutX); + Assert.AreEqual(0f, root_child0.LayoutY); + Assert.AreEqual(100f, root_child0.LayoutWidth); + Assert.AreEqual(60f, root_child0.LayoutHeight); + + Assert.AreEqual(0f, root_child1.LayoutX); + Assert.AreEqual(60f, root_child1.LayoutY); + Assert.AreEqual(100f, root_child1.LayoutWidth); + Assert.AreEqual(40f, root_child1.LayoutHeight); + + root.StyleDirection = YogaDirection.RTL; + root.CalculateLayout(); + + Assert.AreEqual(0f, root.LayoutX); + Assert.AreEqual(0f, root.LayoutY); + Assert.AreEqual(100f, root.LayoutWidth); + Assert.AreEqual(100f, root.LayoutHeight); + + Assert.AreEqual(0f, root_child0.LayoutX); + Assert.AreEqual(0f, root_child0.LayoutY); + Assert.AreEqual(100f, root_child0.LayoutWidth); + Assert.AreEqual(60f, root_child0.LayoutHeight); + + Assert.AreEqual(0f, root_child1.LayoutX); + Assert.AreEqual(60f, root_child1.LayoutY); + Assert.AreEqual(100f, root_child1.LayoutWidth); + Assert.AreEqual(40f, root_child1.LayoutHeight); + } + + [Test] + [Ignore] + public void Test_min_width() + { + YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); + + YogaNode root = new YogaNode(config); + root.FlexDirection = YogaFlexDirection.Row; + root.Width = 100; + root.Height = 100; + + YogaNode root_child0 = new YogaNode(config); + root_child0.FlexGrow = 1; + root_child0.MinWidth = 60; + root.Insert(0, root_child0); + + YogaNode root_child1 = new YogaNode(config); + root_child1.FlexGrow = 1; + root.Insert(1, root_child1); + root.StyleDirection = YogaDirection.LTR; + root.CalculateLayout(); + + Assert.AreEqual(0f, root.LayoutX); + Assert.AreEqual(0f, root.LayoutY); + Assert.AreEqual(100f, root.LayoutWidth); + Assert.AreEqual(100f, root.LayoutHeight); + + Assert.AreEqual(0f, root_child0.LayoutX); + Assert.AreEqual(0f, root_child0.LayoutY); + Assert.AreEqual(60f, root_child0.LayoutWidth); + Assert.AreEqual(100f, root_child0.LayoutHeight); + + Assert.AreEqual(60f, root_child1.LayoutX); + Assert.AreEqual(0f, root_child1.LayoutY); + Assert.AreEqual(40f, root_child1.LayoutWidth); + Assert.AreEqual(100f, root_child1.LayoutHeight); + + root.StyleDirection = YogaDirection.RTL; + root.CalculateLayout(); + + Assert.AreEqual(0f, root.LayoutX); + Assert.AreEqual(0f, root.LayoutY); + Assert.AreEqual(100f, root.LayoutWidth); + Assert.AreEqual(100f, root.LayoutHeight); + + Assert.AreEqual(40f, root_child0.LayoutX); + Assert.AreEqual(0f, root_child0.LayoutY); + Assert.AreEqual(60f, root_child0.LayoutWidth); + Assert.AreEqual(100f, root_child0.LayoutHeight); + + Assert.AreEqual(0f, root_child1.LayoutX); + Assert.AreEqual(0f, root_child1.LayoutY); + Assert.AreEqual(40f, root_child1.LayoutWidth); + Assert.AreEqual(100f, root_child1.LayoutHeight); + } + [Test] public void Test_justify_content_min_max() { diff --git a/csharp/tests/Facebook.Yoga/YGPercentageTest.cs b/csharp/tests/Facebook.Yoga/YGPercentageTest.cs index 7d0cad6b..2ae950e7 100644 --- a/csharp/tests/Facebook.Yoga/YGPercentageTest.cs +++ b/csharp/tests/Facebook.Yoga/YGPercentageTest.cs @@ -263,6 +263,64 @@ namespace Facebook.Yoga Assert.AreEqual(75f, root_child1.LayoutHeight); } + [Test] + [Ignore] + public void Test_percentage_flex_basis_cross_min_height() + { + YogaConfig config = new YogaConfig(); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.SetExperimentalFeatureEnabled(YogaExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); + + YogaNode root = new YogaNode(config); + root.Width = 200; + root.Height = 200; + + YogaNode root_child0 = new YogaNode(config); + root_child0.FlexGrow = 1; + root_child0.MinHeight = 60.Percent(); + root.Insert(0, root_child0); + + YogaNode root_child1 = new YogaNode(config); + root_child1.FlexGrow = 2; + root_child1.MinHeight = 10.Percent(); + root.Insert(1, root_child1); + root.StyleDirection = YogaDirection.LTR; + root.CalculateLayout(); + + Assert.AreEqual(0f, root.LayoutX); + Assert.AreEqual(0f, root.LayoutY); + Assert.AreEqual(200f, root.LayoutWidth); + Assert.AreEqual(200f, root.LayoutHeight); + + Assert.AreEqual(0f, root_child0.LayoutX); + Assert.AreEqual(0f, root_child0.LayoutY); + Assert.AreEqual(200f, root_child0.LayoutWidth); + Assert.AreEqual(120f, root_child0.LayoutHeight); + + Assert.AreEqual(0f, root_child1.LayoutX); + Assert.AreEqual(120f, root_child1.LayoutY); + Assert.AreEqual(200f, root_child1.LayoutWidth); + Assert.AreEqual(80f, root_child1.LayoutHeight); + + root.StyleDirection = YogaDirection.RTL; + root.CalculateLayout(); + + Assert.AreEqual(0f, root.LayoutX); + Assert.AreEqual(0f, root.LayoutY); + Assert.AreEqual(200f, root.LayoutWidth); + Assert.AreEqual(200f, root.LayoutHeight); + + Assert.AreEqual(0f, root_child0.LayoutX); + Assert.AreEqual(0f, root_child0.LayoutY); + Assert.AreEqual(200f, root_child0.LayoutWidth); + Assert.AreEqual(120f, root_child0.LayoutHeight); + + Assert.AreEqual(0f, root_child1.LayoutX); + Assert.AreEqual(120f, root_child1.LayoutY); + Assert.AreEqual(200f, root_child1.LayoutWidth); + Assert.AreEqual(80f, root_child1.LayoutHeight); + } + [Test] public void Test_percentage_flex_basis_main_max_height() { diff --git a/gentest/fixtures/YGAlignItemsTest.html b/gentest/fixtures/YGAlignItemsTest.html index 57bafc0f..e5ee95f4 100644 --- a/gentest/fixtures/YGAlignItemsTest.html +++ b/gentest/fixtures/YGAlignItemsTest.html @@ -111,7 +111,8 @@
-
+ +
@@ -122,7 +123,8 @@
-
+ +
diff --git a/gentest/fixtures/YGMinMaxDimensionTest.html b/gentest/fixtures/YGMinMaxDimensionTest.html index f083d908..0f41dad0 100644 --- a/gentest/fixtures/YGMinMaxDimensionTest.html +++ b/gentest/fixtures/YGMinMaxDimensionTest.html @@ -6,21 +6,17 @@
- - +
---> - - +
--->
diff --git a/gentest/fixtures/YGPercentageTest.html b/gentest/fixtures/YGPercentageTest.html index 98f36604..7749e5ff 100644 --- a/gentest/fixtures/YGPercentageTest.html +++ b/gentest/fixtures/YGPercentageTest.html @@ -21,13 +21,11 @@
- - +
--->
diff --git a/gentest/gentest-cpp.js b/gentest/gentest-cpp.js index 37971195..9076958b 100644 --- a/gentest/gentest-cpp.js +++ b/gentest/gentest-cpp.js @@ -34,10 +34,15 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, { ]); }}, - emitTestPrologue:{value:function(name, experiments) { + emitTestPrologue:{value:function(name, experiments, disabled) { this.push('TEST(YogaTest, ' + name + ') {'); this.pushIndent(); + if (disabled) { + this.push('GTEST_SKIP();'); + this.push(''); + } + this.push('const YGConfigRef config = YGConfigNew();') for (var i in experiments) { this.push('YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeature' + experiments[i] +', true);'); diff --git a/gentest/gentest-cs.js b/gentest/gentest-cs.js index e1c34df0..f6eb3f32 100644 --- a/gentest/gentest-cs.js +++ b/gentest/gentest-cs.js @@ -45,8 +45,11 @@ CSEmitter.prototype = Object.create(Emitter.prototype, { this.pushIndent(); }}, - emitTestPrologue:{value:function(name, experiments) { + emitTestPrologue:{value:function(name, experiments, disabled) { this.push('[Test]'); + if (disabled) { + this.push('[Ignore]'); + } this.push('public void Test_' + name + '()'); this.push('{'); this.pushIndent(); diff --git a/gentest/gentest-java.js b/gentest/gentest-java.js index ec22074e..b36fa1ce 100644 --- a/gentest/gentest-java.js +++ b/gentest/gentest-java.js @@ -44,6 +44,7 @@ JavaEmitter.prototype = Object.create(Emitter.prototype, { '', 'import static org.junit.Assert.assertEquals;', '', + 'import org.junit.Ignore;', 'import org.junit.Test;', 'import org.junit.runner.RunWith;', 'import org.junit.runners.Parameterized;', @@ -67,8 +68,11 @@ JavaEmitter.prototype = Object.create(Emitter.prototype, { ]); }}, - emitTestPrologue:{value:function(name, experiments) { + emitTestPrologue:{value:function(name, experiments, disabled) { this.push('@Test'); + if (disabled) { + this.push('@Ignore'); + } this.push('public void test_' + name + '() {'); this.pushIndent(); diff --git a/gentest/gentest-javascript.js b/gentest/gentest-javascript.js index 8e596dfb..0f5f9095 100644 --- a/gentest/gentest-javascript.js +++ b/gentest/gentest-javascript.js @@ -33,8 +33,9 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, { emitPrologue:{value:function() {}}, - emitTestPrologue:{value:function(name, experiments) { - this.push('test(' + JSON.stringify(name) + ', () => {'); + emitTestPrologue:{value:function(name, experiments, ignore) { + const testFn = ignore ? `test.skip` : 'test'; + this.push(`${testFn}('${name}', () => {`); this.pushIndent(); this.push('const config = Yoga.Config.create();'); this.push('let root;'); @@ -64,7 +65,7 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, { this.push('} finally {'); this.pushIndent(); - this.push('if (typeof root !== "undefined") {'); + this.push('if (typeof root !== \'undefined\') {'); this.pushIndent(); this.push('root.freeRecursive();'); this.popIndent(); @@ -135,13 +136,13 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, { YGWrapWrap:{value:'Yoga.WRAP_WRAP'}, YGWrapWrapReverse:{value: 'Yoga.WRAP_WRAP_REVERSE'}, - YGUndefined:{value:'Yoga.UNDEFINED'}, + YGUndefined:{value:'undefined'}, YGDisplayFlex:{value:'Yoga.DISPLAY_FLEX'}, YGDisplayNone:{value:'Yoga.DISPLAY_NONE'}, YGNodeCalculateLayout:{value:function(node, dir, experiments) { - this.push(node + '.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, ' + dir + ');'); + this.push(node + '.calculateLayout(undefined, undefined, ' + dir + ');'); }}, YGNodeInsertChild:{value:function(parentName, nodeName, index) { diff --git a/gentest/gentest.js b/gentest/gentest.js index f4426bf1..255735b1 100755 --- a/gentest/gentest.js +++ b/gentest/gentest.js @@ -68,7 +68,11 @@ function printTest(e, ext, LTRContainer, RTLContainer, genericContainer) { for (var i = 0; i < genericLayoutTree.length; i++) { - e.emitTestPrologue(genericLayoutTree[i].name, genericLayoutTree[i].experiments); + e.emitTestPrologue( + genericLayoutTree[i].name, + genericLayoutTree[i].experiments, + genericLayoutTree[i].disabled + ); if (genericLayoutTree[i].name == 'wrap_column') { // Modify width and left values due to both safari and chrome not abiding by the @@ -475,9 +479,10 @@ function calculateTree(root, roundToPixelGrid) { style: getYogaStyle(child), declaredStyle: child.style, rawStyle: child.getAttribute('style'), - experiments: child.getAttribute('experiments') - ? child.getAttribute('experiments').split(' ') + experiments: child.dataset.experiments + ? child.dataset.experiments.split(' ') : DEFAULT_EXPERIMENTS, + disabled: child.dataset.disabled === 'true', }; var size = getRoundedSize(child); diff --git a/java/tests/com/facebook/yoga/YGAbsolutePositionTest.java b/java/tests/com/facebook/yoga/YGAbsolutePositionTest.java index 5220217a..2a80badd 100644 --- a/java/tests/com/facebook/yoga/YGAbsolutePositionTest.java +++ b/java/tests/com/facebook/yoga/YGAbsolutePositionTest.java @@ -11,6 +11,7 @@ package com.facebook.yoga; import static org.junit.Assert.assertEquals; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; diff --git a/java/tests/com/facebook/yoga/YGAlignContentTest.java b/java/tests/com/facebook/yoga/YGAlignContentTest.java index a3bdce56..31751e7d 100644 --- a/java/tests/com/facebook/yoga/YGAlignContentTest.java +++ b/java/tests/com/facebook/yoga/YGAlignContentTest.java @@ -11,6 +11,7 @@ package com.facebook.yoga; import static org.junit.Assert.assertEquals; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; diff --git a/java/tests/com/facebook/yoga/YGAlignItemsTest.java b/java/tests/com/facebook/yoga/YGAlignItemsTest.java index 3b13e585..ec45c24f 100644 --- a/java/tests/com/facebook/yoga/YGAlignItemsTest.java +++ b/java/tests/com/facebook/yoga/YGAlignItemsTest.java @@ -11,6 +11,7 @@ package com.facebook.yoga; import static org.junit.Assert.assertEquals; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -1259,6 +1260,7 @@ public class YGAlignItemsTest { } @Test + @Ignore public void test_align_baseline_multiline_column() { YogaConfig config = YogaConfigFactory.create(); config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); @@ -1350,7 +1352,7 @@ public class YGAlignItemsTest { assertEquals(50f, root_child0.getLayoutWidth(), 0.0f); assertEquals(50f, root_child0.getLayoutHeight(), 0.0f); - assertEquals(70f, root_child1.getLayoutX(), 0.0f); + assertEquals(50f, root_child1.getLayoutX(), 0.0f); assertEquals(50f, root_child1.getLayoutY(), 0.0f); assertEquals(30f, root_child1.getLayoutWidth(), 0.0f); assertEquals(50f, root_child1.getLayoutHeight(), 0.0f); @@ -1360,7 +1362,7 @@ public class YGAlignItemsTest { assertEquals(20f, root_child1_child0.getLayoutWidth(), 0.0f); assertEquals(20f, root_child1_child0.getLayoutHeight(), 0.0f); - assertEquals(10f, root_child2.getLayoutX(), 0.0f); + assertEquals(0f, root_child2.getLayoutX(), 0.0f); assertEquals(0f, root_child2.getLayoutY(), 0.0f); assertEquals(40f, root_child2.getLayoutWidth(), 0.0f); assertEquals(70f, root_child2.getLayoutHeight(), 0.0f); @@ -1377,6 +1379,7 @@ public class YGAlignItemsTest { } @Test + @Ignore public void test_align_baseline_multiline_column2() { YogaConfig config = YogaConfigFactory.create(); config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); @@ -1468,7 +1471,7 @@ public class YGAlignItemsTest { assertEquals(50f, root_child0.getLayoutWidth(), 0.0f); assertEquals(50f, root_child0.getLayoutHeight(), 0.0f); - assertEquals(70f, root_child1.getLayoutX(), 0.0f); + assertEquals(50f, root_child1.getLayoutX(), 0.0f); assertEquals(50f, root_child1.getLayoutY(), 0.0f); assertEquals(30f, root_child1.getLayoutWidth(), 0.0f); assertEquals(50f, root_child1.getLayoutHeight(), 0.0f); @@ -1478,7 +1481,7 @@ public class YGAlignItemsTest { assertEquals(20f, root_child1_child0.getLayoutWidth(), 0.0f); assertEquals(20f, root_child1_child0.getLayoutHeight(), 0.0f); - assertEquals(10f, root_child2.getLayoutX(), 0.0f); + assertEquals(0f, root_child2.getLayoutX(), 0.0f); assertEquals(0f, root_child2.getLayoutY(), 0.0f); assertEquals(40f, root_child2.getLayoutWidth(), 0.0f); assertEquals(70f, root_child2.getLayoutHeight(), 0.0f); diff --git a/java/tests/com/facebook/yoga/YGAlignSelfTest.java b/java/tests/com/facebook/yoga/YGAlignSelfTest.java index 8a47fddc..bea89532 100644 --- a/java/tests/com/facebook/yoga/YGAlignSelfTest.java +++ b/java/tests/com/facebook/yoga/YGAlignSelfTest.java @@ -11,6 +11,7 @@ package com.facebook.yoga; import static org.junit.Assert.assertEquals; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; diff --git a/java/tests/com/facebook/yoga/YGAndroidNewsFeed.java b/java/tests/com/facebook/yoga/YGAndroidNewsFeed.java index 8747ec96..5a20f2cf 100644 --- a/java/tests/com/facebook/yoga/YGAndroidNewsFeed.java +++ b/java/tests/com/facebook/yoga/YGAndroidNewsFeed.java @@ -11,6 +11,7 @@ package com.facebook.yoga; import static org.junit.Assert.assertEquals; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; diff --git a/java/tests/com/facebook/yoga/YGBorderTest.java b/java/tests/com/facebook/yoga/YGBorderTest.java index ac72b09f..397817fa 100644 --- a/java/tests/com/facebook/yoga/YGBorderTest.java +++ b/java/tests/com/facebook/yoga/YGBorderTest.java @@ -11,6 +11,7 @@ package com.facebook.yoga; import static org.junit.Assert.assertEquals; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; diff --git a/java/tests/com/facebook/yoga/YGDimensionTest.java b/java/tests/com/facebook/yoga/YGDimensionTest.java index 915726e8..f8febced 100644 --- a/java/tests/com/facebook/yoga/YGDimensionTest.java +++ b/java/tests/com/facebook/yoga/YGDimensionTest.java @@ -11,6 +11,7 @@ package com.facebook.yoga; import static org.junit.Assert.assertEquals; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; diff --git a/java/tests/com/facebook/yoga/YGDisplayTest.java b/java/tests/com/facebook/yoga/YGDisplayTest.java index 95ae45ba..2518d8df 100644 --- a/java/tests/com/facebook/yoga/YGDisplayTest.java +++ b/java/tests/com/facebook/yoga/YGDisplayTest.java @@ -11,6 +11,7 @@ package com.facebook.yoga; import static org.junit.Assert.assertEquals; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; diff --git a/java/tests/com/facebook/yoga/YGFlexDirectionTest.java b/java/tests/com/facebook/yoga/YGFlexDirectionTest.java index 0574338c..90fc014d 100644 --- a/java/tests/com/facebook/yoga/YGFlexDirectionTest.java +++ b/java/tests/com/facebook/yoga/YGFlexDirectionTest.java @@ -11,6 +11,7 @@ package com.facebook.yoga; import static org.junit.Assert.assertEquals; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; diff --git a/java/tests/com/facebook/yoga/YGFlexTest.java b/java/tests/com/facebook/yoga/YGFlexTest.java index 2dcc68fe..2d262337 100644 --- a/java/tests/com/facebook/yoga/YGFlexTest.java +++ b/java/tests/com/facebook/yoga/YGFlexTest.java @@ -11,6 +11,7 @@ package com.facebook.yoga; import static org.junit.Assert.assertEquals; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; diff --git a/java/tests/com/facebook/yoga/YGFlexWrapTest.java b/java/tests/com/facebook/yoga/YGFlexWrapTest.java index 4121650c..6470afa5 100644 --- a/java/tests/com/facebook/yoga/YGFlexWrapTest.java +++ b/java/tests/com/facebook/yoga/YGFlexWrapTest.java @@ -11,6 +11,7 @@ package com.facebook.yoga; import static org.junit.Assert.assertEquals; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; diff --git a/java/tests/com/facebook/yoga/YGGapTest.java b/java/tests/com/facebook/yoga/YGGapTest.java index f8ac88a0..f6d21017 100644 --- a/java/tests/com/facebook/yoga/YGGapTest.java +++ b/java/tests/com/facebook/yoga/YGGapTest.java @@ -11,6 +11,7 @@ package com.facebook.yoga; import static org.junit.Assert.assertEquals; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; diff --git a/java/tests/com/facebook/yoga/YGJustifyContentTest.java b/java/tests/com/facebook/yoga/YGJustifyContentTest.java index 9d53d3ab..c628aba8 100644 --- a/java/tests/com/facebook/yoga/YGJustifyContentTest.java +++ b/java/tests/com/facebook/yoga/YGJustifyContentTest.java @@ -11,6 +11,7 @@ package com.facebook.yoga; import static org.junit.Assert.assertEquals; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; diff --git a/java/tests/com/facebook/yoga/YGMarginTest.java b/java/tests/com/facebook/yoga/YGMarginTest.java index af01cc61..e9b9cd03 100644 --- a/java/tests/com/facebook/yoga/YGMarginTest.java +++ b/java/tests/com/facebook/yoga/YGMarginTest.java @@ -11,6 +11,7 @@ package com.facebook.yoga; import static org.junit.Assert.assertEquals; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; diff --git a/java/tests/com/facebook/yoga/YGMinMaxDimensionTest.java b/java/tests/com/facebook/yoga/YGMinMaxDimensionTest.java index 4b778e63..a25bf66d 100644 --- a/java/tests/com/facebook/yoga/YGMinMaxDimensionTest.java +++ b/java/tests/com/facebook/yoga/YGMinMaxDimensionTest.java @@ -11,6 +11,7 @@ package com.facebook.yoga; import static org.junit.Assert.assertEquals; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -107,6 +108,119 @@ public class YGMinMaxDimensionTest { assertEquals(50f, root_child0.getLayoutHeight(), 0.0f); } + @Test + @Ignore + public void test_min_height() { + YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + + final YogaNode root = createNode(config); + root.setWidth(100f); + root.setHeight(100f); + + final YogaNode root_child0 = createNode(config); + root_child0.setFlexGrow(1f); + root_child0.setMinHeight(60f); + root.addChildAt(root_child0, 0); + + final YogaNode root_child1 = createNode(config); + root_child1.setFlexGrow(1f); + root.addChildAt(root_child1, 1); + root.setDirection(YogaDirection.LTR); + root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED); + + assertEquals(0f, root.getLayoutX(), 0.0f); + assertEquals(0f, root.getLayoutY(), 0.0f); + assertEquals(100f, root.getLayoutWidth(), 0.0f); + assertEquals(100f, root.getLayoutHeight(), 0.0f); + + assertEquals(0f, root_child0.getLayoutX(), 0.0f); + assertEquals(0f, root_child0.getLayoutY(), 0.0f); + assertEquals(100f, root_child0.getLayoutWidth(), 0.0f); + assertEquals(60f, root_child0.getLayoutHeight(), 0.0f); + + assertEquals(0f, root_child1.getLayoutX(), 0.0f); + assertEquals(60f, root_child1.getLayoutY(), 0.0f); + assertEquals(100f, root_child1.getLayoutWidth(), 0.0f); + assertEquals(40f, root_child1.getLayoutHeight(), 0.0f); + + root.setDirection(YogaDirection.RTL); + root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED); + + assertEquals(0f, root.getLayoutX(), 0.0f); + assertEquals(0f, root.getLayoutY(), 0.0f); + assertEquals(100f, root.getLayoutWidth(), 0.0f); + assertEquals(100f, root.getLayoutHeight(), 0.0f); + + assertEquals(0f, root_child0.getLayoutX(), 0.0f); + assertEquals(0f, root_child0.getLayoutY(), 0.0f); + assertEquals(100f, root_child0.getLayoutWidth(), 0.0f); + assertEquals(60f, root_child0.getLayoutHeight(), 0.0f); + + assertEquals(0f, root_child1.getLayoutX(), 0.0f); + assertEquals(60f, root_child1.getLayoutY(), 0.0f); + assertEquals(100f, root_child1.getLayoutWidth(), 0.0f); + assertEquals(40f, root_child1.getLayoutHeight(), 0.0f); + } + + @Test + @Ignore + public void test_min_width() { + YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + + final YogaNode root = createNode(config); + root.setFlexDirection(YogaFlexDirection.ROW); + root.setWidth(100f); + root.setHeight(100f); + + final YogaNode root_child0 = createNode(config); + root_child0.setFlexGrow(1f); + root_child0.setMinWidth(60f); + root.addChildAt(root_child0, 0); + + final YogaNode root_child1 = createNode(config); + root_child1.setFlexGrow(1f); + root.addChildAt(root_child1, 1); + root.setDirection(YogaDirection.LTR); + root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED); + + assertEquals(0f, root.getLayoutX(), 0.0f); + assertEquals(0f, root.getLayoutY(), 0.0f); + assertEquals(100f, root.getLayoutWidth(), 0.0f); + assertEquals(100f, root.getLayoutHeight(), 0.0f); + + assertEquals(0f, root_child0.getLayoutX(), 0.0f); + assertEquals(0f, root_child0.getLayoutY(), 0.0f); + assertEquals(60f, root_child0.getLayoutWidth(), 0.0f); + assertEquals(100f, root_child0.getLayoutHeight(), 0.0f); + + assertEquals(60f, root_child1.getLayoutX(), 0.0f); + assertEquals(0f, root_child1.getLayoutY(), 0.0f); + assertEquals(40f, root_child1.getLayoutWidth(), 0.0f); + assertEquals(100f, root_child1.getLayoutHeight(), 0.0f); + + root.setDirection(YogaDirection.RTL); + root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED); + + assertEquals(0f, root.getLayoutX(), 0.0f); + assertEquals(0f, root.getLayoutY(), 0.0f); + assertEquals(100f, root.getLayoutWidth(), 0.0f); + assertEquals(100f, root.getLayoutHeight(), 0.0f); + + assertEquals(40f, root_child0.getLayoutX(), 0.0f); + assertEquals(0f, root_child0.getLayoutY(), 0.0f); + assertEquals(60f, root_child0.getLayoutWidth(), 0.0f); + assertEquals(100f, root_child0.getLayoutHeight(), 0.0f); + + assertEquals(0f, root_child1.getLayoutX(), 0.0f); + assertEquals(0f, root_child1.getLayoutY(), 0.0f); + assertEquals(40f, root_child1.getLayoutWidth(), 0.0f); + assertEquals(100f, root_child1.getLayoutHeight(), 0.0f); + } + @Test public void test_justify_content_min_max() { YogaConfig config = YogaConfigFactory.create(); diff --git a/java/tests/com/facebook/yoga/YGPaddingTest.java b/java/tests/com/facebook/yoga/YGPaddingTest.java index cd73de36..8bb53241 100644 --- a/java/tests/com/facebook/yoga/YGPaddingTest.java +++ b/java/tests/com/facebook/yoga/YGPaddingTest.java @@ -11,6 +11,7 @@ package com.facebook.yoga; import static org.junit.Assert.assertEquals; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; diff --git a/java/tests/com/facebook/yoga/YGPercentageTest.java b/java/tests/com/facebook/yoga/YGPercentageTest.java index 5395d973..0df9f489 100644 --- a/java/tests/com/facebook/yoga/YGPercentageTest.java +++ b/java/tests/com/facebook/yoga/YGPercentageTest.java @@ -11,6 +11,7 @@ package com.facebook.yoga; import static org.junit.Assert.assertEquals; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -267,6 +268,63 @@ public class YGPercentageTest { assertEquals(75f, root_child1.getLayoutHeight(), 0.0f); } + @Test + @Ignore + public void test_percentage_flex_basis_cross_min_height() { + YogaConfig config = YogaConfigFactory.create(); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(YogaExperimentalFeature.FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + + final YogaNode root = createNode(config); + root.setWidth(200f); + root.setHeight(200f); + + final YogaNode root_child0 = createNode(config); + root_child0.setFlexGrow(1f); + root_child0.setMinHeightPercent(60f); + root.addChildAt(root_child0, 0); + + final YogaNode root_child1 = createNode(config); + root_child1.setFlexGrow(2f); + root_child1.setMinHeightPercent(10f); + root.addChildAt(root_child1, 1); + root.setDirection(YogaDirection.LTR); + root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED); + + assertEquals(0f, root.getLayoutX(), 0.0f); + assertEquals(0f, root.getLayoutY(), 0.0f); + assertEquals(200f, root.getLayoutWidth(), 0.0f); + assertEquals(200f, root.getLayoutHeight(), 0.0f); + + assertEquals(0f, root_child0.getLayoutX(), 0.0f); + assertEquals(0f, root_child0.getLayoutY(), 0.0f); + assertEquals(200f, root_child0.getLayoutWidth(), 0.0f); + assertEquals(120f, root_child0.getLayoutHeight(), 0.0f); + + assertEquals(0f, root_child1.getLayoutX(), 0.0f); + assertEquals(120f, root_child1.getLayoutY(), 0.0f); + assertEquals(200f, root_child1.getLayoutWidth(), 0.0f); + assertEquals(80f, root_child1.getLayoutHeight(), 0.0f); + + root.setDirection(YogaDirection.RTL); + root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED); + + assertEquals(0f, root.getLayoutX(), 0.0f); + assertEquals(0f, root.getLayoutY(), 0.0f); + assertEquals(200f, root.getLayoutWidth(), 0.0f); + assertEquals(200f, root.getLayoutHeight(), 0.0f); + + assertEquals(0f, root_child0.getLayoutX(), 0.0f); + assertEquals(0f, root_child0.getLayoutY(), 0.0f); + assertEquals(200f, root_child0.getLayoutWidth(), 0.0f); + assertEquals(120f, root_child0.getLayoutHeight(), 0.0f); + + assertEquals(0f, root_child1.getLayoutX(), 0.0f); + assertEquals(120f, root_child1.getLayoutY(), 0.0f); + assertEquals(200f, root_child1.getLayoutWidth(), 0.0f); + assertEquals(80f, root_child1.getLayoutHeight(), 0.0f); + } + @Test public void test_percentage_flex_basis_main_max_height() { YogaConfig config = YogaConfigFactory.create(); diff --git a/java/tests/com/facebook/yoga/YGRoundingTest.java b/java/tests/com/facebook/yoga/YGRoundingTest.java index 0340b779..518fcc5c 100644 --- a/java/tests/com/facebook/yoga/YGRoundingTest.java +++ b/java/tests/com/facebook/yoga/YGRoundingTest.java @@ -11,6 +11,7 @@ package com.facebook.yoga; import static org.junit.Assert.assertEquals; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; diff --git a/java/tests/com/facebook/yoga/YGSizeOverflowTest.java b/java/tests/com/facebook/yoga/YGSizeOverflowTest.java index 1bdb5190..b4087c3f 100644 --- a/java/tests/com/facebook/yoga/YGSizeOverflowTest.java +++ b/java/tests/com/facebook/yoga/YGSizeOverflowTest.java @@ -11,6 +11,7 @@ package com.facebook.yoga; import static org.junit.Assert.assertEquals; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; diff --git a/javascript/tests/generated/YGAbsolutePositionTest.test.js b/javascript/tests/generated/YGAbsolutePositionTest.test.js index 6b89d8d9..d3f4c65d 100644 --- a/javascript/tests/generated/YGAbsolutePositionTest.test.js +++ b/javascript/tests/generated/YGAbsolutePositionTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAbsolutePositionTest.html -test("absolute_layout_width_height_start_top", () => { +test('absolute_layout_width_height_start_top', () => { const config = Yoga.Config.create(); let root; @@ -26,7 +26,7 @@ test("absolute_layout_width_height_start_top", () => { root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -38,7 +38,7 @@ test("absolute_layout_width_height_start_top", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -50,14 +50,14 @@ test("absolute_layout_width_height_start_top", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("absolute_layout_width_height_end_bottom", () => { +test('absolute_layout_width_height_end_bottom', () => { const config = Yoga.Config.create(); let root; @@ -76,7 +76,7 @@ test("absolute_layout_width_height_end_bottom", () => { root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -88,7 +88,7 @@ test("absolute_layout_width_height_end_bottom", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -100,14 +100,14 @@ test("absolute_layout_width_height_end_bottom", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("absolute_layout_start_top_end_bottom", () => { +test('absolute_layout_start_top_end_bottom', () => { const config = Yoga.Config.create(); let root; @@ -126,7 +126,7 @@ test("absolute_layout_start_top_end_bottom", () => { root_child0.setPosition(Yoga.EDGE_END, 10); root_child0.setPosition(Yoga.EDGE_BOTTOM, 10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -138,7 +138,7 @@ test("absolute_layout_start_top_end_bottom", () => { expect(root_child0.getComputedWidth()).toBe(80); expect(root_child0.getComputedHeight()).toBe(80); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -150,14 +150,14 @@ test("absolute_layout_start_top_end_bottom", () => { expect(root_child0.getComputedWidth()).toBe(80); expect(root_child0.getComputedHeight()).toBe(80); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("absolute_layout_width_height_start_top_end_bottom", () => { +test('absolute_layout_width_height_start_top_end_bottom', () => { const config = Yoga.Config.create(); let root; @@ -178,7 +178,7 @@ test("absolute_layout_width_height_start_top_end_bottom", () => { root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -190,7 +190,7 @@ test("absolute_layout_width_height_start_top_end_bottom", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -202,14 +202,14 @@ test("absolute_layout_width_height_start_top_end_bottom", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent", () => { +test('do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent', () => { const config = Yoga.Config.create(); let root; @@ -233,7 +233,7 @@ test("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_pare root_child0_child0.setWidth(100); root_child0_child0.setHeight(100); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -250,7 +250,7 @@ test("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_pare expect(root_child0_child0.getComputedWidth()).toBe(100); expect(root_child0_child0.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -267,14 +267,14 @@ test("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_pare expect(root_child0_child0.getComputedWidth()).toBe(100); expect(root_child0_child0.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("absolute_layout_within_border", () => { +test('absolute_layout_within_border', () => { const config = Yoga.Config.create(); let root; @@ -337,7 +337,7 @@ test("absolute_layout_within_border", () => { root_child3.setWidth(50); root_child3.setHeight(50); root.insertChild(root_child3, 3); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(10); expect(root.getComputedTop()).toBe(10); @@ -364,7 +364,7 @@ test("absolute_layout_within_border", () => { expect(root_child3.getComputedWidth()).toBe(50); expect(root_child3.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(10); expect(root.getComputedTop()).toBe(10); @@ -391,14 +391,14 @@ test("absolute_layout_within_border", () => { expect(root_child3.getComputedWidth()).toBe(50); expect(root_child3.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("absolute_layout_align_items_and_justify_content_center", () => { +test('absolute_layout_align_items_and_justify_content_center', () => { const config = Yoga.Config.create(); let root; @@ -418,7 +418,7 @@ test("absolute_layout_align_items_and_justify_content_center", () => { root_child0.setWidth(60); root_child0.setHeight(40); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -430,7 +430,7 @@ test("absolute_layout_align_items_and_justify_content_center", () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -442,14 +442,14 @@ test("absolute_layout_align_items_and_justify_content_center", () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("absolute_layout_align_items_and_justify_content_flex_end", () => { +test('absolute_layout_align_items_and_justify_content_flex_end', () => { const config = Yoga.Config.create(); let root; @@ -469,7 +469,7 @@ test("absolute_layout_align_items_and_justify_content_flex_end", () => { root_child0.setWidth(60); root_child0.setHeight(40); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -481,7 +481,7 @@ test("absolute_layout_align_items_and_justify_content_flex_end", () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -493,14 +493,14 @@ test("absolute_layout_align_items_and_justify_content_flex_end", () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("absolute_layout_justify_content_center", () => { +test('absolute_layout_justify_content_center', () => { const config = Yoga.Config.create(); let root; @@ -519,7 +519,7 @@ test("absolute_layout_justify_content_center", () => { root_child0.setWidth(60); root_child0.setHeight(40); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -531,7 +531,7 @@ test("absolute_layout_justify_content_center", () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -543,14 +543,14 @@ test("absolute_layout_justify_content_center", () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("absolute_layout_align_items_center", () => { +test('absolute_layout_align_items_center', () => { const config = Yoga.Config.create(); let root; @@ -569,7 +569,7 @@ test("absolute_layout_align_items_center", () => { root_child0.setWidth(60); root_child0.setHeight(40); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -581,7 +581,7 @@ test("absolute_layout_align_items_center", () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -593,14 +593,14 @@ test("absolute_layout_align_items_center", () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("absolute_layout_align_items_center_on_child_only", () => { +test('absolute_layout_align_items_center_on_child_only', () => { const config = Yoga.Config.create(); let root; @@ -619,7 +619,7 @@ test("absolute_layout_align_items_center_on_child_only", () => { root_child0.setWidth(60); root_child0.setHeight(40); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -631,7 +631,7 @@ test("absolute_layout_align_items_center_on_child_only", () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -643,14 +643,14 @@ test("absolute_layout_align_items_center_on_child_only", () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("absolute_layout_align_items_and_justify_content_center_and_top_position", () => { +test('absolute_layout_align_items_and_justify_content_center_and_top_position', () => { const config = Yoga.Config.create(); let root; @@ -671,7 +671,7 @@ test("absolute_layout_align_items_and_justify_content_center_and_top_position", root_child0.setWidth(60); root_child0.setHeight(40); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -683,7 +683,7 @@ test("absolute_layout_align_items_and_justify_content_center_and_top_position", expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -695,14 +695,14 @@ test("absolute_layout_align_items_and_justify_content_center_and_top_position", expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("absolute_layout_align_items_and_justify_content_center_and_bottom_position", () => { +test('absolute_layout_align_items_and_justify_content_center_and_bottom_position', () => { const config = Yoga.Config.create(); let root; @@ -723,7 +723,7 @@ test("absolute_layout_align_items_and_justify_content_center_and_bottom_position root_child0.setWidth(60); root_child0.setHeight(40); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -735,7 +735,7 @@ test("absolute_layout_align_items_and_justify_content_center_and_bottom_position expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -747,14 +747,14 @@ test("absolute_layout_align_items_and_justify_content_center_and_bottom_position expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("absolute_layout_align_items_and_justify_content_center_and_left_position", () => { +test('absolute_layout_align_items_and_justify_content_center_and_left_position', () => { const config = Yoga.Config.create(); let root; @@ -775,7 +775,7 @@ test("absolute_layout_align_items_and_justify_content_center_and_left_position", root_child0.setWidth(60); root_child0.setHeight(40); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -787,7 +787,7 @@ test("absolute_layout_align_items_and_justify_content_center_and_left_position", expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -799,14 +799,14 @@ test("absolute_layout_align_items_and_justify_content_center_and_left_position", expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("absolute_layout_align_items_and_justify_content_center_and_right_position", () => { +test('absolute_layout_align_items_and_justify_content_center_and_right_position', () => { const config = Yoga.Config.create(); let root; @@ -827,7 +827,7 @@ test("absolute_layout_align_items_and_justify_content_center_and_right_position" root_child0.setWidth(60); root_child0.setHeight(40); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -839,7 +839,7 @@ test("absolute_layout_align_items_and_justify_content_center_and_right_position" expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -851,14 +851,14 @@ test("absolute_layout_align_items_and_justify_content_center_and_right_position" expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("position_root_with_rtl_should_position_withoutdirection", () => { +test('position_root_with_rtl_should_position_withoutdirection', () => { const config = Yoga.Config.create(); let root; @@ -870,28 +870,28 @@ test("position_root_with_rtl_should_position_withoutdirection", () => { root.setPosition(Yoga.EDGE_LEFT, 72); root.setWidth(52); root.setHeight(52); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(72); expect(root.getComputedTop()).toBe(0); expect(root.getComputedWidth()).toBe(52); expect(root.getComputedHeight()).toBe(52); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(72); expect(root.getComputedTop()).toBe(0); expect(root.getComputedWidth()).toBe(52); expect(root.getComputedHeight()).toBe(52); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("absolute_layout_percentage_bottom_based_on_parent_height", () => { +test('absolute_layout_percentage_bottom_based_on_parent_height', () => { const config = Yoga.Config.create(); let root; @@ -923,7 +923,7 @@ test("absolute_layout_percentage_bottom_based_on_parent_height", () => { root_child2.setPosition(Yoga.EDGE_BOTTOM, "10%"); root_child2.setWidth(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -945,7 +945,7 @@ test("absolute_layout_percentage_bottom_based_on_parent_height", () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(160); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -967,14 +967,14 @@ test("absolute_layout_percentage_bottom_based_on_parent_height", () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(160); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("absolute_layout_in_wrap_reverse_column_container", () => { +test('absolute_layout_in_wrap_reverse_column_container', () => { const config = Yoga.Config.create(); let root; @@ -992,7 +992,7 @@ test("absolute_layout_in_wrap_reverse_column_container", () => { root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1004,7 +1004,7 @@ test("absolute_layout_in_wrap_reverse_column_container", () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1016,14 +1016,14 @@ test("absolute_layout_in_wrap_reverse_column_container", () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("absolute_layout_in_wrap_reverse_row_container", () => { +test('absolute_layout_in_wrap_reverse_row_container', () => { const config = Yoga.Config.create(); let root; @@ -1042,7 +1042,7 @@ test("absolute_layout_in_wrap_reverse_row_container", () => { root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1054,7 +1054,7 @@ test("absolute_layout_in_wrap_reverse_row_container", () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1066,14 +1066,14 @@ test("absolute_layout_in_wrap_reverse_row_container", () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("absolute_layout_in_wrap_reverse_column_container_flex_end", () => { +test('absolute_layout_in_wrap_reverse_column_container_flex_end', () => { const config = Yoga.Config.create(); let root; @@ -1092,7 +1092,7 @@ test("absolute_layout_in_wrap_reverse_column_container_flex_end", () => { root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1104,7 +1104,7 @@ test("absolute_layout_in_wrap_reverse_column_container_flex_end", () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1116,14 +1116,14 @@ test("absolute_layout_in_wrap_reverse_column_container_flex_end", () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("absolute_layout_in_wrap_reverse_row_container_flex_end", () => { +test('absolute_layout_in_wrap_reverse_row_container_flex_end', () => { const config = Yoga.Config.create(); let root; @@ -1143,7 +1143,7 @@ test("absolute_layout_in_wrap_reverse_row_container_flex_end", () => { root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1155,7 +1155,7 @@ test("absolute_layout_in_wrap_reverse_row_container_flex_end", () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1167,14 +1167,14 @@ test("absolute_layout_in_wrap_reverse_row_container_flex_end", () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("percent_absolute_position_infinite_height", () => { +test('percent_absolute_position_infinite_height', () => { const config = Yoga.Config.create(); let root; @@ -1196,7 +1196,7 @@ test("percent_absolute_position_infinite_height", () => { root_child1.setWidth("20%"); root_child1.setHeight("20%"); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1213,7 +1213,7 @@ test("percent_absolute_position_infinite_height", () => { expect(root_child1.getComputedWidth()).toBe(60); expect(root_child1.getComputedHeight()).toBe(0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1230,14 +1230,14 @@ test("percent_absolute_position_infinite_height", () => { expect(root_child1.getComputedWidth()).toBe(60); expect(root_child1.getComputedHeight()).toBe(0); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("absolute_layout_percentage_height_based_on_padded_parent", () => { +test('absolute_layout_percentage_height_based_on_padded_parent', () => { const config = Yoga.Config.create(); let root; @@ -1256,7 +1256,7 @@ test("absolute_layout_percentage_height_based_on_padded_parent", () => { root_child0.setWidth(100); root_child0.setHeight("50%"); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1268,7 +1268,7 @@ test("absolute_layout_percentage_height_based_on_padded_parent", () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1280,14 +1280,14 @@ test("absolute_layout_percentage_height_based_on_padded_parent", () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("absolute_layout_percentage_height_based_on_padded_parent_and_align_items_center", () => { +test('absolute_layout_percentage_height_based_on_padded_parent_and_align_items_center', () => { const config = Yoga.Config.create(); let root; @@ -1308,7 +1308,7 @@ test("absolute_layout_percentage_height_based_on_padded_parent_and_align_items_c root_child0.setWidth(100); root_child0.setHeight("50%"); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1320,7 +1320,7 @@ test("absolute_layout_percentage_height_based_on_padded_parent_and_align_items_c expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1332,7 +1332,7 @@ test("absolute_layout_percentage_height_based_on_padded_parent_and_align_items_c expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } diff --git a/javascript/tests/generated/YGAlignContentTest.test.js b/javascript/tests/generated/YGAlignContentTest.test.js index f6706a9a..f5fc0119 100644 --- a/javascript/tests/generated/YGAlignContentTest.test.js +++ b/javascript/tests/generated/YGAlignContentTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignContentTest.html -test("align_content_flex_start", () => { +test('align_content_flex_start', () => { const config = Yoga.Config.create(); let root; @@ -45,7 +45,7 @@ test("align_content_flex_start", () => { root_child4.setWidth(50); root_child4.setHeight(10); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -77,7 +77,7 @@ test("align_content_flex_start", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -109,14 +109,14 @@ test("align_content_flex_start", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_content_flex_start_without_height_on_children", () => { +test('align_content_flex_start_without_height_on_children', () => { const config = Yoga.Config.create(); let root; @@ -150,7 +150,7 @@ test("align_content_flex_start_without_height_on_children", () => { const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -182,7 +182,7 @@ test("align_content_flex_start_without_height_on_children", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -214,14 +214,14 @@ test("align_content_flex_start_without_height_on_children", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(0); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_content_flex_start_with_flex", () => { +test('align_content_flex_start_with_flex', () => { const config = Yoga.Config.create(); let root; @@ -261,7 +261,7 @@ test("align_content_flex_start_with_flex", () => { const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -293,7 +293,7 @@ test("align_content_flex_start_with_flex", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -325,14 +325,14 @@ test("align_content_flex_start_with_flex", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(0); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_content_flex_end", () => { +test('align_content_flex_end', () => { const config = Yoga.Config.create(); let root; @@ -370,7 +370,7 @@ test("align_content_flex_end", () => { root_child4.setWidth(50); root_child4.setHeight(10); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -402,7 +402,7 @@ test("align_content_flex_end", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -434,14 +434,14 @@ test("align_content_flex_end", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_content_stretch", () => { +test('align_content_stretch', () => { const config = Yoga.Config.create(); let root; @@ -474,7 +474,7 @@ test("align_content_stretch", () => { const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -506,7 +506,7 @@ test("align_content_stretch", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -538,14 +538,14 @@ test("align_content_stretch", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(0); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_content_spacebetween", () => { +test('align_content_spacebetween', () => { const config = Yoga.Config.create(); let root; @@ -584,7 +584,7 @@ test("align_content_spacebetween", () => { root_child4.setWidth(50); root_child4.setHeight(10); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -616,7 +616,7 @@ test("align_content_spacebetween", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -648,14 +648,14 @@ test("align_content_spacebetween", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_content_spacearound", () => { +test('align_content_spacearound', () => { const config = Yoga.Config.create(); let root; @@ -694,7 +694,7 @@ test("align_content_spacearound", () => { root_child4.setWidth(50); root_child4.setHeight(10); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -726,7 +726,7 @@ test("align_content_spacearound", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -758,14 +758,14 @@ test("align_content_spacearound", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_content_stretch_row", () => { +test('align_content_stretch_row', () => { const config = Yoga.Config.create(); let root; @@ -799,7 +799,7 @@ test("align_content_stretch_row", () => { const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -831,7 +831,7 @@ test("align_content_stretch_row", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -863,14 +863,14 @@ test("align_content_stretch_row", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_content_stretch_row_with_children", () => { +test('align_content_stretch_row_with_children', () => { const config = Yoga.Config.create(); let root; @@ -910,7 +910,7 @@ test("align_content_stretch_row_with_children", () => { const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -947,7 +947,7 @@ test("align_content_stretch_row_with_children", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -984,14 +984,14 @@ test("align_content_stretch_row_with_children", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_content_stretch_row_with_flex", () => { +test('align_content_stretch_row_with_flex', () => { const config = Yoga.Config.create(); let root; @@ -1031,7 +1031,7 @@ test("align_content_stretch_row_with_flex", () => { const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1063,7 +1063,7 @@ test("align_content_stretch_row_with_flex", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1095,14 +1095,14 @@ test("align_content_stretch_row_with_flex", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_content_stretch_row_with_flex_no_shrink", () => { +test('align_content_stretch_row_with_flex_no_shrink', () => { const config = Yoga.Config.create(); let root; @@ -1141,7 +1141,7 @@ test("align_content_stretch_row_with_flex_no_shrink", () => { const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1173,7 +1173,7 @@ test("align_content_stretch_row_with_flex_no_shrink", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1205,14 +1205,14 @@ test("align_content_stretch_row_with_flex_no_shrink", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_content_stretch_row_with_margin", () => { +test('align_content_stretch_row_with_margin', () => { const config = Yoga.Config.create(); let root; @@ -1254,7 +1254,7 @@ test("align_content_stretch_row_with_margin", () => { const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1286,7 +1286,7 @@ test("align_content_stretch_row_with_margin", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1318,14 +1318,14 @@ test("align_content_stretch_row_with_margin", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_content_stretch_row_with_padding", () => { +test('align_content_stretch_row_with_padding', () => { const config = Yoga.Config.create(); let root; @@ -1367,7 +1367,7 @@ test("align_content_stretch_row_with_padding", () => { const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1399,7 +1399,7 @@ test("align_content_stretch_row_with_padding", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1431,14 +1431,14 @@ test("align_content_stretch_row_with_padding", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_content_stretch_row_with_single_row", () => { +test('align_content_stretch_row_with_single_row', () => { const config = Yoga.Config.create(); let root; @@ -1460,7 +1460,7 @@ test("align_content_stretch_row_with_single_row", () => { const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1477,7 +1477,7 @@ test("align_content_stretch_row_with_single_row", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1494,14 +1494,14 @@ test("align_content_stretch_row_with_single_row", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_content_stretch_row_with_fixed_height", () => { +test('align_content_stretch_row_with_fixed_height', () => { const config = Yoga.Config.create(); let root; @@ -1536,7 +1536,7 @@ test("align_content_stretch_row_with_fixed_height", () => { const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1568,7 +1568,7 @@ test("align_content_stretch_row_with_fixed_height", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1600,14 +1600,14 @@ test("align_content_stretch_row_with_fixed_height", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_content_stretch_row_with_max_height", () => { +test('align_content_stretch_row_with_max_height', () => { const config = Yoga.Config.create(); let root; @@ -1642,7 +1642,7 @@ test("align_content_stretch_row_with_max_height", () => { const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1674,7 +1674,7 @@ test("align_content_stretch_row_with_max_height", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1706,14 +1706,14 @@ test("align_content_stretch_row_with_max_height", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_content_stretch_row_with_min_height", () => { +test('align_content_stretch_row_with_min_height', () => { const config = Yoga.Config.create(); let root; @@ -1748,7 +1748,7 @@ test("align_content_stretch_row_with_min_height", () => { const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1780,7 +1780,7 @@ test("align_content_stretch_row_with_min_height", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1812,14 +1812,14 @@ test("align_content_stretch_row_with_min_height", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_content_stretch_column", () => { +test('align_content_stretch_column', () => { const config = Yoga.Config.create(); let root; @@ -1861,7 +1861,7 @@ test("align_content_stretch_column", () => { const root_child4 = Yoga.Node.create(config); root_child4.setHeight(50); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1898,7 +1898,7 @@ test("align_content_stretch_column", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1935,14 +1935,14 @@ test("align_content_stretch_column", () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_content_stretch_is_not_overriding_align_items", () => { +test('align_content_stretch_is_not_overriding_align_items', () => { const config = Yoga.Config.create(); let root; @@ -1966,7 +1966,7 @@ test("align_content_stretch_is_not_overriding_align_items", () => { root_child0_child0.setWidth(10); root_child0_child0.setHeight(10); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1983,7 +1983,7 @@ test("align_content_stretch_is_not_overriding_align_items", () => { expect(root_child0_child0.getComputedWidth()).toBe(10); expect(root_child0_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2000,7 +2000,7 @@ test("align_content_stretch_is_not_overriding_align_items", () => { expect(root_child0_child0.getComputedWidth()).toBe(10); expect(root_child0_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } diff --git a/javascript/tests/generated/YGAlignItemsTest.test.js b/javascript/tests/generated/YGAlignItemsTest.test.js index d6fea434..dd0ae00b 100644 --- a/javascript/tests/generated/YGAlignItemsTest.test.js +++ b/javascript/tests/generated/YGAlignItemsTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignItemsTest.html -test("align_items_stretch", () => { +test('align_items_stretch', () => { const config = Yoga.Config.create(); let root; @@ -22,7 +22,7 @@ test("align_items_stretch", () => { const root_child0 = Yoga.Node.create(config); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -34,7 +34,7 @@ test("align_items_stretch", () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -46,14 +46,14 @@ test("align_items_stretch", () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_items_center", () => { +test('align_items_center', () => { const config = Yoga.Config.create(); let root; @@ -70,7 +70,7 @@ test("align_items_center", () => { root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -82,7 +82,7 @@ test("align_items_center", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -94,14 +94,14 @@ test("align_items_center", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_items_flex_start", () => { +test('align_items_flex_start', () => { const config = Yoga.Config.create(); let root; @@ -118,7 +118,7 @@ test("align_items_flex_start", () => { root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -130,7 +130,7 @@ test("align_items_flex_start", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -142,14 +142,14 @@ test("align_items_flex_start", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_items_flex_end", () => { +test('align_items_flex_end', () => { const config = Yoga.Config.create(); let root; @@ -166,7 +166,7 @@ test("align_items_flex_end", () => { root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -178,7 +178,7 @@ test("align_items_flex_end", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -190,14 +190,14 @@ test("align_items_flex_end", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_baseline", () => { +test('align_baseline', () => { const config = Yoga.Config.create(); let root; @@ -220,7 +220,7 @@ test("align_baseline", () => { root_child1.setWidth(50); root_child1.setHeight(20); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -237,7 +237,7 @@ test("align_baseline", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -254,14 +254,14 @@ test("align_baseline", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_baseline_child", () => { +test('align_baseline_child', () => { const config = Yoga.Config.create(); let root; @@ -289,7 +289,7 @@ test("align_baseline_child", () => { root_child1_child0.setWidth(50); root_child1_child0.setHeight(10); root_child1.insertChild(root_child1_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -311,7 +311,7 @@ test("align_baseline_child", () => { expect(root_child1_child0.getComputedWidth()).toBe(50); expect(root_child1_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -333,14 +333,14 @@ test("align_baseline_child", () => { expect(root_child1_child0.getComputedWidth()).toBe(50); expect(root_child1_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_baseline_child_multiline", () => { +test('align_baseline_child_multiline', () => { const config = Yoga.Config.create(); let root; @@ -385,7 +385,7 @@ test("align_baseline_child_multiline", () => { root_child1_child3.setWidth(25); root_child1_child3.setHeight(10); root_child1.insertChild(root_child1_child3, 3); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -422,7 +422,7 @@ test("align_baseline_child_multiline", () => { expect(root_child1_child3.getComputedWidth()).toBe(25); expect(root_child1_child3.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -459,14 +459,14 @@ test("align_baseline_child_multiline", () => { expect(root_child1_child3.getComputedWidth()).toBe(25); expect(root_child1_child3.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_baseline_child_multiline_override", () => { +test('align_baseline_child_multiline_override', () => { const config = Yoga.Config.create(); let root; @@ -513,7 +513,7 @@ test("align_baseline_child_multiline_override", () => { root_child1_child3.setWidth(25); root_child1_child3.setHeight(10); root_child1.insertChild(root_child1_child3, 3); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -550,7 +550,7 @@ test("align_baseline_child_multiline_override", () => { expect(root_child1_child3.getComputedWidth()).toBe(25); expect(root_child1_child3.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -587,14 +587,14 @@ test("align_baseline_child_multiline_override", () => { expect(root_child1_child3.getComputedWidth()).toBe(25); expect(root_child1_child3.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_baseline_child_multiline_no_override_on_secondline", () => { +test('align_baseline_child_multiline_no_override_on_secondline', () => { const config = Yoga.Config.create(); let root; @@ -640,7 +640,7 @@ test("align_baseline_child_multiline_no_override_on_secondline", () => { root_child1_child3.setWidth(25); root_child1_child3.setHeight(10); root_child1.insertChild(root_child1_child3, 3); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -677,7 +677,7 @@ test("align_baseline_child_multiline_no_override_on_secondline", () => { expect(root_child1_child3.getComputedWidth()).toBe(25); expect(root_child1_child3.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -714,14 +714,14 @@ test("align_baseline_child_multiline_no_override_on_secondline", () => { expect(root_child1_child3.getComputedWidth()).toBe(25); expect(root_child1_child3.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_baseline_child_top", () => { +test('align_baseline_child_top', () => { const config = Yoga.Config.create(); let root; @@ -750,7 +750,7 @@ test("align_baseline_child_top", () => { root_child1_child0.setWidth(50); root_child1_child0.setHeight(10); root_child1.insertChild(root_child1_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -772,7 +772,7 @@ test("align_baseline_child_top", () => { expect(root_child1_child0.getComputedWidth()).toBe(50); expect(root_child1_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -794,14 +794,14 @@ test("align_baseline_child_top", () => { expect(root_child1_child0.getComputedWidth()).toBe(50); expect(root_child1_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_baseline_child_top2", () => { +test('align_baseline_child_top2', () => { const config = Yoga.Config.create(); let root; @@ -830,7 +830,7 @@ test("align_baseline_child_top2", () => { root_child1_child0.setWidth(50); root_child1_child0.setHeight(10); root_child1.insertChild(root_child1_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -852,7 +852,7 @@ test("align_baseline_child_top2", () => { expect(root_child1_child0.getComputedWidth()).toBe(50); expect(root_child1_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -874,14 +874,14 @@ test("align_baseline_child_top2", () => { expect(root_child1_child0.getComputedWidth()).toBe(50); expect(root_child1_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_baseline_double_nested_child", () => { +test('align_baseline_double_nested_child', () => { const config = Yoga.Config.create(); let root; @@ -914,7 +914,7 @@ test("align_baseline_double_nested_child", () => { root_child1_child0.setWidth(50); root_child1_child0.setHeight(15); root_child1.insertChild(root_child1_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -941,7 +941,7 @@ test("align_baseline_double_nested_child", () => { expect(root_child1_child0.getComputedWidth()).toBe(50); expect(root_child1_child0.getComputedHeight()).toBe(15); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -968,14 +968,14 @@ test("align_baseline_double_nested_child", () => { expect(root_child1_child0.getComputedWidth()).toBe(50); expect(root_child1_child0.getComputedHeight()).toBe(15); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_baseline_column", () => { +test('align_baseline_column', () => { const config = Yoga.Config.create(); let root; @@ -997,7 +997,7 @@ test("align_baseline_column", () => { root_child1.setWidth(50); root_child1.setHeight(20); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1014,7 +1014,7 @@ test("align_baseline_column", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1031,14 +1031,14 @@ test("align_baseline_column", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_baseline_child_margin", () => { +test('align_baseline_child_margin', () => { const config = Yoga.Config.create(); let root; @@ -1074,7 +1074,7 @@ test("align_baseline_child_margin", () => { root_child1_child0.setWidth(50); root_child1_child0.setHeight(10); root_child1.insertChild(root_child1_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1096,7 +1096,7 @@ test("align_baseline_child_margin", () => { expect(root_child1_child0.getComputedWidth()).toBe(50); expect(root_child1_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1118,14 +1118,14 @@ test("align_baseline_child_margin", () => { expect(root_child1_child0.getComputedWidth()).toBe(50); expect(root_child1_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_baseline_child_padding", () => { +test('align_baseline_child_padding', () => { const config = Yoga.Config.create(); let root; @@ -1161,7 +1161,7 @@ test("align_baseline_child_padding", () => { root_child1_child0.setWidth(50); root_child1_child0.setHeight(10); root_child1.insertChild(root_child1_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1183,7 +1183,7 @@ test("align_baseline_child_padding", () => { expect(root_child1_child0.getComputedWidth()).toBe(50); expect(root_child1_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1205,14 +1205,14 @@ test("align_baseline_child_padding", () => { expect(root_child1_child0.getComputedWidth()).toBe(50); expect(root_child1_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_baseline_multiline", () => { +test('align_baseline_multiline', () => { const config = Yoga.Config.create(); let root; @@ -1256,7 +1256,7 @@ test("align_baseline_multiline", () => { root_child3.setWidth(50); root_child3.setHeight(50); root.insertChild(root_child3, 3); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1293,7 +1293,7 @@ test("align_baseline_multiline", () => { expect(root_child3.getComputedWidth()).toBe(50); expect(root_child3.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1330,14 +1330,14 @@ test("align_baseline_multiline", () => { expect(root_child3.getComputedWidth()).toBe(50); expect(root_child3.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_baseline_multiline_column", () => { +test.skip('align_baseline_multiline_column', () => { const config = Yoga.Config.create(); let root; @@ -1380,7 +1380,7 @@ test("align_baseline_multiline_column", () => { root_child3.setWidth(50); root_child3.setHeight(20); root.insertChild(root_child3, 3); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1417,7 +1417,7 @@ test("align_baseline_multiline_column", () => { expect(root_child3.getComputedWidth()).toBe(50); expect(root_child3.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1429,7 +1429,7 @@ test("align_baseline_multiline_column", () => { expect(root_child0.getComputedWidth()).toBe(50); expect(root_child0.getComputedHeight()).toBe(50); - expect(root_child1.getComputedLeft()).toBe(70); + expect(root_child1.getComputedLeft()).toBe(50); expect(root_child1.getComputedTop()).toBe(50); expect(root_child1.getComputedWidth()).toBe(30); expect(root_child1.getComputedHeight()).toBe(50); @@ -1439,7 +1439,7 @@ test("align_baseline_multiline_column", () => { expect(root_child1_child0.getComputedWidth()).toBe(20); expect(root_child1_child0.getComputedHeight()).toBe(20); - expect(root_child2.getComputedLeft()).toBe(10); + expect(root_child2.getComputedLeft()).toBe(0); expect(root_child2.getComputedTop()).toBe(0); expect(root_child2.getComputedWidth()).toBe(40); expect(root_child2.getComputedHeight()).toBe(70); @@ -1454,14 +1454,14 @@ test("align_baseline_multiline_column", () => { expect(root_child3.getComputedWidth()).toBe(50); expect(root_child3.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_baseline_multiline_column2", () => { +test.skip('align_baseline_multiline_column2', () => { const config = Yoga.Config.create(); let root; @@ -1504,7 +1504,7 @@ test("align_baseline_multiline_column2", () => { root_child3.setWidth(50); root_child3.setHeight(20); root.insertChild(root_child3, 3); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1541,7 +1541,7 @@ test("align_baseline_multiline_column2", () => { expect(root_child3.getComputedWidth()).toBe(50); expect(root_child3.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1553,7 +1553,7 @@ test("align_baseline_multiline_column2", () => { expect(root_child0.getComputedWidth()).toBe(50); expect(root_child0.getComputedHeight()).toBe(50); - expect(root_child1.getComputedLeft()).toBe(70); + expect(root_child1.getComputedLeft()).toBe(50); expect(root_child1.getComputedTop()).toBe(50); expect(root_child1.getComputedWidth()).toBe(30); expect(root_child1.getComputedHeight()).toBe(50); @@ -1563,7 +1563,7 @@ test("align_baseline_multiline_column2", () => { expect(root_child1_child0.getComputedWidth()).toBe(20); expect(root_child1_child0.getComputedHeight()).toBe(20); - expect(root_child2.getComputedLeft()).toBe(10); + expect(root_child2.getComputedLeft()).toBe(0); expect(root_child2.getComputedTop()).toBe(0); expect(root_child2.getComputedWidth()).toBe(40); expect(root_child2.getComputedHeight()).toBe(70); @@ -1578,14 +1578,14 @@ test("align_baseline_multiline_column2", () => { expect(root_child3.getComputedWidth()).toBe(50); expect(root_child3.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_baseline_multiline_row_and_column", () => { +test('align_baseline_multiline_row_and_column', () => { const config = Yoga.Config.create(); let root; @@ -1629,7 +1629,7 @@ test("align_baseline_multiline_row_and_column", () => { root_child3.setWidth(50); root_child3.setHeight(20); root.insertChild(root_child3, 3); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1666,7 +1666,7 @@ test("align_baseline_multiline_row_and_column", () => { expect(root_child3.getComputedWidth()).toBe(50); expect(root_child3.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1703,14 +1703,14 @@ test("align_baseline_multiline_row_and_column", () => { expect(root_child3.getComputedWidth()).toBe(50); expect(root_child3.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_items_center_child_with_margin_bigger_than_parent", () => { +test('align_items_center_child_with_margin_bigger_than_parent', () => { const config = Yoga.Config.create(); let root; @@ -1734,7 +1734,7 @@ test("align_items_center_child_with_margin_bigger_than_parent", () => { root_child0_child0.setWidth(52); root_child0_child0.setHeight(52); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1751,7 +1751,7 @@ test("align_items_center_child_with_margin_bigger_than_parent", () => { expect(root_child0_child0.getComputedWidth()).toBe(52); expect(root_child0_child0.getComputedHeight()).toBe(52); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1768,14 +1768,14 @@ test("align_items_center_child_with_margin_bigger_than_parent", () => { expect(root_child0_child0.getComputedWidth()).toBe(52); expect(root_child0_child0.getComputedHeight()).toBe(52); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_items_flex_end_child_with_margin_bigger_than_parent", () => { +test('align_items_flex_end_child_with_margin_bigger_than_parent', () => { const config = Yoga.Config.create(); let root; @@ -1799,7 +1799,7 @@ test("align_items_flex_end_child_with_margin_bigger_than_parent", () => { root_child0_child0.setWidth(52); root_child0_child0.setHeight(52); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1816,7 +1816,7 @@ test("align_items_flex_end_child_with_margin_bigger_than_parent", () => { expect(root_child0_child0.getComputedWidth()).toBe(52); expect(root_child0_child0.getComputedHeight()).toBe(52); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1833,14 +1833,14 @@ test("align_items_flex_end_child_with_margin_bigger_than_parent", () => { expect(root_child0_child0.getComputedWidth()).toBe(52); expect(root_child0_child0.getComputedHeight()).toBe(52); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_items_center_child_without_margin_bigger_than_parent", () => { +test('align_items_center_child_without_margin_bigger_than_parent', () => { const config = Yoga.Config.create(); let root; @@ -1862,7 +1862,7 @@ test("align_items_center_child_without_margin_bigger_than_parent", () => { root_child0_child0.setWidth(72); root_child0_child0.setHeight(72); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1879,7 +1879,7 @@ test("align_items_center_child_without_margin_bigger_than_parent", () => { expect(root_child0_child0.getComputedWidth()).toBe(72); expect(root_child0_child0.getComputedHeight()).toBe(72); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1896,14 +1896,14 @@ test("align_items_center_child_without_margin_bigger_than_parent", () => { expect(root_child0_child0.getComputedWidth()).toBe(72); expect(root_child0_child0.getComputedHeight()).toBe(72); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_items_flex_end_child_without_margin_bigger_than_parent", () => { +test('align_items_flex_end_child_without_margin_bigger_than_parent', () => { const config = Yoga.Config.create(); let root; @@ -1925,7 +1925,7 @@ test("align_items_flex_end_child_without_margin_bigger_than_parent", () => { root_child0_child0.setWidth(72); root_child0_child0.setHeight(72); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1942,7 +1942,7 @@ test("align_items_flex_end_child_without_margin_bigger_than_parent", () => { expect(root_child0_child0.getComputedWidth()).toBe(72); expect(root_child0_child0.getComputedHeight()).toBe(72); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1959,14 +1959,14 @@ test("align_items_flex_end_child_without_margin_bigger_than_parent", () => { expect(root_child0_child0.getComputedWidth()).toBe(72); expect(root_child0_child0.getComputedHeight()).toBe(72); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_center_should_size_based_on_content", () => { +test('align_center_should_size_based_on_content', () => { const config = Yoga.Config.create(); let root; @@ -1994,7 +1994,7 @@ test("align_center_should_size_based_on_content", () => { root_child0_child0_child0.setWidth(20); root_child0_child0_child0.setHeight(20); root_child0_child0.insertChild(root_child0_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(20); @@ -2016,7 +2016,7 @@ test("align_center_should_size_based_on_content", () => { expect(root_child0_child0_child0.getComputedWidth()).toBe(20); expect(root_child0_child0_child0.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(20); @@ -2038,14 +2038,14 @@ test("align_center_should_size_based_on_content", () => { expect(root_child0_child0_child0.getComputedWidth()).toBe(20); expect(root_child0_child0_child0.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_stretch_should_size_based_on_parent", () => { +test('align_stretch_should_size_based_on_parent', () => { const config = Yoga.Config.create(); let root; @@ -2072,7 +2072,7 @@ test("align_stretch_should_size_based_on_parent", () => { root_child0_child0_child0.setWidth(20); root_child0_child0_child0.setHeight(20); root_child0_child0.insertChild(root_child0_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(20); @@ -2094,7 +2094,7 @@ test("align_stretch_should_size_based_on_parent", () => { expect(root_child0_child0_child0.getComputedWidth()).toBe(20); expect(root_child0_child0_child0.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(20); @@ -2116,14 +2116,14 @@ test("align_stretch_should_size_based_on_parent", () => { expect(root_child0_child0_child0.getComputedWidth()).toBe(20); expect(root_child0_child0_child0.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_flex_start_with_shrinking_children", () => { +test('align_flex_start_with_shrinking_children', () => { const config = Yoga.Config.create(); let root; @@ -2148,7 +2148,7 @@ test("align_flex_start_with_shrinking_children", () => { root_child0_child0_child0.setFlexGrow(1); root_child0_child0_child0.setFlexShrink(1); root_child0_child0.insertChild(root_child0_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2170,7 +2170,7 @@ test("align_flex_start_with_shrinking_children", () => { expect(root_child0_child0_child0.getComputedWidth()).toBe(0); expect(root_child0_child0_child0.getComputedHeight()).toBe(0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2192,14 +2192,14 @@ test("align_flex_start_with_shrinking_children", () => { expect(root_child0_child0_child0.getComputedWidth()).toBe(0); expect(root_child0_child0_child0.getComputedHeight()).toBe(0); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_flex_start_with_stretching_children", () => { +test('align_flex_start_with_stretching_children', () => { const config = Yoga.Config.create(); let root; @@ -2223,7 +2223,7 @@ test("align_flex_start_with_stretching_children", () => { root_child0_child0_child0.setFlexGrow(1); root_child0_child0_child0.setFlexShrink(1); root_child0_child0.insertChild(root_child0_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2245,7 +2245,7 @@ test("align_flex_start_with_stretching_children", () => { expect(root_child0_child0_child0.getComputedWidth()).toBe(500); expect(root_child0_child0_child0.getComputedHeight()).toBe(0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2267,14 +2267,14 @@ test("align_flex_start_with_stretching_children", () => { expect(root_child0_child0_child0.getComputedWidth()).toBe(500); expect(root_child0_child0_child0.getComputedHeight()).toBe(0); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_flex_start_with_shrinking_children_with_stretch", () => { +test('align_flex_start_with_shrinking_children_with_stretch', () => { const config = Yoga.Config.create(); let root; @@ -2299,7 +2299,7 @@ test("align_flex_start_with_shrinking_children_with_stretch", () => { root_child0_child0_child0.setFlexGrow(1); root_child0_child0_child0.setFlexShrink(1); root_child0_child0.insertChild(root_child0_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2321,7 +2321,7 @@ test("align_flex_start_with_shrinking_children_with_stretch", () => { expect(root_child0_child0_child0.getComputedWidth()).toBe(0); expect(root_child0_child0_child0.getComputedHeight()).toBe(0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2343,7 +2343,7 @@ test("align_flex_start_with_shrinking_children_with_stretch", () => { expect(root_child0_child0_child0.getComputedWidth()).toBe(0); expect(root_child0_child0_child0.getComputedHeight()).toBe(0); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } diff --git a/javascript/tests/generated/YGAlignSelfTest.test.js b/javascript/tests/generated/YGAlignSelfTest.test.js index 928a7d62..518b1e70 100644 --- a/javascript/tests/generated/YGAlignSelfTest.test.js +++ b/javascript/tests/generated/YGAlignSelfTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignSelfTest.html -test("align_self_center", () => { +test('align_self_center', () => { const config = Yoga.Config.create(); let root; @@ -24,7 +24,7 @@ test("align_self_center", () => { root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -36,7 +36,7 @@ test("align_self_center", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -48,14 +48,14 @@ test("align_self_center", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_self_flex_end", () => { +test('align_self_flex_end', () => { const config = Yoga.Config.create(); let root; @@ -72,7 +72,7 @@ test("align_self_flex_end", () => { root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -84,7 +84,7 @@ test("align_self_flex_end", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -96,14 +96,14 @@ test("align_self_flex_end", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_self_flex_start", () => { +test('align_self_flex_start', () => { const config = Yoga.Config.create(); let root; @@ -120,7 +120,7 @@ test("align_self_flex_start", () => { root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -132,7 +132,7 @@ test("align_self_flex_start", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -144,14 +144,14 @@ test("align_self_flex_start", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_self_flex_end_override_flex_start", () => { +test('align_self_flex_end_override_flex_start', () => { const config = Yoga.Config.create(); let root; @@ -169,7 +169,7 @@ test("align_self_flex_end_override_flex_start", () => { root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -181,7 +181,7 @@ test("align_self_flex_end_override_flex_start", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -193,14 +193,14 @@ test("align_self_flex_end_override_flex_start", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_self_baseline", () => { +test('align_self_baseline', () => { const config = Yoga.Config.create(); let root; @@ -229,7 +229,7 @@ test("align_self_baseline", () => { root_child1_child0.setWidth(50); root_child1_child0.setHeight(10); root_child1.insertChild(root_child1_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -251,7 +251,7 @@ test("align_self_baseline", () => { expect(root_child1_child0.getComputedWidth()).toBe(50); expect(root_child1_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -273,7 +273,7 @@ test("align_self_baseline", () => { expect(root_child1_child0.getComputedWidth()).toBe(50); expect(root_child1_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } diff --git a/javascript/tests/generated/YGAndroidNewsFeed.test.js b/javascript/tests/generated/YGAndroidNewsFeed.test.js index 2ab527fe..be8255fb 100644 --- a/javascript/tests/generated/YGAndroidNewsFeed.test.js +++ b/javascript/tests/generated/YGAndroidNewsFeed.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAndroidNewsFeed.html -test("android_news_feed", () => { +test('android_news_feed', () => { const config = Yoga.Config.create(); let root; @@ -113,7 +113,7 @@ test("android_news_feed", () => { root_child0_child0_child1_child0_child1_child1.setAlignContent(Yoga.ALIGN_STRETCH); root_child0_child0_child1_child0_child1_child1.setFlexShrink(1); root_child0_child0_child1_child0_child1.insertChild(root_child0_child0_child1_child0_child1_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -200,7 +200,7 @@ test("android_news_feed", () => { expect(root_child0_child0_child1_child0_child1_child1.getComputedWidth()).toBe(0); expect(root_child0_child0_child1_child0_child1_child1.getComputedHeight()).toBe(0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -287,7 +287,7 @@ test("android_news_feed", () => { expect(root_child0_child0_child1_child0_child1_child1.getComputedWidth()).toBe(0); expect(root_child0_child0_child1_child0_child1_child1.getComputedHeight()).toBe(0); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } diff --git a/javascript/tests/generated/YGBorderTest.test.js b/javascript/tests/generated/YGBorderTest.test.js index d4d22fd8..2f15b840 100644 --- a/javascript/tests/generated/YGBorderTest.test.js +++ b/javascript/tests/generated/YGBorderTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGBorderTest.html -test("border_no_size", () => { +test('border_no_size', () => { const config = Yoga.Config.create(); let root; @@ -20,28 +20,28 @@ test("border_no_size", () => { root.setBorder(Yoga.EDGE_TOP, 10); root.setBorder(Yoga.EDGE_RIGHT, 10); root.setBorder(Yoga.EDGE_BOTTOM, 10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); expect(root.getComputedWidth()).toBe(20); expect(root.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); expect(root.getComputedWidth()).toBe(20); expect(root.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("border_container_match_child", () => { +test('border_container_match_child', () => { const config = Yoga.Config.create(); let root; @@ -59,7 +59,7 @@ test("border_container_match_child", () => { root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -71,7 +71,7 @@ test("border_container_match_child", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -83,14 +83,14 @@ test("border_container_match_child", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("border_flex_child", () => { +test('border_flex_child', () => { const config = Yoga.Config.create(); let root; @@ -110,7 +110,7 @@ test("border_flex_child", () => { root_child0.setFlexGrow(1); root_child0.setWidth(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -122,7 +122,7 @@ test("border_flex_child", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(80); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -134,14 +134,14 @@ test("border_flex_child", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(80); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("border_stretch_child", () => { +test('border_stretch_child', () => { const config = Yoga.Config.create(); let root; @@ -160,7 +160,7 @@ test("border_stretch_child", () => { const root_child0 = Yoga.Node.create(config); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -172,7 +172,7 @@ test("border_stretch_child", () => { expect(root_child0.getComputedWidth()).toBe(80); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -184,14 +184,14 @@ test("border_stretch_child", () => { expect(root_child0.getComputedWidth()).toBe(80); expect(root_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("border_center_child", () => { +test('border_center_child', () => { const config = Yoga.Config.create(); let root; @@ -212,7 +212,7 @@ test("border_center_child", () => { root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -224,7 +224,7 @@ test("border_center_child", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -236,7 +236,7 @@ test("border_center_child", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } diff --git a/javascript/tests/generated/YGDimensionTest.test.js b/javascript/tests/generated/YGDimensionTest.test.js index 21b7421c..8693958e 100644 --- a/javascript/tests/generated/YGDimensionTest.test.js +++ b/javascript/tests/generated/YGDimensionTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGDimensionTest.html -test("wrap_child", () => { +test('wrap_child', () => { const config = Yoga.Config.create(); let root; @@ -21,7 +21,7 @@ test("wrap_child", () => { root_child0.setWidth(100); root_child0.setHeight(100); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -33,7 +33,7 @@ test("wrap_child", () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -45,14 +45,14 @@ test("wrap_child", () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("wrap_grandchild", () => { +test('wrap_grandchild', () => { const config = Yoga.Config.create(); let root; @@ -69,7 +69,7 @@ test("wrap_grandchild", () => { root_child0_child0.setWidth(100); root_child0_child0.setHeight(100); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -86,7 +86,7 @@ test("wrap_grandchild", () => { expect(root_child0_child0.getComputedWidth()).toBe(100); expect(root_child0_child0.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -103,7 +103,7 @@ test("wrap_grandchild", () => { expect(root_child0_child0.getComputedWidth()).toBe(100); expect(root_child0_child0.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } diff --git a/javascript/tests/generated/YGDisplayTest.test.js b/javascript/tests/generated/YGDisplayTest.test.js index b9fd8eac..f634928d 100644 --- a/javascript/tests/generated/YGDisplayTest.test.js +++ b/javascript/tests/generated/YGDisplayTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGDisplayTest.html -test("display_none", () => { +test('display_none', () => { const config = Yoga.Config.create(); let root; @@ -28,7 +28,7 @@ test("display_none", () => { root_child1.setFlexGrow(1); root_child1.setDisplay(Yoga.DISPLAY_NONE); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -45,7 +45,7 @@ test("display_none", () => { expect(root_child1.getComputedWidth()).toBe(0); expect(root_child1.getComputedHeight()).toBe(0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -62,14 +62,14 @@ test("display_none", () => { expect(root_child1.getComputedWidth()).toBe(0); expect(root_child1.getComputedHeight()).toBe(0); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("display_none_fixed_size", () => { +test('display_none_fixed_size', () => { const config = Yoga.Config.create(); let root; @@ -91,7 +91,7 @@ test("display_none_fixed_size", () => { root_child1.setHeight(20); root_child1.setDisplay(Yoga.DISPLAY_NONE); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -108,7 +108,7 @@ test("display_none_fixed_size", () => { expect(root_child1.getComputedWidth()).toBe(0); expect(root_child1.getComputedHeight()).toBe(0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -125,14 +125,14 @@ test("display_none_fixed_size", () => { expect(root_child1.getComputedWidth()).toBe(0); expect(root_child1.getComputedHeight()).toBe(0); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("display_none_with_margin", () => { +test('display_none_with_margin', () => { const config = Yoga.Config.create(); let root; @@ -158,7 +158,7 @@ test("display_none_with_margin", () => { const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -175,7 +175,7 @@ test("display_none_with_margin", () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -192,14 +192,14 @@ test("display_none_with_margin", () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("display_none_with_child", () => { +test('display_none_with_child', () => { const config = Yoga.Config.create(); let root; @@ -237,7 +237,7 @@ test("display_none_with_child", () => { root_child2.setFlexShrink(1); root_child2.setFlexBasis("0%"); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -264,7 +264,7 @@ test("display_none_with_child", () => { expect(root_child2.getComputedWidth()).toBe(50); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -291,14 +291,14 @@ test("display_none_with_child", () => { expect(root_child2.getComputedWidth()).toBe(50); expect(root_child2.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("display_none_with_position", () => { +test('display_none_with_position', () => { const config = Yoga.Config.create(); let root; @@ -320,7 +320,7 @@ test("display_none_with_position", () => { root_child1.setPosition(Yoga.EDGE_TOP, 10); root_child1.setDisplay(Yoga.DISPLAY_NONE); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -337,7 +337,7 @@ test("display_none_with_position", () => { expect(root_child1.getComputedWidth()).toBe(0); expect(root_child1.getComputedHeight()).toBe(0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -354,14 +354,14 @@ test("display_none_with_position", () => { expect(root_child1.getComputedWidth()).toBe(0); expect(root_child1.getComputedHeight()).toBe(0); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("display_none_with_position_absolute", () => { +test('display_none_with_position_absolute', () => { const config = Yoga.Config.create(); let root; @@ -379,7 +379,7 @@ test("display_none_with_position_absolute", () => { root_child0.setHeight(100); root_child0.setDisplay(Yoga.DISPLAY_NONE); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -391,7 +391,7 @@ test("display_none_with_position_absolute", () => { expect(root_child0.getComputedWidth()).toBe(0); expect(root_child0.getComputedHeight()).toBe(0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -403,7 +403,7 @@ test("display_none_with_position_absolute", () => { expect(root_child0.getComputedWidth()).toBe(0); expect(root_child0.getComputedHeight()).toBe(0); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } diff --git a/javascript/tests/generated/YGFlexDirectionTest.test.js b/javascript/tests/generated/YGFlexDirectionTest.test.js index f977af0e..59a65383 100644 --- a/javascript/tests/generated/YGFlexDirectionTest.test.js +++ b/javascript/tests/generated/YGFlexDirectionTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexDirectionTest.html -test("flex_direction_column_no_height", () => { +test('flex_direction_column_no_height', () => { const config = Yoga.Config.create(); let root; @@ -29,7 +29,7 @@ test("flex_direction_column_no_height", () => { const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -51,7 +51,7 @@ test("flex_direction_column_no_height", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -73,14 +73,14 @@ test("flex_direction_column_no_height", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_direction_row_no_width", () => { +test('flex_direction_row_no_width', () => { const config = Yoga.Config.create(); let root; @@ -103,7 +103,7 @@ test("flex_direction_row_no_width", () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -125,7 +125,7 @@ test("flex_direction_row_no_width", () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -147,14 +147,14 @@ test("flex_direction_row_no_width", () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_direction_column", () => { +test('flex_direction_column', () => { const config = Yoga.Config.create(); let root; @@ -177,7 +177,7 @@ test("flex_direction_column", () => { const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -199,7 +199,7 @@ test("flex_direction_column", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -221,14 +221,14 @@ test("flex_direction_column", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_direction_row", () => { +test('flex_direction_row', () => { const config = Yoga.Config.create(); let root; @@ -252,7 +252,7 @@ test("flex_direction_row", () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -274,7 +274,7 @@ test("flex_direction_row", () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -296,14 +296,14 @@ test("flex_direction_row", () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_direction_column_reverse", () => { +test('flex_direction_column_reverse', () => { const config = Yoga.Config.create(); let root; @@ -327,7 +327,7 @@ test("flex_direction_column_reverse", () => { const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -349,7 +349,7 @@ test("flex_direction_column_reverse", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -371,14 +371,14 @@ test("flex_direction_column_reverse", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_direction_row_reverse", () => { +test('flex_direction_row_reverse', () => { const config = Yoga.Config.create(); let root; @@ -402,7 +402,7 @@ test("flex_direction_row_reverse", () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -424,7 +424,7 @@ test("flex_direction_row_reverse", () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -446,7 +446,7 @@ test("flex_direction_row_reverse", () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } diff --git a/javascript/tests/generated/YGFlexTest.test.js b/javascript/tests/generated/YGFlexTest.test.js index 789ea167..055b5ad6 100644 --- a/javascript/tests/generated/YGFlexTest.test.js +++ b/javascript/tests/generated/YGFlexTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexTest.html -test("flex_basis_flex_grow_column", () => { +test('flex_basis_flex_grow_column', () => { const config = Yoga.Config.create(); let root; @@ -27,7 +27,7 @@ test("flex_basis_flex_grow_column", () => { const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -44,7 +44,7 @@ test("flex_basis_flex_grow_column", () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(25); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -61,14 +61,14 @@ test("flex_basis_flex_grow_column", () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(25); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_shrink_flex_grow_row", () => { +test('flex_shrink_flex_grow_row', () => { const config = Yoga.Config.create(); let root; @@ -92,7 +92,7 @@ test("flex_shrink_flex_grow_row", () => { root_child1.setWidth(500); root_child1.setHeight(100); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -109,7 +109,7 @@ test("flex_shrink_flex_grow_row", () => { expect(root_child1.getComputedWidth()).toBe(250); expect(root_child1.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -126,14 +126,14 @@ test("flex_shrink_flex_grow_row", () => { expect(root_child1.getComputedWidth()).toBe(250); expect(root_child1.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_shrink_flex_grow_child_flex_shrink_other_child", () => { +test('flex_shrink_flex_grow_child_flex_shrink_other_child', () => { const config = Yoga.Config.create(); let root; @@ -158,7 +158,7 @@ test("flex_shrink_flex_grow_child_flex_shrink_other_child", () => { root_child1.setWidth(500); root_child1.setHeight(100); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -175,7 +175,7 @@ test("flex_shrink_flex_grow_child_flex_shrink_other_child", () => { expect(root_child1.getComputedWidth()).toBe(250); expect(root_child1.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -192,14 +192,14 @@ test("flex_shrink_flex_grow_child_flex_shrink_other_child", () => { expect(root_child1.getComputedWidth()).toBe(250); expect(root_child1.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_basis_flex_grow_row", () => { +test('flex_basis_flex_grow_row', () => { const config = Yoga.Config.create(); let root; @@ -220,7 +220,7 @@ test("flex_basis_flex_grow_row", () => { const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -237,7 +237,7 @@ test("flex_basis_flex_grow_row", () => { expect(root_child1.getComputedWidth()).toBe(25); expect(root_child1.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -254,14 +254,14 @@ test("flex_basis_flex_grow_row", () => { expect(root_child1.getComputedWidth()).toBe(25); expect(root_child1.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_basis_flex_shrink_column", () => { +test('flex_basis_flex_shrink_column', () => { const config = Yoga.Config.create(); let root; @@ -281,7 +281,7 @@ test("flex_basis_flex_shrink_column", () => { const root_child1 = Yoga.Node.create(config); root_child1.setFlexBasis(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -298,7 +298,7 @@ test("flex_basis_flex_shrink_column", () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -315,14 +315,14 @@ test("flex_basis_flex_shrink_column", () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_basis_flex_shrink_row", () => { +test('flex_basis_flex_shrink_row', () => { const config = Yoga.Config.create(); let root; @@ -343,7 +343,7 @@ test("flex_basis_flex_shrink_row", () => { const root_child1 = Yoga.Node.create(config); root_child1.setFlexBasis(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -360,7 +360,7 @@ test("flex_basis_flex_shrink_row", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -377,14 +377,14 @@ test("flex_basis_flex_shrink_row", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_shrink_to_zero", () => { +test('flex_shrink_to_zero', () => { const config = Yoga.Config.create(); let root; @@ -410,7 +410,7 @@ test("flex_shrink_to_zero", () => { root_child2.setWidth(50); root_child2.setHeight(50); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -432,7 +432,7 @@ test("flex_shrink_to_zero", () => { expect(root_child2.getComputedWidth()).toBe(50); expect(root_child2.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -454,14 +454,14 @@ test("flex_shrink_to_zero", () => { expect(root_child2.getComputedWidth()).toBe(50); expect(root_child2.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_basis_overrides_main_size", () => { +test('flex_basis_overrides_main_size', () => { const config = Yoga.Config.create(); let root; @@ -488,7 +488,7 @@ test("flex_basis_overrides_main_size", () => { root_child2.setFlexGrow(1); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -510,7 +510,7 @@ test("flex_basis_overrides_main_size", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -532,14 +532,14 @@ test("flex_basis_overrides_main_size", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_grow_shrink_at_most", () => { +test('flex_grow_shrink_at_most', () => { const config = Yoga.Config.create(); let root; @@ -558,7 +558,7 @@ test("flex_grow_shrink_at_most", () => { root_child0_child0.setFlexGrow(1); root_child0_child0.setFlexShrink(1); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -575,7 +575,7 @@ test("flex_grow_shrink_at_most", () => { expect(root_child0_child0.getComputedWidth()).toBe(100); expect(root_child0_child0.getComputedHeight()).toBe(0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -592,14 +592,14 @@ test("flex_grow_shrink_at_most", () => { expect(root_child0_child0.getComputedWidth()).toBe(100); expect(root_child0_child0.getComputedHeight()).toBe(0); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_grow_less_than_factor_one", () => { +test('flex_grow_less_than_factor_one', () => { const config = Yoga.Config.create(); let root; @@ -623,7 +623,7 @@ test("flex_grow_less_than_factor_one", () => { const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(0.4); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -645,7 +645,7 @@ test("flex_grow_less_than_factor_one", () => { expect(root_child2.getComputedWidth()).toBe(200); expect(root_child2.getComputedHeight()).toBe(184); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -667,7 +667,7 @@ test("flex_grow_less_than_factor_one", () => { expect(root_child2.getComputedWidth()).toBe(200); expect(root_child2.getComputedHeight()).toBe(184); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } diff --git a/javascript/tests/generated/YGFlexWrapTest.test.js b/javascript/tests/generated/YGFlexWrapTest.test.js index f1cf1f41..3981a07b 100644 --- a/javascript/tests/generated/YGFlexWrapTest.test.js +++ b/javascript/tests/generated/YGFlexWrapTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexWrapTest.html -test("wrap_column", () => { +test('wrap_column', () => { const config = Yoga.Config.create(); let root; @@ -38,7 +38,7 @@ test("wrap_column", () => { root_child3.setWidth(30); root_child3.setHeight(30); root.insertChild(root_child3, 3); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -65,7 +65,7 @@ test("wrap_column", () => { expect(root_child3.getComputedWidth()).toBe(30); expect(root_child3.getComputedHeight()).toBe(30); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -92,14 +92,14 @@ test("wrap_column", () => { expect(root_child3.getComputedWidth()).toBe(30); expect(root_child3.getComputedHeight()).toBe(30); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("wrap_row", () => { +test('wrap_row', () => { const config = Yoga.Config.create(); let root; @@ -131,7 +131,7 @@ test("wrap_row", () => { root_child3.setWidth(30); root_child3.setHeight(30); root.insertChild(root_child3, 3); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -158,7 +158,7 @@ test("wrap_row", () => { expect(root_child3.getComputedWidth()).toBe(30); expect(root_child3.getComputedHeight()).toBe(30); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -185,14 +185,14 @@ test("wrap_row", () => { expect(root_child3.getComputedWidth()).toBe(30); expect(root_child3.getComputedHeight()).toBe(30); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("wrap_row_align_items_flex_end", () => { +test('wrap_row_align_items_flex_end', () => { const config = Yoga.Config.create(); let root; @@ -225,7 +225,7 @@ test("wrap_row_align_items_flex_end", () => { root_child3.setWidth(30); root_child3.setHeight(30); root.insertChild(root_child3, 3); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -252,7 +252,7 @@ test("wrap_row_align_items_flex_end", () => { expect(root_child3.getComputedWidth()).toBe(30); expect(root_child3.getComputedHeight()).toBe(30); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -279,14 +279,14 @@ test("wrap_row_align_items_flex_end", () => { expect(root_child3.getComputedWidth()).toBe(30); expect(root_child3.getComputedHeight()).toBe(30); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("wrap_row_align_items_center", () => { +test('wrap_row_align_items_center', () => { const config = Yoga.Config.create(); let root; @@ -319,7 +319,7 @@ test("wrap_row_align_items_center", () => { root_child3.setWidth(30); root_child3.setHeight(30); root.insertChild(root_child3, 3); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -346,7 +346,7 @@ test("wrap_row_align_items_center", () => { expect(root_child3.getComputedWidth()).toBe(30); expect(root_child3.getComputedHeight()).toBe(30); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -373,14 +373,14 @@ test("wrap_row_align_items_center", () => { expect(root_child3.getComputedWidth()).toBe(30); expect(root_child3.getComputedHeight()).toBe(30); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_wrap_children_with_min_main_overriding_flex_basis", () => { +test('flex_wrap_children_with_min_main_overriding_flex_basis', () => { const config = Yoga.Config.create(); let root; @@ -404,7 +404,7 @@ test("flex_wrap_children_with_min_main_overriding_flex_basis", () => { root_child1.setMinWidth(55); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -421,7 +421,7 @@ test("flex_wrap_children_with_min_main_overriding_flex_basis", () => { expect(root_child1.getComputedWidth()).toBe(55); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -438,14 +438,14 @@ test("flex_wrap_children_with_min_main_overriding_flex_basis", () => { expect(root_child1.getComputedWidth()).toBe(55); expect(root_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_wrap_wrap_to_child_height", () => { +test('flex_wrap_wrap_to_child_height', () => { const config = Yoga.Config.create(); let root; @@ -474,7 +474,7 @@ test("flex_wrap_wrap_to_child_height", () => { root_child1.setWidth(100); root_child1.setHeight(100); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -501,7 +501,7 @@ test("flex_wrap_wrap_to_child_height", () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -528,14 +528,14 @@ test("flex_wrap_wrap_to_child_height", () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_wrap_align_stretch_fits_one_row", () => { +test('flex_wrap_align_stretch_fits_one_row', () => { const config = Yoga.Config.create(); let root; @@ -556,7 +556,7 @@ test("flex_wrap_align_stretch_fits_one_row", () => { const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -573,7 +573,7 @@ test("flex_wrap_align_stretch_fits_one_row", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -590,14 +590,14 @@ test("flex_wrap_align_stretch_fits_one_row", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(0); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("wrap_reverse_row_align_content_flex_start", () => { +test('wrap_reverse_row_align_content_flex_start', () => { const config = Yoga.Config.create(); let root; @@ -634,7 +634,7 @@ test("wrap_reverse_row_align_content_flex_start", () => { root_child4.setWidth(30); root_child4.setHeight(50); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -666,7 +666,7 @@ test("wrap_reverse_row_align_content_flex_start", () => { expect(root_child4.getComputedWidth()).toBe(30); expect(root_child4.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -698,14 +698,14 @@ test("wrap_reverse_row_align_content_flex_start", () => { expect(root_child4.getComputedWidth()).toBe(30); expect(root_child4.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("wrap_reverse_row_align_content_center", () => { +test('wrap_reverse_row_align_content_center', () => { const config = Yoga.Config.create(); let root; @@ -743,7 +743,7 @@ test("wrap_reverse_row_align_content_center", () => { root_child4.setWidth(30); root_child4.setHeight(50); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -775,7 +775,7 @@ test("wrap_reverse_row_align_content_center", () => { expect(root_child4.getComputedWidth()).toBe(30); expect(root_child4.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -807,14 +807,14 @@ test("wrap_reverse_row_align_content_center", () => { expect(root_child4.getComputedWidth()).toBe(30); expect(root_child4.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("wrap_reverse_row_single_line_different_size", () => { +test('wrap_reverse_row_single_line_different_size', () => { const config = Yoga.Config.create(); let root; @@ -851,7 +851,7 @@ test("wrap_reverse_row_single_line_different_size", () => { root_child4.setWidth(30); root_child4.setHeight(50); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -883,7 +883,7 @@ test("wrap_reverse_row_single_line_different_size", () => { expect(root_child4.getComputedWidth()).toBe(30); expect(root_child4.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -915,14 +915,14 @@ test("wrap_reverse_row_single_line_different_size", () => { expect(root_child4.getComputedWidth()).toBe(30); expect(root_child4.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("wrap_reverse_row_align_content_stretch", () => { +test('wrap_reverse_row_align_content_stretch', () => { const config = Yoga.Config.create(); let root; @@ -960,7 +960,7 @@ test("wrap_reverse_row_align_content_stretch", () => { root_child4.setWidth(30); root_child4.setHeight(50); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -992,7 +992,7 @@ test("wrap_reverse_row_align_content_stretch", () => { expect(root_child4.getComputedWidth()).toBe(30); expect(root_child4.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1024,14 +1024,14 @@ test("wrap_reverse_row_align_content_stretch", () => { expect(root_child4.getComputedWidth()).toBe(30); expect(root_child4.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("wrap_reverse_row_align_content_space_around", () => { +test('wrap_reverse_row_align_content_space_around', () => { const config = Yoga.Config.create(); let root; @@ -1069,7 +1069,7 @@ test("wrap_reverse_row_align_content_space_around", () => { root_child4.setWidth(30); root_child4.setHeight(50); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1101,7 +1101,7 @@ test("wrap_reverse_row_align_content_space_around", () => { expect(root_child4.getComputedWidth()).toBe(30); expect(root_child4.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1133,14 +1133,14 @@ test("wrap_reverse_row_align_content_space_around", () => { expect(root_child4.getComputedWidth()).toBe(30); expect(root_child4.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("wrap_reverse_column_fixed_size", () => { +test('wrap_reverse_column_fixed_size', () => { const config = Yoga.Config.create(); let root; @@ -1178,7 +1178,7 @@ test("wrap_reverse_column_fixed_size", () => { root_child4.setWidth(30); root_child4.setHeight(50); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1210,7 +1210,7 @@ test("wrap_reverse_column_fixed_size", () => { expect(root_child4.getComputedWidth()).toBe(30); expect(root_child4.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1242,14 +1242,14 @@ test("wrap_reverse_column_fixed_size", () => { expect(root_child4.getComputedWidth()).toBe(30); expect(root_child4.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("wrapped_row_within_align_items_center", () => { +test('wrapped_row_within_align_items_center', () => { const config = Yoga.Config.create(); let root; @@ -1276,7 +1276,7 @@ test("wrapped_row_within_align_items_center", () => { root_child0_child1.setWidth(80); root_child0_child1.setHeight(80); root_child0.insertChild(root_child0_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1298,7 +1298,7 @@ test("wrapped_row_within_align_items_center", () => { expect(root_child0_child1.getComputedWidth()).toBe(80); expect(root_child0_child1.getComputedHeight()).toBe(80); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1320,14 +1320,14 @@ test("wrapped_row_within_align_items_center", () => { expect(root_child0_child1.getComputedWidth()).toBe(80); expect(root_child0_child1.getComputedHeight()).toBe(80); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("wrapped_row_within_align_items_flex_start", () => { +test('wrapped_row_within_align_items_flex_start', () => { const config = Yoga.Config.create(); let root; @@ -1354,7 +1354,7 @@ test("wrapped_row_within_align_items_flex_start", () => { root_child0_child1.setWidth(80); root_child0_child1.setHeight(80); root_child0.insertChild(root_child0_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1376,7 +1376,7 @@ test("wrapped_row_within_align_items_flex_start", () => { expect(root_child0_child1.getComputedWidth()).toBe(80); expect(root_child0_child1.getComputedHeight()).toBe(80); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1398,14 +1398,14 @@ test("wrapped_row_within_align_items_flex_start", () => { expect(root_child0_child1.getComputedWidth()).toBe(80); expect(root_child0_child1.getComputedHeight()).toBe(80); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("wrapped_row_within_align_items_flex_end", () => { +test('wrapped_row_within_align_items_flex_end', () => { const config = Yoga.Config.create(); let root; @@ -1432,7 +1432,7 @@ test("wrapped_row_within_align_items_flex_end", () => { root_child0_child1.setWidth(80); root_child0_child1.setHeight(80); root_child0.insertChild(root_child0_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1454,7 +1454,7 @@ test("wrapped_row_within_align_items_flex_end", () => { expect(root_child0_child1.getComputedWidth()).toBe(80); expect(root_child0_child1.getComputedHeight()).toBe(80); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1476,14 +1476,14 @@ test("wrapped_row_within_align_items_flex_end", () => { expect(root_child0_child1.getComputedWidth()).toBe(80); expect(root_child0_child1.getComputedHeight()).toBe(80); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("wrapped_column_max_height", () => { +test('wrapped_column_max_height', () => { const config = Yoga.Config.create(); let root; @@ -1518,7 +1518,7 @@ test("wrapped_column_max_height", () => { root_child2.setWidth(100); root_child2.setHeight(100); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1540,7 +1540,7 @@ test("wrapped_column_max_height", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1562,14 +1562,14 @@ test("wrapped_column_max_height", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("wrapped_column_max_height_flex", () => { +test('wrapped_column_max_height_flex', () => { const config = Yoga.Config.create(); let root; @@ -1610,7 +1610,7 @@ test("wrapped_column_max_height_flex", () => { root_child2.setWidth(100); root_child2.setHeight(100); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1632,7 +1632,7 @@ test("wrapped_column_max_height_flex", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1654,14 +1654,14 @@ test("wrapped_column_max_height_flex", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("wrap_nodes_with_content_sizing_overflowing_margin", () => { +test('wrap_nodes_with_content_sizing_overflowing_margin', () => { const config = Yoga.Config.create(); let root; @@ -1695,7 +1695,7 @@ test("wrap_nodes_with_content_sizing_overflowing_margin", () => { root_child0_child1_child0.setWidth(40); root_child0_child1_child0.setHeight(40); root_child0_child1.insertChild(root_child0_child1_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1727,7 +1727,7 @@ test("wrap_nodes_with_content_sizing_overflowing_margin", () => { expect(root_child0_child1_child0.getComputedWidth()).toBe(40); expect(root_child0_child1_child0.getComputedHeight()).toBe(40); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1759,14 +1759,14 @@ test("wrap_nodes_with_content_sizing_overflowing_margin", () => { expect(root_child0_child1_child0.getComputedWidth()).toBe(40); expect(root_child0_child1_child0.getComputedHeight()).toBe(40); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("wrap_nodes_with_content_sizing_margin_cross", () => { +test('wrap_nodes_with_content_sizing_margin_cross', () => { const config = Yoga.Config.create(); let root; @@ -1800,7 +1800,7 @@ test("wrap_nodes_with_content_sizing_margin_cross", () => { root_child0_child1_child0.setWidth(40); root_child0_child1_child0.setHeight(40); root_child0_child1.insertChild(root_child0_child1_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1832,7 +1832,7 @@ test("wrap_nodes_with_content_sizing_margin_cross", () => { expect(root_child0_child1_child0.getComputedWidth()).toBe(40); expect(root_child0_child1_child0.getComputedHeight()).toBe(40); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1864,7 +1864,7 @@ test("wrap_nodes_with_content_sizing_margin_cross", () => { expect(root_child0_child1_child0.getComputedWidth()).toBe(40); expect(root_child0_child1_child0.getComputedHeight()).toBe(40); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } diff --git a/javascript/tests/generated/YGGapTest.test.js b/javascript/tests/generated/YGGapTest.test.js index 765eeea5..dcec0450 100644 --- a/javascript/tests/generated/YGGapTest.test.js +++ b/javascript/tests/generated/YGGapTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGGapTest.html -test("column_gap_flexible", () => { +test('column_gap_flexible', () => { const config = Yoga.Config.create(); let root; @@ -39,7 +39,7 @@ test("column_gap_flexible", () => { root_child2.setFlexShrink(1); root_child2.setFlexBasis("0%"); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -61,7 +61,7 @@ test("column_gap_flexible", () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -83,14 +83,14 @@ test("column_gap_flexible", () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("column_gap_inflexible", () => { +test('column_gap_inflexible', () => { const config = Yoga.Config.create(); let root; @@ -115,7 +115,7 @@ test("column_gap_inflexible", () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -137,7 +137,7 @@ test("column_gap_inflexible", () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -159,14 +159,14 @@ test("column_gap_inflexible", () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("column_gap_mixed_flexible", () => { +test('column_gap_mixed_flexible', () => { const config = Yoga.Config.create(); let root; @@ -193,7 +193,7 @@ test("column_gap_mixed_flexible", () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -215,7 +215,7 @@ test("column_gap_mixed_flexible", () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -237,14 +237,14 @@ test("column_gap_mixed_flexible", () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("column_gap_child_margins", () => { +test('column_gap_child_margins', () => { const config = Yoga.Config.create(); let root; @@ -281,7 +281,7 @@ test("column_gap_child_margins", () => { root_child2.setMargin(Yoga.EDGE_LEFT, 15); root_child2.setMargin(Yoga.EDGE_RIGHT, 15); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -303,7 +303,7 @@ test("column_gap_child_margins", () => { expect(root_child2.getComputedWidth()).toBe(2); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -325,14 +325,14 @@ test("column_gap_child_margins", () => { expect(root_child2.getComputedWidth()).toBe(2); expect(root_child2.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("column_row_gap_wrapping", () => { +test('column_row_gap_wrapping', () => { const config = Yoga.Config.create(); let root; @@ -391,7 +391,7 @@ test("column_row_gap_wrapping", () => { root_child8.setWidth(20); root_child8.setHeight(20); root.insertChild(root_child8, 8); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -443,7 +443,7 @@ test("column_row_gap_wrapping", () => { expect(root_child8.getComputedWidth()).toBe(20); expect(root_child8.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -495,14 +495,14 @@ test("column_row_gap_wrapping", () => { expect(root_child8.getComputedWidth()).toBe(20); expect(root_child8.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("column_gap_justify_flex_start", () => { +test('column_gap_justify_flex_start', () => { const config = Yoga.Config.create(); let root; @@ -527,7 +527,7 @@ test("column_gap_justify_flex_start", () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -549,7 +549,7 @@ test("column_gap_justify_flex_start", () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -571,14 +571,14 @@ test("column_gap_justify_flex_start", () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("column_gap_justify_center", () => { +test('column_gap_justify_center', () => { const config = Yoga.Config.create(); let root; @@ -604,7 +604,7 @@ test("column_gap_justify_center", () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -626,7 +626,7 @@ test("column_gap_justify_center", () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -648,14 +648,14 @@ test("column_gap_justify_center", () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("column_gap_justify_flex_end", () => { +test('column_gap_justify_flex_end', () => { const config = Yoga.Config.create(); let root; @@ -681,7 +681,7 @@ test("column_gap_justify_flex_end", () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -703,7 +703,7 @@ test("column_gap_justify_flex_end", () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -725,14 +725,14 @@ test("column_gap_justify_flex_end", () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("column_gap_justify_space_between", () => { +test('column_gap_justify_space_between', () => { const config = Yoga.Config.create(); let root; @@ -758,7 +758,7 @@ test("column_gap_justify_space_between", () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -780,7 +780,7 @@ test("column_gap_justify_space_between", () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -802,14 +802,14 @@ test("column_gap_justify_space_between", () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("column_gap_justify_space_around", () => { +test('column_gap_justify_space_around', () => { const config = Yoga.Config.create(); let root; @@ -835,7 +835,7 @@ test("column_gap_justify_space_around", () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -857,7 +857,7 @@ test("column_gap_justify_space_around", () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -879,14 +879,14 @@ test("column_gap_justify_space_around", () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("column_gap_justify_space_evenly", () => { +test('column_gap_justify_space_evenly', () => { const config = Yoga.Config.create(); let root; @@ -912,7 +912,7 @@ test("column_gap_justify_space_evenly", () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -934,7 +934,7 @@ test("column_gap_justify_space_evenly", () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -956,14 +956,14 @@ test("column_gap_justify_space_evenly", () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("column_gap_wrap_align_flex_start", () => { +test('column_gap_wrap_align_flex_start', () => { const config = Yoga.Config.create(); let root; @@ -1008,7 +1008,7 @@ test("column_gap_wrap_align_flex_start", () => { root_child5.setWidth(20); root_child5.setHeight(20); root.insertChild(root_child5, 5); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1045,7 +1045,7 @@ test("column_gap_wrap_align_flex_start", () => { expect(root_child5.getComputedWidth()).toBe(20); expect(root_child5.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1082,14 +1082,14 @@ test("column_gap_wrap_align_flex_start", () => { expect(root_child5.getComputedWidth()).toBe(20); expect(root_child5.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("column_gap_wrap_align_center", () => { +test('column_gap_wrap_align_center', () => { const config = Yoga.Config.create(); let root; @@ -1135,7 +1135,7 @@ test("column_gap_wrap_align_center", () => { root_child5.setWidth(20); root_child5.setHeight(20); root.insertChild(root_child5, 5); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1172,7 +1172,7 @@ test("column_gap_wrap_align_center", () => { expect(root_child5.getComputedWidth()).toBe(20); expect(root_child5.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1209,14 +1209,14 @@ test("column_gap_wrap_align_center", () => { expect(root_child5.getComputedWidth()).toBe(20); expect(root_child5.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("column_gap_wrap_align_flex_end", () => { +test('column_gap_wrap_align_flex_end', () => { const config = Yoga.Config.create(); let root; @@ -1262,7 +1262,7 @@ test("column_gap_wrap_align_flex_end", () => { root_child5.setWidth(20); root_child5.setHeight(20); root.insertChild(root_child5, 5); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1299,7 +1299,7 @@ test("column_gap_wrap_align_flex_end", () => { expect(root_child5.getComputedWidth()).toBe(20); expect(root_child5.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1336,14 +1336,14 @@ test("column_gap_wrap_align_flex_end", () => { expect(root_child5.getComputedWidth()).toBe(20); expect(root_child5.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("column_gap_wrap_align_space_between", () => { +test('column_gap_wrap_align_space_between', () => { const config = Yoga.Config.create(); let root; @@ -1389,7 +1389,7 @@ test("column_gap_wrap_align_space_between", () => { root_child5.setWidth(20); root_child5.setHeight(20); root.insertChild(root_child5, 5); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1426,7 +1426,7 @@ test("column_gap_wrap_align_space_between", () => { expect(root_child5.getComputedWidth()).toBe(20); expect(root_child5.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1463,14 +1463,14 @@ test("column_gap_wrap_align_space_between", () => { expect(root_child5.getComputedWidth()).toBe(20); expect(root_child5.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("column_gap_wrap_align_space_around", () => { +test('column_gap_wrap_align_space_around', () => { const config = Yoga.Config.create(); let root; @@ -1516,7 +1516,7 @@ test("column_gap_wrap_align_space_around", () => { root_child5.setWidth(20); root_child5.setHeight(20); root.insertChild(root_child5, 5); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1553,7 +1553,7 @@ test("column_gap_wrap_align_space_around", () => { expect(root_child5.getComputedWidth()).toBe(20); expect(root_child5.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1590,14 +1590,14 @@ test("column_gap_wrap_align_space_around", () => { expect(root_child5.getComputedWidth()).toBe(20); expect(root_child5.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("column_gap_wrap_align_stretch", () => { +test('column_gap_wrap_align_stretch', () => { const config = Yoga.Config.create(); let root; @@ -1637,7 +1637,7 @@ test("column_gap_wrap_align_stretch", () => { root_child4.setFlexGrow(1); root_child4.setMinWidth(60); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1669,7 +1669,7 @@ test("column_gap_wrap_align_stretch", () => { expect(root_child4.getComputedWidth()).toBe(300); expect(root_child4.getComputedHeight()).toBe(150); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1701,14 +1701,14 @@ test("column_gap_wrap_align_stretch", () => { expect(root_child4.getComputedWidth()).toBe(300); expect(root_child4.getComputedHeight()).toBe(150); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("column_gap_determines_parent_width", () => { +test('column_gap_determines_parent_width', () => { const config = Yoga.Config.create(); let root; @@ -1732,7 +1732,7 @@ test("column_gap_determines_parent_width", () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(30); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1754,7 +1754,7 @@ test("column_gap_determines_parent_width", () => { expect(root_child2.getComputedWidth()).toBe(30); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1776,14 +1776,14 @@ test("column_gap_determines_parent_width", () => { expect(root_child2.getComputedWidth()).toBe(30); expect(root_child2.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("row_gap_align_items_stretch", () => { +test('row_gap_align_items_stretch', () => { const config = Yoga.Config.create(); let root; @@ -1823,7 +1823,7 @@ test("row_gap_align_items_stretch", () => { const root_child5 = Yoga.Node.create(config); root_child5.setWidth(20); root.insertChild(root_child5, 5); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1860,7 +1860,7 @@ test("row_gap_align_items_stretch", () => { expect(root_child5.getComputedWidth()).toBe(20); expect(root_child5.getComputedHeight()).toBe(90); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1897,14 +1897,14 @@ test("row_gap_align_items_stretch", () => { expect(root_child5.getComputedWidth()).toBe(20); expect(root_child5.getComputedHeight()).toBe(90); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("row_gap_align_items_end", () => { +test('row_gap_align_items_end', () => { const config = Yoga.Config.create(); let root; @@ -1944,7 +1944,7 @@ test("row_gap_align_items_end", () => { const root_child5 = Yoga.Node.create(config); root_child5.setWidth(20); root.insertChild(root_child5, 5); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1981,7 +1981,7 @@ test("row_gap_align_items_end", () => { expect(root_child5.getComputedWidth()).toBe(20); expect(root_child5.getComputedHeight()).toBe(0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2018,14 +2018,14 @@ test("row_gap_align_items_end", () => { expect(root_child5.getComputedWidth()).toBe(20); expect(root_child5.getComputedHeight()).toBe(0); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("row_gap_column_child_margins", () => { +test('row_gap_column_child_margins', () => { const config = Yoga.Config.create(); let root; @@ -2061,7 +2061,7 @@ test("row_gap_column_child_margins", () => { root_child2.setMargin(Yoga.EDGE_TOP, 15); root_child2.setMargin(Yoga.EDGE_BOTTOM, 15); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2083,7 +2083,7 @@ test("row_gap_column_child_margins", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(42); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2105,14 +2105,14 @@ test("row_gap_column_child_margins", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(42); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("row_gap_row_wrap_child_margins", () => { +test('row_gap_row_wrap_child_margins', () => { const config = Yoga.Config.create(); let root; @@ -2144,7 +2144,7 @@ test("row_gap_row_wrap_child_margins", () => { root_child2.setMargin(Yoga.EDGE_BOTTOM, 15); root_child2.setWidth(60); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2166,7 +2166,7 @@ test("row_gap_row_wrap_child_margins", () => { expect(root_child2.getComputedWidth()).toBe(60); expect(root_child2.getComputedHeight()).toBe(0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2188,14 +2188,14 @@ test("row_gap_row_wrap_child_margins", () => { expect(root_child2.getComputedWidth()).toBe(60); expect(root_child2.getComputedHeight()).toBe(0); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("row_gap_determines_parent_height", () => { +test('row_gap_determines_parent_height', () => { const config = Yoga.Config.create(); let root; @@ -2218,7 +2218,7 @@ test("row_gap_determines_parent_height", () => { const root_child2 = Yoga.Node.create(config); root_child2.setHeight(30); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2240,7 +2240,7 @@ test("row_gap_determines_parent_height", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(30); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2262,7 +2262,7 @@ test("row_gap_determines_parent_height", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(30); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } diff --git a/javascript/tests/generated/YGJustifyContentTest.test.js b/javascript/tests/generated/YGJustifyContentTest.test.js index 5066cfb1..270b650d 100644 --- a/javascript/tests/generated/YGJustifyContentTest.test.js +++ b/javascript/tests/generated/YGJustifyContentTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGJustifyContentTest.html -test("justify_content_row_flex_start", () => { +test('justify_content_row_flex_start', () => { const config = Yoga.Config.create(); let root; @@ -31,7 +31,7 @@ test("justify_content_row_flex_start", () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -53,7 +53,7 @@ test("justify_content_row_flex_start", () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(102); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -75,14 +75,14 @@ test("justify_content_row_flex_start", () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(102); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("justify_content_row_flex_end", () => { +test('justify_content_row_flex_end', () => { const config = Yoga.Config.create(); let root; @@ -107,7 +107,7 @@ test("justify_content_row_flex_end", () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -129,7 +129,7 @@ test("justify_content_row_flex_end", () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(102); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -151,14 +151,14 @@ test("justify_content_row_flex_end", () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(102); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("justify_content_row_center", () => { +test('justify_content_row_center', () => { const config = Yoga.Config.create(); let root; @@ -183,7 +183,7 @@ test("justify_content_row_center", () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -205,7 +205,7 @@ test("justify_content_row_center", () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(102); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -227,14 +227,14 @@ test("justify_content_row_center", () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(102); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("justify_content_row_space_between", () => { +test('justify_content_row_space_between', () => { const config = Yoga.Config.create(); let root; @@ -259,7 +259,7 @@ test("justify_content_row_space_between", () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -281,7 +281,7 @@ test("justify_content_row_space_between", () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(102); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -303,14 +303,14 @@ test("justify_content_row_space_between", () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(102); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("justify_content_row_space_around", () => { +test('justify_content_row_space_around', () => { const config = Yoga.Config.create(); let root; @@ -335,7 +335,7 @@ test("justify_content_row_space_around", () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -357,7 +357,7 @@ test("justify_content_row_space_around", () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(102); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -379,14 +379,14 @@ test("justify_content_row_space_around", () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(102); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("justify_content_column_flex_start", () => { +test('justify_content_column_flex_start', () => { const config = Yoga.Config.create(); let root; @@ -409,7 +409,7 @@ test("justify_content_column_flex_start", () => { const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -431,7 +431,7 @@ test("justify_content_column_flex_start", () => { expect(root_child2.getComputedWidth()).toBe(102); expect(root_child2.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -453,14 +453,14 @@ test("justify_content_column_flex_start", () => { expect(root_child2.getComputedWidth()).toBe(102); expect(root_child2.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("justify_content_column_flex_end", () => { +test('justify_content_column_flex_end', () => { const config = Yoga.Config.create(); let root; @@ -484,7 +484,7 @@ test("justify_content_column_flex_end", () => { const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -506,7 +506,7 @@ test("justify_content_column_flex_end", () => { expect(root_child2.getComputedWidth()).toBe(102); expect(root_child2.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -528,14 +528,14 @@ test("justify_content_column_flex_end", () => { expect(root_child2.getComputedWidth()).toBe(102); expect(root_child2.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("justify_content_column_center", () => { +test('justify_content_column_center', () => { const config = Yoga.Config.create(); let root; @@ -559,7 +559,7 @@ test("justify_content_column_center", () => { const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -581,7 +581,7 @@ test("justify_content_column_center", () => { expect(root_child2.getComputedWidth()).toBe(102); expect(root_child2.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -603,14 +603,14 @@ test("justify_content_column_center", () => { expect(root_child2.getComputedWidth()).toBe(102); expect(root_child2.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("justify_content_column_space_between", () => { +test('justify_content_column_space_between', () => { const config = Yoga.Config.create(); let root; @@ -634,7 +634,7 @@ test("justify_content_column_space_between", () => { const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -656,7 +656,7 @@ test("justify_content_column_space_between", () => { expect(root_child2.getComputedWidth()).toBe(102); expect(root_child2.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -678,14 +678,14 @@ test("justify_content_column_space_between", () => { expect(root_child2.getComputedWidth()).toBe(102); expect(root_child2.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("justify_content_column_space_around", () => { +test('justify_content_column_space_around', () => { const config = Yoga.Config.create(); let root; @@ -709,7 +709,7 @@ test("justify_content_column_space_around", () => { const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -731,7 +731,7 @@ test("justify_content_column_space_around", () => { expect(root_child2.getComputedWidth()).toBe(102); expect(root_child2.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -753,14 +753,14 @@ test("justify_content_column_space_around", () => { expect(root_child2.getComputedWidth()).toBe(102); expect(root_child2.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("justify_content_row_min_width_and_margin", () => { +test('justify_content_row_min_width_and_margin', () => { const config = Yoga.Config.create(); let root; @@ -778,7 +778,7 @@ test("justify_content_row_min_width_and_margin", () => { root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(100); expect(root.getComputedTop()).toBe(0); @@ -790,7 +790,7 @@ test("justify_content_row_min_width_and_margin", () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(100); expect(root.getComputedTop()).toBe(0); @@ -802,14 +802,14 @@ test("justify_content_row_min_width_and_margin", () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("justify_content_row_max_width_and_margin", () => { +test('justify_content_row_max_width_and_margin', () => { const config = Yoga.Config.create(); let root; @@ -828,7 +828,7 @@ test("justify_content_row_max_width_and_margin", () => { root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(100); expect(root.getComputedTop()).toBe(0); @@ -840,7 +840,7 @@ test("justify_content_row_max_width_and_margin", () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(100); expect(root.getComputedTop()).toBe(0); @@ -852,14 +852,14 @@ test("justify_content_row_max_width_and_margin", () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("justify_content_column_min_height_and_margin", () => { +test('justify_content_column_min_height_and_margin', () => { const config = Yoga.Config.create(); let root; @@ -876,7 +876,7 @@ test("justify_content_column_min_height_and_margin", () => { root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(100); @@ -888,7 +888,7 @@ test("justify_content_column_min_height_and_margin", () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(100); @@ -900,14 +900,14 @@ test("justify_content_column_min_height_and_margin", () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("justify_content_colunn_max_height_and_margin", () => { +test('justify_content_colunn_max_height_and_margin', () => { const config = Yoga.Config.create(); let root; @@ -925,7 +925,7 @@ test("justify_content_colunn_max_height_and_margin", () => { root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(100); @@ -937,7 +937,7 @@ test("justify_content_colunn_max_height_and_margin", () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(100); @@ -949,14 +949,14 @@ test("justify_content_colunn_max_height_and_margin", () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("justify_content_column_space_evenly", () => { +test('justify_content_column_space_evenly', () => { const config = Yoga.Config.create(); let root; @@ -980,7 +980,7 @@ test("justify_content_column_space_evenly", () => { const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1002,7 +1002,7 @@ test("justify_content_column_space_evenly", () => { expect(root_child2.getComputedWidth()).toBe(102); expect(root_child2.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1024,14 +1024,14 @@ test("justify_content_column_space_evenly", () => { expect(root_child2.getComputedWidth()).toBe(102); expect(root_child2.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("justify_content_row_space_evenly", () => { +test('justify_content_row_space_evenly', () => { const config = Yoga.Config.create(); let root; @@ -1056,7 +1056,7 @@ test("justify_content_row_space_evenly", () => { const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1078,7 +1078,7 @@ test("justify_content_row_space_evenly", () => { expect(root_child2.getComputedWidth()).toBe(0); expect(root_child2.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1100,14 +1100,14 @@ test("justify_content_row_space_evenly", () => { expect(root_child2.getComputedWidth()).toBe(0); expect(root_child2.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("justify_content_min_width_with_padding_child_width_greater_than_parent", () => { +test('justify_content_min_width_with_padding_child_width_greater_than_parent', () => { const config = Yoga.Config.create(); let root; @@ -1140,7 +1140,7 @@ test("justify_content_min_width_with_padding_child_width_greater_than_parent", ( root_child0_child0_child0.setWidth(300); root_child0_child0_child0.setHeight(100); root_child0_child0.insertChild(root_child0_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1162,7 +1162,7 @@ test("justify_content_min_width_with_padding_child_width_greater_than_parent", ( expect(root_child0_child0_child0.getComputedWidth()).toBe(300); expect(root_child0_child0_child0.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1184,14 +1184,14 @@ test("justify_content_min_width_with_padding_child_width_greater_than_parent", ( expect(root_child0_child0_child0.getComputedWidth()).toBe(300); expect(root_child0_child0_child0.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("justify_content_min_width_with_padding_child_width_lower_than_parent", () => { +test('justify_content_min_width_with_padding_child_width_lower_than_parent', () => { const config = Yoga.Config.create(); let root; @@ -1224,7 +1224,7 @@ test("justify_content_min_width_with_padding_child_width_lower_than_parent", () root_child0_child0_child0.setWidth(199); root_child0_child0_child0.setHeight(100); root_child0_child0.insertChild(root_child0_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1246,7 +1246,7 @@ test("justify_content_min_width_with_padding_child_width_lower_than_parent", () expect(root_child0_child0_child0.getComputedWidth()).toBe(199); expect(root_child0_child0_child0.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1268,7 +1268,7 @@ test("justify_content_min_width_with_padding_child_width_lower_than_parent", () expect(root_child0_child0_child0.getComputedWidth()).toBe(199); expect(root_child0_child0_child0.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } diff --git a/javascript/tests/generated/YGMarginTest.test.js b/javascript/tests/generated/YGMarginTest.test.js index 65ee1a17..fcd4c1a2 100644 --- a/javascript/tests/generated/YGMarginTest.test.js +++ b/javascript/tests/generated/YGMarginTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGMarginTest.html -test("margin_start", () => { +test('margin_start', () => { const config = Yoga.Config.create(); let root; @@ -24,7 +24,7 @@ test("margin_start", () => { root_child0.setMargin(Yoga.EDGE_START, 10); root_child0.setWidth(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -36,7 +36,7 @@ test("margin_start", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -48,14 +48,14 @@ test("margin_start", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_top", () => { +test('margin_top', () => { const config = Yoga.Config.create(); let root; @@ -71,7 +71,7 @@ test("margin_top", () => { root_child0.setMargin(Yoga.EDGE_TOP, 10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -83,7 +83,7 @@ test("margin_top", () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -95,14 +95,14 @@ test("margin_top", () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_end", () => { +test('margin_end', () => { const config = Yoga.Config.create(); let root; @@ -120,7 +120,7 @@ test("margin_end", () => { root_child0.setMargin(Yoga.EDGE_END, 10); root_child0.setWidth(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -132,7 +132,7 @@ test("margin_end", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -144,14 +144,14 @@ test("margin_end", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_bottom", () => { +test('margin_bottom', () => { const config = Yoga.Config.create(); let root; @@ -168,7 +168,7 @@ test("margin_bottom", () => { root_child0.setMargin(Yoga.EDGE_BOTTOM, 10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -180,7 +180,7 @@ test("margin_bottom", () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -192,14 +192,14 @@ test("margin_bottom", () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_and_flex_row", () => { +test('margin_and_flex_row', () => { const config = Yoga.Config.create(); let root; @@ -217,7 +217,7 @@ test("margin_and_flex_row", () => { root_child0.setMargin(Yoga.EDGE_START, 10); root_child0.setMargin(Yoga.EDGE_END, 10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -229,7 +229,7 @@ test("margin_and_flex_row", () => { expect(root_child0.getComputedWidth()).toBe(80); expect(root_child0.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -241,14 +241,14 @@ test("margin_and_flex_row", () => { expect(root_child0.getComputedWidth()).toBe(80); expect(root_child0.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_and_flex_column", () => { +test('margin_and_flex_column', () => { const config = Yoga.Config.create(); let root; @@ -265,7 +265,7 @@ test("margin_and_flex_column", () => { root_child0.setMargin(Yoga.EDGE_TOP, 10); root_child0.setMargin(Yoga.EDGE_BOTTOM, 10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -277,7 +277,7 @@ test("margin_and_flex_column", () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(80); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -289,14 +289,14 @@ test("margin_and_flex_column", () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(80); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_and_stretch_row", () => { +test('margin_and_stretch_row', () => { const config = Yoga.Config.create(); let root; @@ -314,7 +314,7 @@ test("margin_and_stretch_row", () => { root_child0.setMargin(Yoga.EDGE_TOP, 10); root_child0.setMargin(Yoga.EDGE_BOTTOM, 10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -326,7 +326,7 @@ test("margin_and_stretch_row", () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(80); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -338,14 +338,14 @@ test("margin_and_stretch_row", () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(80); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_and_stretch_column", () => { +test('margin_and_stretch_column', () => { const config = Yoga.Config.create(); let root; @@ -362,7 +362,7 @@ test("margin_and_stretch_column", () => { root_child0.setMargin(Yoga.EDGE_START, 10); root_child0.setMargin(Yoga.EDGE_END, 10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -374,7 +374,7 @@ test("margin_and_stretch_column", () => { expect(root_child0.getComputedWidth()).toBe(80); expect(root_child0.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -386,14 +386,14 @@ test("margin_and_stretch_column", () => { expect(root_child0.getComputedWidth()).toBe(80); expect(root_child0.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_with_sibling_row", () => { +test('margin_with_sibling_row', () => { const config = Yoga.Config.create(); let root; @@ -414,7 +414,7 @@ test("margin_with_sibling_row", () => { const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -431,7 +431,7 @@ test("margin_with_sibling_row", () => { expect(root_child1.getComputedWidth()).toBe(45); expect(root_child1.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -448,14 +448,14 @@ test("margin_with_sibling_row", () => { expect(root_child1.getComputedWidth()).toBe(45); expect(root_child1.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_with_sibling_column", () => { +test('margin_with_sibling_column', () => { const config = Yoga.Config.create(); let root; @@ -475,7 +475,7 @@ test("margin_with_sibling_column", () => { const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -492,7 +492,7 @@ test("margin_with_sibling_column", () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(45); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -509,14 +509,14 @@ test("margin_with_sibling_column", () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(45); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_auto_bottom", () => { +test('margin_auto_bottom', () => { const config = Yoga.Config.create(); let root; @@ -539,7 +539,7 @@ test("margin_auto_bottom", () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -556,7 +556,7 @@ test("margin_auto_bottom", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -573,14 +573,14 @@ test("margin_auto_bottom", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_auto_top", () => { +test('margin_auto_top', () => { const config = Yoga.Config.create(); let root; @@ -603,7 +603,7 @@ test("margin_auto_top", () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -620,7 +620,7 @@ test("margin_auto_top", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -637,14 +637,14 @@ test("margin_auto_top", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_auto_bottom_and_top", () => { +test('margin_auto_bottom_and_top', () => { const config = Yoga.Config.create(); let root; @@ -668,7 +668,7 @@ test("margin_auto_bottom_and_top", () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -685,7 +685,7 @@ test("margin_auto_bottom_and_top", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -702,14 +702,14 @@ test("margin_auto_bottom_and_top", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_auto_bottom_and_top_justify_center", () => { +test('margin_auto_bottom_and_top_justify_center', () => { const config = Yoga.Config.create(); let root; @@ -733,7 +733,7 @@ test("margin_auto_bottom_and_top_justify_center", () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -750,7 +750,7 @@ test("margin_auto_bottom_and_top_justify_center", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -767,14 +767,14 @@ test("margin_auto_bottom_and_top_justify_center", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_auto_mutiple_children_column", () => { +test('margin_auto_mutiple_children_column', () => { const config = Yoga.Config.create(); let root; @@ -803,7 +803,7 @@ test("margin_auto_mutiple_children_column", () => { root_child2.setWidth(50); root_child2.setHeight(50); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -825,7 +825,7 @@ test("margin_auto_mutiple_children_column", () => { expect(root_child2.getComputedWidth()).toBe(50); expect(root_child2.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -847,14 +847,14 @@ test("margin_auto_mutiple_children_column", () => { expect(root_child2.getComputedWidth()).toBe(50); expect(root_child2.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_auto_mutiple_children_row", () => { +test('margin_auto_mutiple_children_row', () => { const config = Yoga.Config.create(); let root; @@ -884,7 +884,7 @@ test("margin_auto_mutiple_children_row", () => { root_child2.setWidth(50); root_child2.setHeight(50); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -906,7 +906,7 @@ test("margin_auto_mutiple_children_row", () => { expect(root_child2.getComputedWidth()).toBe(50); expect(root_child2.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -928,14 +928,14 @@ test("margin_auto_mutiple_children_row", () => { expect(root_child2.getComputedWidth()).toBe(50); expect(root_child2.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_auto_left_and_right_column", () => { +test('margin_auto_left_and_right_column', () => { const config = Yoga.Config.create(); let root; @@ -960,7 +960,7 @@ test("margin_auto_left_and_right_column", () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -977,7 +977,7 @@ test("margin_auto_left_and_right_column", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -994,14 +994,14 @@ test("margin_auto_left_and_right_column", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_auto_left_and_right", () => { +test('margin_auto_left_and_right', () => { const config = Yoga.Config.create(); let root; @@ -1024,7 +1024,7 @@ test("margin_auto_left_and_right", () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1041,7 +1041,7 @@ test("margin_auto_left_and_right", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1058,14 +1058,14 @@ test("margin_auto_left_and_right", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_auto_start_and_end_column", () => { +test('margin_auto_start_and_end_column', () => { const config = Yoga.Config.create(); let root; @@ -1090,7 +1090,7 @@ test("margin_auto_start_and_end_column", () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1107,7 +1107,7 @@ test("margin_auto_start_and_end_column", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1124,14 +1124,14 @@ test("margin_auto_start_and_end_column", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_auto_start_and_end", () => { +test('margin_auto_start_and_end', () => { const config = Yoga.Config.create(); let root; @@ -1154,7 +1154,7 @@ test("margin_auto_start_and_end", () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1171,7 +1171,7 @@ test("margin_auto_start_and_end", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1188,14 +1188,14 @@ test("margin_auto_start_and_end", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_auto_left_and_right_column_and_center", () => { +test('margin_auto_left_and_right_column_and_center', () => { const config = Yoga.Config.create(); let root; @@ -1219,7 +1219,7 @@ test("margin_auto_left_and_right_column_and_center", () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1236,7 +1236,7 @@ test("margin_auto_left_and_right_column_and_center", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1253,14 +1253,14 @@ test("margin_auto_left_and_right_column_and_center", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_auto_left", () => { +test('margin_auto_left', () => { const config = Yoga.Config.create(); let root; @@ -1283,7 +1283,7 @@ test("margin_auto_left", () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1300,7 +1300,7 @@ test("margin_auto_left", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1317,14 +1317,14 @@ test("margin_auto_left", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_auto_right", () => { +test('margin_auto_right', () => { const config = Yoga.Config.create(); let root; @@ -1347,7 +1347,7 @@ test("margin_auto_right", () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1364,7 +1364,7 @@ test("margin_auto_right", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1381,14 +1381,14 @@ test("margin_auto_right", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_auto_left_and_right_stretch", () => { +test('margin_auto_left_and_right_stretch', () => { const config = Yoga.Config.create(); let root; @@ -1412,7 +1412,7 @@ test("margin_auto_left_and_right_stretch", () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1429,7 +1429,7 @@ test("margin_auto_left_and_right_stretch", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1446,14 +1446,14 @@ test("margin_auto_left_and_right_stretch", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_auto_top_and_bottom_stretch", () => { +test('margin_auto_top_and_bottom_stretch', () => { const config = Yoga.Config.create(); let root; @@ -1476,7 +1476,7 @@ test("margin_auto_top_and_bottom_stretch", () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1493,7 +1493,7 @@ test("margin_auto_top_and_bottom_stretch", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1510,14 +1510,14 @@ test("margin_auto_top_and_bottom_stretch", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_should_not_be_part_of_max_height", () => { +test('margin_should_not_be_part_of_max_height', () => { const config = Yoga.Config.create(); let root; @@ -1535,7 +1535,7 @@ test("margin_should_not_be_part_of_max_height", () => { root_child0.setHeight(100); root_child0.setMaxHeight(100); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1547,7 +1547,7 @@ test("margin_should_not_be_part_of_max_height", () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1559,14 +1559,14 @@ test("margin_should_not_be_part_of_max_height", () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_should_not_be_part_of_max_width", () => { +test('margin_should_not_be_part_of_max_width', () => { const config = Yoga.Config.create(); let root; @@ -1584,7 +1584,7 @@ test("margin_should_not_be_part_of_max_width", () => { root_child0.setMaxWidth(100); root_child0.setHeight(100); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1596,7 +1596,7 @@ test("margin_should_not_be_part_of_max_width", () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1608,14 +1608,14 @@ test("margin_should_not_be_part_of_max_width", () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_auto_left_right_child_bigger_than_parent", () => { +test('margin_auto_left_right_child_bigger_than_parent', () => { const config = Yoga.Config.create(); let root; @@ -1634,7 +1634,7 @@ test("margin_auto_left_right_child_bigger_than_parent", () => { root_child0.setWidth(72); root_child0.setHeight(72); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1646,7 +1646,7 @@ test("margin_auto_left_right_child_bigger_than_parent", () => { expect(root_child0.getComputedWidth()).toBe(72); expect(root_child0.getComputedHeight()).toBe(72); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1658,14 +1658,14 @@ test("margin_auto_left_right_child_bigger_than_parent", () => { expect(root_child0.getComputedWidth()).toBe(72); expect(root_child0.getComputedHeight()).toBe(72); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_auto_left_child_bigger_than_parent", () => { +test('margin_auto_left_child_bigger_than_parent', () => { const config = Yoga.Config.create(); let root; @@ -1683,7 +1683,7 @@ test("margin_auto_left_child_bigger_than_parent", () => { root_child0.setWidth(72); root_child0.setHeight(72); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1695,7 +1695,7 @@ test("margin_auto_left_child_bigger_than_parent", () => { expect(root_child0.getComputedWidth()).toBe(72); expect(root_child0.getComputedHeight()).toBe(72); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1707,14 +1707,14 @@ test("margin_auto_left_child_bigger_than_parent", () => { expect(root_child0.getComputedWidth()).toBe(72); expect(root_child0.getComputedHeight()).toBe(72); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_fix_left_auto_right_child_bigger_than_parent", () => { +test('margin_fix_left_auto_right_child_bigger_than_parent', () => { const config = Yoga.Config.create(); let root; @@ -1733,7 +1733,7 @@ test("margin_fix_left_auto_right_child_bigger_than_parent", () => { root_child0.setWidth(72); root_child0.setHeight(72); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1745,7 +1745,7 @@ test("margin_fix_left_auto_right_child_bigger_than_parent", () => { expect(root_child0.getComputedWidth()).toBe(72); expect(root_child0.getComputedHeight()).toBe(72); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1757,14 +1757,14 @@ test("margin_fix_left_auto_right_child_bigger_than_parent", () => { expect(root_child0.getComputedWidth()).toBe(72); expect(root_child0.getComputedHeight()).toBe(72); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_auto_left_fix_right_child_bigger_than_parent", () => { +test('margin_auto_left_fix_right_child_bigger_than_parent', () => { const config = Yoga.Config.create(); let root; @@ -1783,7 +1783,7 @@ test("margin_auto_left_fix_right_child_bigger_than_parent", () => { root_child0.setWidth(72); root_child0.setHeight(72); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1795,7 +1795,7 @@ test("margin_auto_left_fix_right_child_bigger_than_parent", () => { expect(root_child0.getComputedWidth()).toBe(72); expect(root_child0.getComputedHeight()).toBe(72); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1807,14 +1807,14 @@ test("margin_auto_left_fix_right_child_bigger_than_parent", () => { expect(root_child0.getComputedWidth()).toBe(72); expect(root_child0.getComputedHeight()).toBe(72); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_auto_top_stretching_child", () => { +test('margin_auto_top_stretching_child', () => { const config = Yoga.Config.create(); let root; @@ -1838,7 +1838,7 @@ test("margin_auto_top_stretching_child", () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1855,7 +1855,7 @@ test("margin_auto_top_stretching_child", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1872,14 +1872,14 @@ test("margin_auto_top_stretching_child", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("margin_auto_left_stretching_child", () => { +test('margin_auto_left_stretching_child', () => { const config = Yoga.Config.create(); let root; @@ -1903,7 +1903,7 @@ test("margin_auto_left_stretching_child", () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1920,7 +1920,7 @@ test("margin_auto_left_stretching_child", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1937,7 +1937,7 @@ test("margin_auto_left_stretching_child", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } diff --git a/javascript/tests/generated/YGMinMaxDimensionTest.test.js b/javascript/tests/generated/YGMinMaxDimensionTest.test.js index 55fac642..9c4e961f 100644 --- a/javascript/tests/generated/YGMinMaxDimensionTest.test.js +++ b/javascript/tests/generated/YGMinMaxDimensionTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGMinMaxDimensionTest.html -test("max_width", () => { +test('max_width', () => { const config = Yoga.Config.create(); let root; @@ -23,7 +23,7 @@ test("max_width", () => { root_child0.setMaxWidth(50); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -35,7 +35,7 @@ test("max_width", () => { expect(root_child0.getComputedWidth()).toBe(50); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -47,14 +47,14 @@ test("max_width", () => { expect(root_child0.getComputedWidth()).toBe(50); expect(root_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("max_height", () => { +test('max_height', () => { const config = Yoga.Config.create(); let root; @@ -71,7 +71,7 @@ test("max_height", () => { root_child0.setWidth(10); root_child0.setMaxHeight(50); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -83,7 +83,7 @@ test("max_height", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -95,14 +95,137 @@ test("max_height", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("justify_content_min_max", () => { +test.skip('min_height', () => { + const config = Yoga.Config.create(); + let root; + + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + + try { + root = Yoga.Node.create(config); + root.setWidth(100); + root.setHeight(100); + + const root_child0 = Yoga.Node.create(config); + root_child0.setFlexGrow(1); + root_child0.setMinHeight(60); + root.insertChild(root_child0, 0); + + const root_child1 = Yoga.Node.create(config); + root_child1.setFlexGrow(1); + root.insertChild(root_child1, 1); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); + + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(60); + + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(60); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(40); + + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); + + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(100); + expect(root_child0.getComputedHeight()).toBe(60); + + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(60); + expect(root_child1.getComputedWidth()).toBe(100); + expect(root_child1.getComputedHeight()).toBe(40); + } finally { + if (typeof root !== 'undefined') { + root.freeRecursive(); + } + + config.free(); + } +}); +test.skip('min_width', () => { + const config = Yoga.Config.create(); + let root; + + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + + try { + root = Yoga.Node.create(config); + root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setWidth(100); + root.setHeight(100); + + const root_child0 = Yoga.Node.create(config); + root_child0.setFlexGrow(1); + root_child0.setMinWidth(60); + root.insertChild(root_child0, 0); + + const root_child1 = Yoga.Node.create(config); + root_child1.setFlexGrow(1); + root.insertChild(root_child1, 1); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); + + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(100); + + expect(root_child1.getComputedLeft()).toBe(60); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(40); + expect(root_child1.getComputedHeight()).toBe(100); + + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(100); + expect(root.getComputedHeight()).toBe(100); + + expect(root_child0.getComputedLeft()).toBe(40); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(60); + expect(root_child0.getComputedHeight()).toBe(100); + + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(0); + expect(root_child1.getComputedWidth()).toBe(40); + expect(root_child1.getComputedHeight()).toBe(100); + } finally { + if (typeof root !== 'undefined') { + root.freeRecursive(); + } + + config.free(); + } +}); +test('justify_content_min_max', () => { const config = Yoga.Config.create(); let root; @@ -120,7 +243,7 @@ test("justify_content_min_max", () => { root_child0.setWidth(60); root_child0.setHeight(60); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -132,7 +255,7 @@ test("justify_content_min_max", () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(60); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -144,14 +267,14 @@ test("justify_content_min_max", () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(60); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("align_items_min_max", () => { +test('align_items_min_max', () => { const config = Yoga.Config.create(); let root; @@ -169,7 +292,7 @@ test("align_items_min_max", () => { root_child0.setWidth(60); root_child0.setHeight(60); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -181,7 +304,7 @@ test("align_items_min_max", () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(60); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -193,14 +316,14 @@ test("align_items_min_max", () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(60); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("justify_content_overflow_min_max", () => { +test('justify_content_overflow_min_max', () => { const config = Yoga.Config.create(); let root; @@ -227,7 +350,7 @@ test("justify_content_overflow_min_max", () => { root_child2.setWidth(50); root_child2.setHeight(50); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -249,7 +372,7 @@ test("justify_content_overflow_min_max", () => { expect(root_child2.getComputedWidth()).toBe(50); expect(root_child2.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -271,14 +394,14 @@ test("justify_content_overflow_min_max", () => { expect(root_child2.getComputedWidth()).toBe(50); expect(root_child2.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_grow_to_min", () => { +test('flex_grow_to_min', () => { const config = Yoga.Config.create(); let root; @@ -299,7 +422,7 @@ test("flex_grow_to_min", () => { const root_child1 = Yoga.Node.create(config); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -316,7 +439,7 @@ test("flex_grow_to_min", () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -333,14 +456,14 @@ test("flex_grow_to_min", () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_grow_in_at_most_container", () => { +test('flex_grow_in_at_most_container', () => { const config = Yoga.Config.create(); let root; @@ -362,7 +485,7 @@ test("flex_grow_in_at_most_container", () => { root_child0_child0.setFlexGrow(1); root_child0_child0.setFlexBasis(0); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -379,7 +502,7 @@ test("flex_grow_in_at_most_container", () => { expect(root_child0_child0.getComputedWidth()).toBe(0); expect(root_child0_child0.getComputedHeight()).toBe(0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -396,14 +519,14 @@ test("flex_grow_in_at_most_container", () => { expect(root_child0_child0.getComputedWidth()).toBe(0); expect(root_child0_child0.getComputedHeight()).toBe(0); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_grow_child", () => { +test('flex_grow_child', () => { const config = Yoga.Config.create(); let root; @@ -419,7 +542,7 @@ test("flex_grow_child", () => { root_child0.setFlexBasis(0); root_child0.setHeight(100); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -431,7 +554,7 @@ test("flex_grow_child", () => { expect(root_child0.getComputedWidth()).toBe(0); expect(root_child0.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -443,14 +566,14 @@ test("flex_grow_child", () => { expect(root_child0.getComputedWidth()).toBe(0); expect(root_child0.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_grow_within_constrained_min_max_column", () => { +test('flex_grow_within_constrained_min_max_column', () => { const config = Yoga.Config.create(); let root; @@ -469,7 +592,7 @@ test("flex_grow_within_constrained_min_max_column", () => { const root_child1 = Yoga.Node.create(config); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -486,7 +609,7 @@ test("flex_grow_within_constrained_min_max_column", () => { expect(root_child1.getComputedWidth()).toBe(0); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -503,14 +626,14 @@ test("flex_grow_within_constrained_min_max_column", () => { expect(root_child1.getComputedWidth()).toBe(0); expect(root_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_grow_within_max_width", () => { +test('flex_grow_within_max_width', () => { const config = Yoga.Config.create(); let root; @@ -531,7 +654,7 @@ test("flex_grow_within_max_width", () => { root_child0_child0.setFlexGrow(1); root_child0_child0.setHeight(20); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -548,7 +671,7 @@ test("flex_grow_within_max_width", () => { expect(root_child0_child0.getComputedWidth()).toBe(100); expect(root_child0_child0.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -565,14 +688,14 @@ test("flex_grow_within_max_width", () => { expect(root_child0_child0.getComputedWidth()).toBe(100); expect(root_child0_child0.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_grow_within_constrained_max_width", () => { +test('flex_grow_within_constrained_max_width', () => { const config = Yoga.Config.create(); let root; @@ -593,7 +716,7 @@ test("flex_grow_within_constrained_max_width", () => { root_child0_child0.setFlexGrow(1); root_child0_child0.setHeight(20); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -610,7 +733,7 @@ test("flex_grow_within_constrained_max_width", () => { expect(root_child0_child0.getComputedWidth()).toBe(200); expect(root_child0_child0.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -627,14 +750,14 @@ test("flex_grow_within_constrained_max_width", () => { expect(root_child0_child0.getComputedWidth()).toBe(200); expect(root_child0_child0.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_root_ignored", () => { +test('flex_root_ignored', () => { const config = Yoga.Config.create(); let root; @@ -656,7 +779,7 @@ test("flex_root_ignored", () => { const root_child1 = Yoga.Node.create(config); root_child1.setHeight(100); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -673,7 +796,7 @@ test("flex_root_ignored", () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -690,14 +813,14 @@ test("flex_root_ignored", () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_grow_root_minimized", () => { +test('flex_grow_root_minimized', () => { const config = Yoga.Config.create(); let root; @@ -724,7 +847,7 @@ test("flex_grow_root_minimized", () => { const root_child0_child1 = Yoga.Node.create(config); root_child0_child1.setHeight(100); root_child0.insertChild(root_child0_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -746,7 +869,7 @@ test("flex_grow_root_minimized", () => { expect(root_child0_child1.getComputedWidth()).toBe(100); expect(root_child0_child1.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -768,14 +891,14 @@ test("flex_grow_root_minimized", () => { expect(root_child0_child1.getComputedWidth()).toBe(100); expect(root_child0_child1.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_grow_height_maximized", () => { +test('flex_grow_height_maximized', () => { const config = Yoga.Config.create(); let root; @@ -801,7 +924,7 @@ test("flex_grow_height_maximized", () => { const root_child0_child1 = Yoga.Node.create(config); root_child0_child1.setHeight(100); root_child0.insertChild(root_child0_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -823,7 +946,7 @@ test("flex_grow_height_maximized", () => { expect(root_child0_child1.getComputedWidth()).toBe(100); expect(root_child0_child1.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -845,14 +968,14 @@ test("flex_grow_height_maximized", () => { expect(root_child0_child1.getComputedWidth()).toBe(100); expect(root_child0_child1.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_grow_within_constrained_min_row", () => { +test('flex_grow_within_constrained_min_row', () => { const config = Yoga.Config.create(); let root; @@ -872,7 +995,7 @@ test("flex_grow_within_constrained_min_row", () => { const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -889,7 +1012,7 @@ test("flex_grow_within_constrained_min_row", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -906,14 +1029,14 @@ test("flex_grow_within_constrained_min_row", () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_grow_within_constrained_min_column", () => { +test('flex_grow_within_constrained_min_column', () => { const config = Yoga.Config.create(); let root; @@ -931,7 +1054,7 @@ test("flex_grow_within_constrained_min_column", () => { const root_child1 = Yoga.Node.create(config); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -948,7 +1071,7 @@ test("flex_grow_within_constrained_min_column", () => { expect(root_child1.getComputedWidth()).toBe(0); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -965,14 +1088,14 @@ test("flex_grow_within_constrained_min_column", () => { expect(root_child1.getComputedWidth()).toBe(0); expect(root_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_grow_within_constrained_max_row", () => { +test('flex_grow_within_constrained_max_row', () => { const config = Yoga.Config.create(); let root; @@ -997,7 +1120,7 @@ test("flex_grow_within_constrained_max_row", () => { const root_child0_child1 = Yoga.Node.create(config); root_child0_child1.setWidth(50); root_child0.insertChild(root_child0_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1019,7 +1142,7 @@ test("flex_grow_within_constrained_max_row", () => { expect(root_child0_child1.getComputedWidth()).toBe(50); expect(root_child0_child1.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1041,14 +1164,14 @@ test("flex_grow_within_constrained_max_row", () => { expect(root_child0_child1.getComputedWidth()).toBe(50); expect(root_child0_child1.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("flex_grow_within_constrained_max_column", () => { +test('flex_grow_within_constrained_max_column', () => { const config = Yoga.Config.create(); let root; @@ -1068,7 +1191,7 @@ test("flex_grow_within_constrained_max_column", () => { const root_child1 = Yoga.Node.create(config); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1085,7 +1208,7 @@ test("flex_grow_within_constrained_max_column", () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1102,14 +1225,14 @@ test("flex_grow_within_constrained_max_column", () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("child_min_max_width_flexing", () => { +test('child_min_max_width_flexing', () => { const config = Yoga.Config.create(); let root; @@ -1133,7 +1256,7 @@ test("child_min_max_width_flexing", () => { root_child1.setFlexBasis("50%"); root_child1.setMaxWidth(20); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1150,7 +1273,7 @@ test("child_min_max_width_flexing", () => { expect(root_child1.getComputedWidth()).toBe(20); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1167,14 +1290,14 @@ test("child_min_max_width_flexing", () => { expect(root_child1.getComputedWidth()).toBe(20); expect(root_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("min_width_overrides_width", () => { +test('min_width_overrides_width', () => { const config = Yoga.Config.create(); let root; @@ -1185,28 +1308,28 @@ test("min_width_overrides_width", () => { root = Yoga.Node.create(config); root.setWidth(50); root.setMinWidth(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(0); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("max_width_overrides_width", () => { +test('max_width_overrides_width', () => { const config = Yoga.Config.create(); let root; @@ -1217,28 +1340,28 @@ test("max_width_overrides_width", () => { root = Yoga.Node.create(config); root.setWidth(200); root.setMaxWidth(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(0); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("min_height_overrides_height", () => { +test('min_height_overrides_height', () => { const config = Yoga.Config.create(); let root; @@ -1249,28 +1372,28 @@ test("min_height_overrides_height", () => { root = Yoga.Node.create(config); root.setHeight(50); root.setMinHeight(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); expect(root.getComputedWidth()).toBe(0); expect(root.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); expect(root.getComputedWidth()).toBe(0); expect(root.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("max_height_overrides_height", () => { +test('max_height_overrides_height', () => { const config = Yoga.Config.create(); let root; @@ -1281,28 +1404,28 @@ test("max_height_overrides_height", () => { root = Yoga.Node.create(config); root.setHeight(200); root.setMaxHeight(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); expect(root.getComputedWidth()).toBe(0); expect(root.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); expect(root.getComputedWidth()).toBe(0); expect(root.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("min_max_percent_no_width_height", () => { +test('min_max_percent_no_width_height', () => { const config = Yoga.Config.create(); let root; @@ -1321,7 +1444,7 @@ test("min_max_percent_no_width_height", () => { root_child0.setMinHeight("10%"); root_child0.setMaxHeight("10%"); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1333,7 +1456,7 @@ test("min_max_percent_no_width_height", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1345,7 +1468,7 @@ test("min_max_percent_no_width_height", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } diff --git a/javascript/tests/generated/YGPaddingTest.test.js b/javascript/tests/generated/YGPaddingTest.test.js index 5d03d3d4..989fbecc 100644 --- a/javascript/tests/generated/YGPaddingTest.test.js +++ b/javascript/tests/generated/YGPaddingTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGPaddingTest.html -test("padding_no_size", () => { +test('padding_no_size', () => { const config = Yoga.Config.create(); let root; @@ -20,28 +20,28 @@ test("padding_no_size", () => { root.setPadding(Yoga.EDGE_TOP, 10); root.setPadding(Yoga.EDGE_RIGHT, 10); root.setPadding(Yoga.EDGE_BOTTOM, 10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); expect(root.getComputedWidth()).toBe(20); expect(root.getComputedHeight()).toBe(20); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); expect(root.getComputedWidth()).toBe(20); expect(root.getComputedHeight()).toBe(20); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("padding_container_match_child", () => { +test('padding_container_match_child', () => { const config = Yoga.Config.create(); let root; @@ -59,7 +59,7 @@ test("padding_container_match_child", () => { root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -71,7 +71,7 @@ test("padding_container_match_child", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -83,14 +83,14 @@ test("padding_container_match_child", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("padding_flex_child", () => { +test('padding_flex_child', () => { const config = Yoga.Config.create(); let root; @@ -110,7 +110,7 @@ test("padding_flex_child", () => { root_child0.setFlexGrow(1); root_child0.setWidth(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -122,7 +122,7 @@ test("padding_flex_child", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(80); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -134,14 +134,14 @@ test("padding_flex_child", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(80); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("padding_stretch_child", () => { +test('padding_stretch_child', () => { const config = Yoga.Config.create(); let root; @@ -160,7 +160,7 @@ test("padding_stretch_child", () => { const root_child0 = Yoga.Node.create(config); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -172,7 +172,7 @@ test("padding_stretch_child", () => { expect(root_child0.getComputedWidth()).toBe(80); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -184,14 +184,14 @@ test("padding_stretch_child", () => { expect(root_child0.getComputedWidth()).toBe(80); expect(root_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("padding_center_child", () => { +test('padding_center_child', () => { const config = Yoga.Config.create(); let root; @@ -212,7 +212,7 @@ test("padding_center_child", () => { root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -224,7 +224,7 @@ test("padding_center_child", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -236,14 +236,14 @@ test("padding_center_child", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("child_with_padding_align_end", () => { +test('child_with_padding_align_end', () => { const config = Yoga.Config.create(); let root; @@ -265,7 +265,7 @@ test("child_with_padding_align_end", () => { root_child0.setWidth(100); root_child0.setHeight(100); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -277,7 +277,7 @@ test("child_with_padding_align_end", () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -289,7 +289,7 @@ test("child_with_padding_align_end", () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } diff --git a/javascript/tests/generated/YGPercentageTest.test.js b/javascript/tests/generated/YGPercentageTest.test.js index 6682442a..2cd38aad 100644 --- a/javascript/tests/generated/YGPercentageTest.test.js +++ b/javascript/tests/generated/YGPercentageTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGPercentageTest.html -test("percentage_width_height", () => { +test('percentage_width_height', () => { const config = Yoga.Config.create(); let root; @@ -24,7 +24,7 @@ test("percentage_width_height", () => { root_child0.setWidth("30%"); root_child0.setHeight("30%"); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -36,7 +36,7 @@ test("percentage_width_height", () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(60); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -48,14 +48,14 @@ test("percentage_width_height", () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(60); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("percentage_position_left_top", () => { +test('percentage_position_left_top', () => { const config = Yoga.Config.create(); let root; @@ -74,7 +74,7 @@ test("percentage_position_left_top", () => { root_child0.setWidth("45%"); root_child0.setHeight("55%"); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -86,7 +86,7 @@ test("percentage_position_left_top", () => { expect(root_child0.getComputedWidth()).toBe(180); expect(root_child0.getComputedHeight()).toBe(220); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -98,14 +98,14 @@ test("percentage_position_left_top", () => { expect(root_child0.getComputedWidth()).toBe(180); expect(root_child0.getComputedHeight()).toBe(220); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("percentage_position_bottom_right", () => { +test('percentage_position_bottom_right', () => { const config = Yoga.Config.create(); let root; @@ -124,7 +124,7 @@ test("percentage_position_bottom_right", () => { root_child0.setWidth("55%"); root_child0.setHeight("15%"); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -136,7 +136,7 @@ test("percentage_position_bottom_right", () => { expect(root_child0.getComputedWidth()).toBe(275); expect(root_child0.getComputedHeight()).toBe(75); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -148,14 +148,14 @@ test("percentage_position_bottom_right", () => { expect(root_child0.getComputedWidth()).toBe(275); expect(root_child0.getComputedHeight()).toBe(75); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("percentage_flex_basis", () => { +test('percentage_flex_basis', () => { const config = Yoga.Config.create(); let root; @@ -177,7 +177,7 @@ test("percentage_flex_basis", () => { root_child1.setFlexGrow(1); root_child1.setFlexBasis("25%"); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -194,7 +194,7 @@ test("percentage_flex_basis", () => { expect(root_child1.getComputedWidth()).toBe(75); expect(root_child1.getComputedHeight()).toBe(200); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -211,14 +211,14 @@ test("percentage_flex_basis", () => { expect(root_child1.getComputedWidth()).toBe(75); expect(root_child1.getComputedHeight()).toBe(200); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("percentage_flex_basis_cross", () => { +test('percentage_flex_basis_cross', () => { const config = Yoga.Config.create(); let root; @@ -239,7 +239,7 @@ test("percentage_flex_basis_cross", () => { root_child1.setFlexGrow(1); root_child1.setFlexBasis("25%"); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -256,7 +256,7 @@ test("percentage_flex_basis_cross", () => { expect(root_child1.getComputedWidth()).toBe(200); expect(root_child1.getComputedHeight()).toBe(75); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -273,14 +273,76 @@ test("percentage_flex_basis_cross", () => { expect(root_child1.getComputedWidth()).toBe(200); expect(root_child1.getComputedHeight()).toBe(75); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("percentage_flex_basis_main_max_height", () => { +test.skip('percentage_flex_basis_cross_min_height', () => { + const config = Yoga.Config.create(); + let root; + + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); + config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + + try { + root = Yoga.Node.create(config); + root.setWidth(200); + root.setHeight(200); + + const root_child0 = Yoga.Node.create(config); + root_child0.setFlexGrow(1); + root_child0.setMinHeight("60%"); + root.insertChild(root_child0, 0); + + const root_child1 = Yoga.Node.create(config); + root_child1.setFlexGrow(2); + root_child1.setMinHeight("10%"); + root.insertChild(root_child1, 1); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); + + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(200); + expect(root_child0.getComputedHeight()).toBe(120); + + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(120); + expect(root_child1.getComputedWidth()).toBe(200); + expect(root_child1.getComputedHeight()).toBe(80); + + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + + expect(root.getComputedLeft()).toBe(0); + expect(root.getComputedTop()).toBe(0); + expect(root.getComputedWidth()).toBe(200); + expect(root.getComputedHeight()).toBe(200); + + expect(root_child0.getComputedLeft()).toBe(0); + expect(root_child0.getComputedTop()).toBe(0); + expect(root_child0.getComputedWidth()).toBe(200); + expect(root_child0.getComputedHeight()).toBe(120); + + expect(root_child1.getComputedLeft()).toBe(0); + expect(root_child1.getComputedTop()).toBe(120); + expect(root_child1.getComputedWidth()).toBe(200); + expect(root_child1.getComputedHeight()).toBe(80); + } finally { + if (typeof root !== 'undefined') { + root.freeRecursive(); + } + + config.free(); + } +}); +test('percentage_flex_basis_main_max_height', () => { const config = Yoga.Config.create(); let root; @@ -304,7 +366,7 @@ test("percentage_flex_basis_main_max_height", () => { root_child1.setFlexBasis("10%"); root_child1.setMaxHeight("20%"); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -321,7 +383,7 @@ test("percentage_flex_basis_main_max_height", () => { expect(root_child1.getComputedWidth()).toBe(148); expect(root_child1.getComputedHeight()).toBe(40); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -338,14 +400,14 @@ test("percentage_flex_basis_main_max_height", () => { expect(root_child1.getComputedWidth()).toBe(148); expect(root_child1.getComputedHeight()).toBe(40); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("percentage_flex_basis_cross_max_height", () => { +test('percentage_flex_basis_cross_max_height', () => { const config = Yoga.Config.create(); let root; @@ -368,7 +430,7 @@ test("percentage_flex_basis_cross_max_height", () => { root_child1.setFlexBasis("10%"); root_child1.setMaxHeight("20%"); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -385,7 +447,7 @@ test("percentage_flex_basis_cross_max_height", () => { expect(root_child1.getComputedWidth()).toBe(200); expect(root_child1.getComputedHeight()).toBe(40); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -402,14 +464,14 @@ test("percentage_flex_basis_cross_max_height", () => { expect(root_child1.getComputedWidth()).toBe(200); expect(root_child1.getComputedHeight()).toBe(40); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("percentage_flex_basis_main_max_width", () => { +test('percentage_flex_basis_main_max_width', () => { const config = Yoga.Config.create(); let root; @@ -433,7 +495,7 @@ test("percentage_flex_basis_main_max_width", () => { root_child1.setFlexBasis("10%"); root_child1.setMaxWidth("20%"); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -450,7 +512,7 @@ test("percentage_flex_basis_main_max_width", () => { expect(root_child1.getComputedWidth()).toBe(40); expect(root_child1.getComputedHeight()).toBe(200); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -467,14 +529,14 @@ test("percentage_flex_basis_main_max_width", () => { expect(root_child1.getComputedWidth()).toBe(40); expect(root_child1.getComputedHeight()).toBe(200); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("percentage_flex_basis_cross_max_width", () => { +test('percentage_flex_basis_cross_max_width', () => { const config = Yoga.Config.create(); let root; @@ -497,7 +559,7 @@ test("percentage_flex_basis_cross_max_width", () => { root_child1.setFlexBasis("15%"); root_child1.setMaxWidth("20%"); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -514,7 +576,7 @@ test("percentage_flex_basis_cross_max_width", () => { expect(root_child1.getComputedWidth()).toBe(40); expect(root_child1.getComputedHeight()).toBe(150); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -531,14 +593,14 @@ test("percentage_flex_basis_cross_max_width", () => { expect(root_child1.getComputedWidth()).toBe(40); expect(root_child1.getComputedHeight()).toBe(150); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("percentage_flex_basis_main_min_width", () => { +test('percentage_flex_basis_main_min_width', () => { const config = Yoga.Config.create(); let root; @@ -562,7 +624,7 @@ test("percentage_flex_basis_main_min_width", () => { root_child1.setFlexBasis("10%"); root_child1.setMinWidth("20%"); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -579,7 +641,7 @@ test("percentage_flex_basis_main_min_width", () => { expect(root_child1.getComputedWidth()).toBe(80); expect(root_child1.getComputedHeight()).toBe(200); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -596,14 +658,14 @@ test("percentage_flex_basis_main_min_width", () => { expect(root_child1.getComputedWidth()).toBe(80); expect(root_child1.getComputedHeight()).toBe(200); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("percentage_flex_basis_cross_min_width", () => { +test('percentage_flex_basis_cross_min_width', () => { const config = Yoga.Config.create(); let root; @@ -626,7 +688,7 @@ test("percentage_flex_basis_cross_min_width", () => { root_child1.setFlexBasis("15%"); root_child1.setMinWidth("20%"); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -643,7 +705,7 @@ test("percentage_flex_basis_cross_min_width", () => { expect(root_child1.getComputedWidth()).toBe(200); expect(root_child1.getComputedHeight()).toBe(150); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -660,14 +722,14 @@ test("percentage_flex_basis_cross_min_width", () => { expect(root_child1.getComputedWidth()).toBe(200); expect(root_child1.getComputedHeight()).toBe(150); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("percentage_multiple_nested_with_padding_margin_and_percentage_values", () => { +test('percentage_multiple_nested_with_padding_margin_and_percentage_values', () => { const config = Yoga.Config.create(); let root; @@ -722,7 +784,7 @@ test("percentage_multiple_nested_with_padding_margin_and_percentage_values", () root_child1.setFlexBasis("15%"); root_child1.setMinWidth("20%"); root.insertChild(root_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -749,7 +811,7 @@ test("percentage_multiple_nested_with_padding_margin_and_percentage_values", () expect(root_child1.getComputedWidth()).toBe(200); expect(root_child1.getComputedHeight()).toBe(142); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -776,14 +838,14 @@ test("percentage_multiple_nested_with_padding_margin_and_percentage_values", () expect(root_child1.getComputedWidth()).toBe(200); expect(root_child1.getComputedHeight()).toBe(142); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("percentage_margin_should_calculate_based_only_on_width", () => { +test('percentage_margin_should_calculate_based_only_on_width', () => { const config = Yoga.Config.create(); let root; @@ -807,7 +869,7 @@ test("percentage_margin_should_calculate_based_only_on_width", () => { root_child0_child0.setWidth(10); root_child0_child0.setHeight(10); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -824,7 +886,7 @@ test("percentage_margin_should_calculate_based_only_on_width", () => { expect(root_child0_child0.getComputedWidth()).toBe(10); expect(root_child0_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -841,14 +903,14 @@ test("percentage_margin_should_calculate_based_only_on_width", () => { expect(root_child0_child0.getComputedWidth()).toBe(10); expect(root_child0_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("percentage_padding_should_calculate_based_only_on_width", () => { +test('percentage_padding_should_calculate_based_only_on_width', () => { const config = Yoga.Config.create(); let root; @@ -872,7 +934,7 @@ test("percentage_padding_should_calculate_based_only_on_width", () => { root_child0_child0.setWidth(10); root_child0_child0.setHeight(10); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -889,7 +951,7 @@ test("percentage_padding_should_calculate_based_only_on_width", () => { expect(root_child0_child0.getComputedWidth()).toBe(10); expect(root_child0_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -906,14 +968,14 @@ test("percentage_padding_should_calculate_based_only_on_width", () => { expect(root_child0_child0.getComputedWidth()).toBe(10); expect(root_child0_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("percentage_absolute_position", () => { +test('percentage_absolute_position', () => { const config = Yoga.Config.create(); let root; @@ -932,7 +994,7 @@ test("percentage_absolute_position", () => { root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -944,7 +1006,7 @@ test("percentage_absolute_position", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -956,14 +1018,14 @@ test("percentage_absolute_position", () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("percentage_width_height_undefined_parent_size", () => { +test('percentage_width_height_undefined_parent_size', () => { const config = Yoga.Config.create(); let root; @@ -977,7 +1039,7 @@ test("percentage_width_height_undefined_parent_size", () => { root_child0.setWidth("50%"); root_child0.setHeight("50%"); root.insertChild(root_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -989,7 +1051,7 @@ test("percentage_width_height_undefined_parent_size", () => { expect(root_child0.getComputedWidth()).toBe(0); expect(root_child0.getComputedHeight()).toBe(0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1001,14 +1063,14 @@ test("percentage_width_height_undefined_parent_size", () => { expect(root_child0.getComputedWidth()).toBe(0); expect(root_child0.getComputedHeight()).toBe(0); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("percent_within_flex_grow", () => { +test('percent_within_flex_grow', () => { const config = Yoga.Config.create(); let root; @@ -1036,7 +1098,7 @@ test("percent_within_flex_grow", () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(100); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1063,7 +1125,7 @@ test("percent_within_flex_grow", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1090,14 +1152,14 @@ test("percent_within_flex_grow", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("percentage_container_in_wrapping_container", () => { +test('percentage_container_in_wrapping_container', () => { const config = Yoga.Config.create(); let root; @@ -1129,7 +1191,7 @@ test("percentage_container_in_wrapping_container", () => { root_child0_child0_child1.setWidth(50); root_child0_child0_child1.setHeight(50); root_child0_child0.insertChild(root_child0_child0_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1156,7 +1218,7 @@ test("percentage_container_in_wrapping_container", () => { expect(root_child0_child0_child1.getComputedWidth()).toBe(50); expect(root_child0_child0_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1183,14 +1245,14 @@ test("percentage_container_in_wrapping_container", () => { expect(root_child0_child0_child1.getComputedWidth()).toBe(50); expect(root_child0_child0_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("percent_absolute_position", () => { +test('percent_absolute_position', () => { const config = Yoga.Config.create(); let root; @@ -1217,7 +1279,7 @@ test("percent_absolute_position", () => { const root_child0_child1 = Yoga.Node.create(config); root_child0_child1.setWidth("100%"); root_child0.insertChild(root_child0_child1, 1); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1239,7 +1301,7 @@ test("percent_absolute_position", () => { expect(root_child0_child1.getComputedWidth()).toBe(60); expect(root_child0_child1.getComputedHeight()).toBe(50); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1261,7 +1323,7 @@ test("percent_absolute_position", () => { expect(root_child0_child1.getComputedWidth()).toBe(60); expect(root_child0_child1.getComputedHeight()).toBe(50); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } diff --git a/javascript/tests/generated/YGRoundingTest.test.js b/javascript/tests/generated/YGRoundingTest.test.js index 33a1a2d2..a4932d3e 100644 --- a/javascript/tests/generated/YGRoundingTest.test.js +++ b/javascript/tests/generated/YGRoundingTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGRoundingTest.html -test("rounding_flex_basis_flex_grow_row_width_of_100", () => { +test('rounding_flex_basis_flex_grow_row_width_of_100', () => { const config = Yoga.Config.create(); let root; @@ -31,7 +31,7 @@ test("rounding_flex_basis_flex_grow_row_width_of_100", () => { const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(1); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -53,7 +53,7 @@ test("rounding_flex_basis_flex_grow_row_width_of_100", () => { expect(root_child2.getComputedWidth()).toBe(33); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -75,14 +75,14 @@ test("rounding_flex_basis_flex_grow_row_width_of_100", () => { expect(root_child2.getComputedWidth()).toBe(33); expect(root_child2.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("rounding_flex_basis_flex_grow_row_prime_number_width", () => { +test('rounding_flex_basis_flex_grow_row_prime_number_width', () => { const config = Yoga.Config.create(); let root; @@ -114,7 +114,7 @@ test("rounding_flex_basis_flex_grow_row_prime_number_width", () => { const root_child4 = Yoga.Node.create(config); root_child4.setFlexGrow(1); root.insertChild(root_child4, 4); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -146,7 +146,7 @@ test("rounding_flex_basis_flex_grow_row_prime_number_width", () => { expect(root_child4.getComputedWidth()).toBe(23); expect(root_child4.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -178,14 +178,14 @@ test("rounding_flex_basis_flex_grow_row_prime_number_width", () => { expect(root_child4.getComputedWidth()).toBe(23); expect(root_child4.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("rounding_flex_basis_flex_shrink_row", () => { +test('rounding_flex_basis_flex_shrink_row', () => { const config = Yoga.Config.create(); let root; @@ -210,7 +210,7 @@ test("rounding_flex_basis_flex_shrink_row", () => { const root_child2 = Yoga.Node.create(config); root_child2.setFlexBasis(25); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -232,7 +232,7 @@ test("rounding_flex_basis_flex_shrink_row", () => { expect(root_child2.getComputedWidth()).toBe(25); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -254,14 +254,14 @@ test("rounding_flex_basis_flex_shrink_row", () => { expect(root_child2.getComputedWidth()).toBe(25); expect(root_child2.getComputedHeight()).toBe(100); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("rounding_flex_basis_overrides_main_size", () => { +test('rounding_flex_basis_overrides_main_size', () => { const config = Yoga.Config.create(); let root; @@ -288,7 +288,7 @@ test("rounding_flex_basis_overrides_main_size", () => { root_child2.setFlexGrow(1); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -310,7 +310,7 @@ test("rounding_flex_basis_overrides_main_size", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(24); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -332,14 +332,14 @@ test("rounding_flex_basis_overrides_main_size", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(24); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("rounding_total_fractial", () => { +test('rounding_total_fractial', () => { const config = Yoga.Config.create(); let root; @@ -366,7 +366,7 @@ test("rounding_total_fractial", () => { root_child2.setFlexGrow(1.1); root_child2.setHeight(10.7); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -388,7 +388,7 @@ test("rounding_total_fractial", () => { expect(root_child2.getComputedWidth()).toBe(87); expect(root_child2.getComputedHeight()).toBe(24); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -410,14 +410,14 @@ test("rounding_total_fractial", () => { expect(root_child2.getComputedWidth()).toBe(87); expect(root_child2.getComputedHeight()).toBe(24); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("rounding_total_fractial_nested", () => { +test('rounding_total_fractial_nested', () => { const config = Yoga.Config.create(); let root; @@ -458,7 +458,7 @@ test("rounding_total_fractial_nested", () => { root_child2.setFlexGrow(1.1); root_child2.setHeight(10.7); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -490,7 +490,7 @@ test("rounding_total_fractial_nested", () => { expect(root_child2.getComputedWidth()).toBe(87); expect(root_child2.getComputedHeight()).toBe(24); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -522,14 +522,14 @@ test("rounding_total_fractial_nested", () => { expect(root_child2.getComputedWidth()).toBe(87); expect(root_child2.getComputedHeight()).toBe(24); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("rounding_fractial_input_1", () => { +test('rounding_fractial_input_1', () => { const config = Yoga.Config.create(); let root; @@ -556,7 +556,7 @@ test("rounding_fractial_input_1", () => { root_child2.setFlexGrow(1); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -578,7 +578,7 @@ test("rounding_fractial_input_1", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(24); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -600,14 +600,14 @@ test("rounding_fractial_input_1", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(24); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("rounding_fractial_input_2", () => { +test('rounding_fractial_input_2', () => { const config = Yoga.Config.create(); let root; @@ -634,7 +634,7 @@ test("rounding_fractial_input_2", () => { root_child2.setFlexGrow(1); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -656,7 +656,7 @@ test("rounding_fractial_input_2", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(25); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -678,14 +678,14 @@ test("rounding_fractial_input_2", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(25); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("rounding_fractial_input_3", () => { +test('rounding_fractial_input_3', () => { const config = Yoga.Config.create(); let root; @@ -713,7 +713,7 @@ test("rounding_fractial_input_3", () => { root_child2.setFlexGrow(1); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -735,7 +735,7 @@ test("rounding_fractial_input_3", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(25); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -757,14 +757,14 @@ test("rounding_fractial_input_3", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(25); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("rounding_fractial_input_4", () => { +test('rounding_fractial_input_4', () => { const config = Yoga.Config.create(); let root; @@ -792,7 +792,7 @@ test("rounding_fractial_input_4", () => { root_child2.setFlexGrow(1); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(1); @@ -814,7 +814,7 @@ test("rounding_fractial_input_4", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(24); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(1); @@ -836,14 +836,14 @@ test("rounding_fractial_input_4", () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(24); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("rounding_inner_node_controversy_horizontal", () => { +test('rounding_inner_node_controversy_horizontal', () => { const config = Yoga.Config.create(); let root; @@ -874,7 +874,7 @@ test("rounding_inner_node_controversy_horizontal", () => { root_child2.setFlexGrow(1); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -901,7 +901,7 @@ test("rounding_inner_node_controversy_horizontal", () => { expect(root_child2.getComputedWidth()).toBe(107); expect(root_child2.getComputedHeight()).toBe(10); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -928,14 +928,14 @@ test("rounding_inner_node_controversy_horizontal", () => { expect(root_child2.getComputedWidth()).toBe(107); expect(root_child2.getComputedHeight()).toBe(10); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("rounding_inner_node_controversy_vertical", () => { +test('rounding_inner_node_controversy_vertical', () => { const config = Yoga.Config.create(); let root; @@ -965,7 +965,7 @@ test("rounding_inner_node_controversy_vertical", () => { root_child2.setFlexGrow(1); root_child2.setWidth(10); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -992,7 +992,7 @@ test("rounding_inner_node_controversy_vertical", () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(107); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1019,14 +1019,14 @@ test("rounding_inner_node_controversy_vertical", () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(107); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("rounding_inner_node_controversy_combined", () => { +test('rounding_inner_node_controversy_combined', () => { const config = Yoga.Config.create(); let root; @@ -1073,7 +1073,7 @@ test("rounding_inner_node_controversy_combined", () => { root_child2.setFlexGrow(1); root_child2.setHeight("100%"); root.insertChild(root_child2, 2); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1115,7 +1115,7 @@ test("rounding_inner_node_controversy_combined", () => { expect(root_child2.getComputedWidth()).toBe(213); expect(root_child2.getComputedHeight()).toBe(320); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1157,7 +1157,7 @@ test("rounding_inner_node_controversy_combined", () => { expect(root_child2.getComputedWidth()).toBe(213); expect(root_child2.getComputedHeight()).toBe(320); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } diff --git a/javascript/tests/generated/YGSizeOverflowTest.test.js b/javascript/tests/generated/YGSizeOverflowTest.test.js index c8d4e802..e9546012 100644 --- a/javascript/tests/generated/YGSizeOverflowTest.test.js +++ b/javascript/tests/generated/YGSizeOverflowTest.test.js @@ -7,7 +7,7 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGSizeOverflowTest.html -test("nested_overflowing_child", () => { +test('nested_overflowing_child', () => { const config = Yoga.Config.create(); let root; @@ -26,7 +26,7 @@ test("nested_overflowing_child", () => { root_child0_child0.setWidth(200); root_child0_child0.setHeight(200); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -43,7 +43,7 @@ test("nested_overflowing_child", () => { expect(root_child0_child0.getComputedWidth()).toBe(200); expect(root_child0_child0.getComputedHeight()).toBe(200); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -60,14 +60,14 @@ test("nested_overflowing_child", () => { expect(root_child0_child0.getComputedWidth()).toBe(200); expect(root_child0_child0.getComputedHeight()).toBe(200); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("nested_overflowing_child_in_constraint_parent", () => { +test('nested_overflowing_child_in_constraint_parent', () => { const config = Yoga.Config.create(); let root; @@ -88,7 +88,7 @@ test("nested_overflowing_child_in_constraint_parent", () => { root_child0_child0.setWidth(200); root_child0_child0.setHeight(200); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -105,7 +105,7 @@ test("nested_overflowing_child_in_constraint_parent", () => { expect(root_child0_child0.getComputedWidth()).toBe(200); expect(root_child0_child0.getComputedHeight()).toBe(200); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -122,14 +122,14 @@ test("nested_overflowing_child_in_constraint_parent", () => { expect(root_child0_child0.getComputedWidth()).toBe(200); expect(root_child0_child0.getComputedHeight()).toBe(200); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } config.free(); } }); -test("parent_wrap_child_size_overflowing_parent", () => { +test('parent_wrap_child_size_overflowing_parent', () => { const config = Yoga.Config.create(); let root; @@ -149,7 +149,7 @@ test("parent_wrap_child_size_overflowing_parent", () => { root_child0_child0.setWidth(100); root_child0_child0.setHeight(200); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -166,7 +166,7 @@ test("parent_wrap_child_size_overflowing_parent", () => { expect(root_child0_child0.getComputedWidth()).toBe(100); expect(root_child0_child0.getComputedHeight()).toBe(200); - root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -183,7 +183,7 @@ test("parent_wrap_child_size_overflowing_parent", () => { expect(root_child0_child0.getComputedWidth()).toBe(100); expect(root_child0_child0.getComputedHeight()).toBe(200); } finally { - if (typeof root !== "undefined") { + if (typeof root !== 'undefined') { root.freeRecursive(); } diff --git a/tests/generated/YGAlignItemsTest.cpp b/tests/generated/YGAlignItemsTest.cpp index 611e303f..dfb24c18 100644 --- a/tests/generated/YGAlignItemsTest.cpp +++ b/tests/generated/YGAlignItemsTest.cpp @@ -1262,6 +1262,8 @@ TEST(YogaTest, align_baseline_multiline) { } TEST(YogaTest, align_baseline_multiline_column) { + GTEST_SKIP(); + const YGConfigRef config = YGConfigNew(); YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); @@ -1350,7 +1352,7 @@ TEST(YogaTest, align_baseline_multiline_column) { ASSERT_FLOAT_EQ(50, YGNodeLayoutGetWidth(root_child0)); ASSERT_FLOAT_EQ(50, YGNodeLayoutGetHeight(root_child0)); - ASSERT_FLOAT_EQ(70, YGNodeLayoutGetLeft(root_child1)); + ASSERT_FLOAT_EQ(50, YGNodeLayoutGetLeft(root_child1)); ASSERT_FLOAT_EQ(50, YGNodeLayoutGetTop(root_child1)); ASSERT_FLOAT_EQ(30, YGNodeLayoutGetWidth(root_child1)); ASSERT_FLOAT_EQ(50, YGNodeLayoutGetHeight(root_child1)); @@ -1360,7 +1362,7 @@ TEST(YogaTest, align_baseline_multiline_column) { ASSERT_FLOAT_EQ(20, YGNodeLayoutGetWidth(root_child1_child0)); ASSERT_FLOAT_EQ(20, YGNodeLayoutGetHeight(root_child1_child0)); - ASSERT_FLOAT_EQ(10, YGNodeLayoutGetLeft(root_child2)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child2)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child2)); ASSERT_FLOAT_EQ(40, YGNodeLayoutGetWidth(root_child2)); ASSERT_FLOAT_EQ(70, YGNodeLayoutGetHeight(root_child2)); @@ -1381,6 +1383,8 @@ TEST(YogaTest, align_baseline_multiline_column) { } TEST(YogaTest, align_baseline_multiline_column2) { + GTEST_SKIP(); + const YGConfigRef config = YGConfigNew(); YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); @@ -1469,7 +1473,7 @@ TEST(YogaTest, align_baseline_multiline_column2) { ASSERT_FLOAT_EQ(50, YGNodeLayoutGetWidth(root_child0)); ASSERT_FLOAT_EQ(50, YGNodeLayoutGetHeight(root_child0)); - ASSERT_FLOAT_EQ(70, YGNodeLayoutGetLeft(root_child1)); + ASSERT_FLOAT_EQ(50, YGNodeLayoutGetLeft(root_child1)); ASSERT_FLOAT_EQ(50, YGNodeLayoutGetTop(root_child1)); ASSERT_FLOAT_EQ(30, YGNodeLayoutGetWidth(root_child1)); ASSERT_FLOAT_EQ(50, YGNodeLayoutGetHeight(root_child1)); @@ -1479,7 +1483,7 @@ TEST(YogaTest, align_baseline_multiline_column2) { ASSERT_FLOAT_EQ(20, YGNodeLayoutGetWidth(root_child1_child0)); ASSERT_FLOAT_EQ(20, YGNodeLayoutGetHeight(root_child1_child0)); - ASSERT_FLOAT_EQ(10, YGNodeLayoutGetLeft(root_child2)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child2)); ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child2)); ASSERT_FLOAT_EQ(40, YGNodeLayoutGetWidth(root_child2)); ASSERT_FLOAT_EQ(70, YGNodeLayoutGetHeight(root_child2)); diff --git a/tests/generated/YGMinMaxDimensionTest.cpp b/tests/generated/YGMinMaxDimensionTest.cpp index 6c5652a4..3b5b14de 100644 --- a/tests/generated/YGMinMaxDimensionTest.cpp +++ b/tests/generated/YGMinMaxDimensionTest.cpp @@ -96,6 +96,123 @@ TEST(YogaTest, max_height) { YGConfigFree(config); } +TEST(YogaTest, min_height) { + GTEST_SKIP(); + + const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); + + const YGNodeRef root = YGNodeNewWithConfig(config); + YGNodeStyleSetWidth(root, 100); + YGNodeStyleSetHeight(root, 100); + + const YGNodeRef root_child0 = YGNodeNewWithConfig(config); + YGNodeStyleSetFlexGrow(root_child0, 1); + YGNodeStyleSetMinHeight(root_child0, 60); + YGNodeInsertChild(root, root_child0, 0); + + const YGNodeRef root_child1 = YGNodeNewWithConfig(config); + YGNodeStyleSetFlexGrow(root_child1, 1); + YGNodeInsertChild(root, root_child1, 1); + YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root)); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root_child0)); + ASSERT_FLOAT_EQ(60, YGNodeLayoutGetHeight(root_child0)); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child1)); + ASSERT_FLOAT_EQ(60, YGNodeLayoutGetTop(root_child1)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root_child1)); + ASSERT_FLOAT_EQ(40, YGNodeLayoutGetHeight(root_child1)); + + YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionRTL); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root)); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root_child0)); + ASSERT_FLOAT_EQ(60, YGNodeLayoutGetHeight(root_child0)); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child1)); + ASSERT_FLOAT_EQ(60, YGNodeLayoutGetTop(root_child1)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root_child1)); + ASSERT_FLOAT_EQ(40, YGNodeLayoutGetHeight(root_child1)); + + YGNodeFreeRecursive(root); + + YGConfigFree(config); +} + +TEST(YogaTest, min_width) { + GTEST_SKIP(); + + const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); + + const YGNodeRef root = YGNodeNewWithConfig(config); + YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); + YGNodeStyleSetWidth(root, 100); + YGNodeStyleSetHeight(root, 100); + + const YGNodeRef root_child0 = YGNodeNewWithConfig(config); + YGNodeStyleSetFlexGrow(root_child0, 1); + YGNodeStyleSetMinWidth(root_child0, 60); + YGNodeInsertChild(root, root_child0, 0); + + const YGNodeRef root_child1 = YGNodeNewWithConfig(config); + YGNodeStyleSetFlexGrow(root_child1, 1); + YGNodeInsertChild(root, root_child1, 1); + YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root)); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0)); + ASSERT_FLOAT_EQ(60, YGNodeLayoutGetWidth(root_child0)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root_child0)); + + ASSERT_FLOAT_EQ(60, YGNodeLayoutGetLeft(root_child1)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child1)); + ASSERT_FLOAT_EQ(40, YGNodeLayoutGetWidth(root_child1)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root_child1)); + + YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionRTL); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root)); + + ASSERT_FLOAT_EQ(40, YGNodeLayoutGetLeft(root_child0)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0)); + ASSERT_FLOAT_EQ(60, YGNodeLayoutGetWidth(root_child0)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root_child0)); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child1)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child1)); + ASSERT_FLOAT_EQ(40, YGNodeLayoutGetWidth(root_child1)); + ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root_child1)); + + YGNodeFreeRecursive(root); + + YGConfigFree(config); +} + TEST(YogaTest, justify_content_min_max) { const YGConfigRef config = YGConfigNew(); YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); diff --git a/tests/generated/YGPercentageTest.cpp b/tests/generated/YGPercentageTest.cpp index 9e4a7af3..95dbd787 100644 --- a/tests/generated/YGPercentageTest.cpp +++ b/tests/generated/YGPercentageTest.cpp @@ -259,6 +259,65 @@ TEST(YogaTest, percentage_flex_basis_cross) { YGConfigFree(config); } +TEST(YogaTest, percentage_flex_basis_cross_min_height) { + GTEST_SKIP(); + + const YGConfigRef config = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); + YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureFixAbsoluteTrailingColumnMargin, true); + + const YGNodeRef root = YGNodeNewWithConfig(config); + YGNodeStyleSetWidth(root, 200); + YGNodeStyleSetHeight(root, 200); + + const YGNodeRef root_child0 = YGNodeNewWithConfig(config); + YGNodeStyleSetFlexGrow(root_child0, 1); + YGNodeStyleSetMinHeightPercent(root_child0, 60); + YGNodeInsertChild(root, root_child0, 0); + + const YGNodeRef root_child1 = YGNodeNewWithConfig(config); + YGNodeStyleSetFlexGrow(root_child1, 2); + YGNodeStyleSetMinHeightPercent(root_child1, 10); + YGNodeInsertChild(root, root_child1, 1); + YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root)); + ASSERT_FLOAT_EQ(200, YGNodeLayoutGetWidth(root)); + ASSERT_FLOAT_EQ(200, YGNodeLayoutGetHeight(root)); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0)); + ASSERT_FLOAT_EQ(200, YGNodeLayoutGetWidth(root_child0)); + ASSERT_FLOAT_EQ(120, YGNodeLayoutGetHeight(root_child0)); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child1)); + ASSERT_FLOAT_EQ(120, YGNodeLayoutGetTop(root_child1)); + ASSERT_FLOAT_EQ(200, YGNodeLayoutGetWidth(root_child1)); + ASSERT_FLOAT_EQ(80, YGNodeLayoutGetHeight(root_child1)); + + YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionRTL); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root)); + ASSERT_FLOAT_EQ(200, YGNodeLayoutGetWidth(root)); + ASSERT_FLOAT_EQ(200, YGNodeLayoutGetHeight(root)); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0)); + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0)); + ASSERT_FLOAT_EQ(200, YGNodeLayoutGetWidth(root_child0)); + ASSERT_FLOAT_EQ(120, YGNodeLayoutGetHeight(root_child0)); + + ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child1)); + ASSERT_FLOAT_EQ(120, YGNodeLayoutGetTop(root_child1)); + ASSERT_FLOAT_EQ(200, YGNodeLayoutGetWidth(root_child1)); + ASSERT_FLOAT_EQ(80, YGNodeLayoutGetHeight(root_child1)); + + YGNodeFreeRecursive(root); + + YGConfigFree(config); +} + TEST(YogaTest, percentage_flex_basis_main_max_height) { const YGConfigRef config = YGConfigNew(); YGConfigSetExperimentalFeatureEnabled(config, YGExperimentalFeatureAbsolutePercentageAgainstPaddingEdge, true); -- 2.50.1.windows.1 From 4c5c647f417510793e1778eb9a7c9c067ebf10c2 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Wed, 10 May 2023 21:11:22 -0700 Subject: [PATCH 2/2] Move generated Jest tests to TypeScript (#1287) Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1287 Outputs tests as TypeScript, along with using/testing the new form of enums imported directly from the package. We need to change how we are telling Jest which variant to run, so that tests can import enums from "yoga-layout" and have it resolve to the entrypoint which has a binary which has already been built. Reviewed By: yungsters Differential Revision: D45723545 fbshipit-source-id: 63e6da1fdf7b4b13ccc97fa95d9dee87b4d3605d --- gentest/gentest-javascript.js | 120 ++--- gentest/gentest.rb | 2 +- javascript/jest.config.ts | 10 + javascript/jest.setup.ts | 11 +- ...test.js => YGAbsolutePositionTest.test.ts} | 434 ++++++++--------- ...est.test.js => YGAlignContentTest.test.ts} | 304 ++++++------ ...sTest.test.js => YGAlignItemsTest.test.ts} | 410 ++++++++-------- ...lfTest.test.js => YGAlignSelfTest.test.ts} | 74 +-- ...Feed.test.js => YGAndroidNewsFeed.test.ts} | 102 ++-- ...orderTest.test.js => YGBorderTest.test.ts} | 100 ++-- ...onTest.test.js => YGDimensionTest.test.ts} | 34 +- ...playTest.test.js => YGDisplayTest.test.ts} | 100 ++-- ...st.test.js => YGFlexDirectionTest.test.ts} | 74 +-- ...{YGFlexTest.test.js => YGFlexTest.test.ts} | 106 +++-- ...rapTest.test.js => YGFlexWrapTest.test.ts} | 302 ++++++------ .../{YGGapTest.test.js => YGGapTest.test.ts} | 388 +++++++-------- ...t.test.js => YGJustifyContentTest.test.ts} | 254 +++++----- ...arginTest.test.js => YGMarginTest.test.ts} | 440 +++++++++--------- ....test.js => YGMinMaxDimensionTest.test.ts} | 256 +++++----- ...dingTest.test.js => YGPaddingTest.test.ts} | 120 +++-- ...eTest.test.js => YGPercentageTest.test.ts} | 286 ++++++------ ...ingTest.test.js => YGRoundingTest.test.ts} | 140 +++--- ...est.test.js => YGSizeOverflowTest.test.ts} | 42 +- 23 files changed, 2231 insertions(+), 1878 deletions(-) rename javascript/tests/generated/{YGAbsolutePositionTest.test.js => YGAbsolutePositionTest.test.ts} (70%) rename javascript/tests/generated/{YGAlignContentTest.test.js => YGAlignContentTest.test.ts} (86%) rename javascript/tests/generated/{YGAlignItemsTest.test.js => YGAlignItemsTest.test.ts} (84%) rename javascript/tests/generated/{YGAlignSelfTest.test.js => YGAlignSelfTest.test.ts} (77%) rename javascript/tests/generated/{YGAndroidNewsFeed.test.js => YGAndroidNewsFeed.test.ts} (83%) rename javascript/tests/generated/{YGBorderTest.test.js => YGBorderTest.test.ts} (68%) rename javascript/tests/generated/{YGDimensionTest.test.js => YGDimensionTest.test.ts} (78%) rename javascript/tests/generated/{YGDisplayTest.test.js => YGDisplayTest.test.ts} (79%) rename javascript/tests/generated/{YGFlexDirectionTest.test.js => YGFlexDirectionTest.test.ts} (85%) rename javascript/tests/generated/{YGFlexTest.test.js => YGFlexTest.test.ts} (84%) rename javascript/tests/generated/{YGFlexWrapTest.test.js => YGFlexWrapTest.test.ts} (85%) rename javascript/tests/generated/{YGGapTest.test.js => YGGapTest.test.ts} (85%) rename javascript/tests/generated/{YGJustifyContentTest.test.js => YGJustifyContentTest.test.ts} (80%) rename javascript/tests/generated/{YGMarginTest.test.js => YGMarginTest.test.ts} (77%) rename javascript/tests/generated/{YGMinMaxDimensionTest.test.js => YGMinMaxDimensionTest.test.ts} (80%) rename javascript/tests/generated/{YGPaddingTest.test.js => YGPaddingTest.test.ts} (67%) rename javascript/tests/generated/{YGPercentageTest.test.js => YGPercentageTest.test.ts} (79%) rename javascript/tests/generated/{YGRoundingTest.test.js => YGRoundingTest.test.ts} (88%) rename javascript/tests/generated/{YGSizeOverflowTest.test.js => YGSizeOverflowTest.test.ts} (82%) diff --git a/gentest/gentest-javascript.js b/gentest/gentest-javascript.js index 0f5f9095..3b16b7a8 100644 --- a/gentest/gentest-javascript.js +++ b/gentest/gentest-javascript.js @@ -16,22 +16,31 @@ function toValueJavascript(value) { return value; } -function toJavascriptUpper(symbol) { - let out = ''; - for (let i = 0; i < symbol.length; i++) { - const c = symbol.charAt(i); - if (c == c.toUpperCase() && i != 0 && symbol[i - 1] != symbol[i - 1].toUpperCase()) { - out += '_'; - } - out += c.toUpperCase(); - } - return out; -} - JavascriptEmitter.prototype = Object.create(Emitter.prototype, { constructor:{value:JavascriptEmitter}, - emitPrologue:{value:function() {}}, + emitPrologue:{value:function() { + this.push('import {Yoga} from "../tools/globals";') + this.push('import {') + this.pushIndent(); + this.push('Align,'); + this.push('Direction,'); + this.push('Display,'); + this.push('Edge,'); + this.push('Errata,'); + this.push('ExperimentalFeature,'); + this.push('FlexDirection,'); + this.push('Gutter,'); + this.push('Justify,'); + this.push('MeasureMode,'); + this.push('Overflow,'); + this.push('PositionType,'); + this.push('Unit,'); + this.push('Wrap,'); + this.popIndent(); + this.push('} from \'yoga-layout\';'); + this.push(''); + }}, emitTestPrologue:{value:function(name, experiments, ignore) { const testFn = ignore ? `test.skip` : 'test'; @@ -43,7 +52,7 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, { if (experiments.length > 0) { for (const experiment of experiments) { - this.push('config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_' + toJavascriptUpper(experiment) + ', true);'); + this.push(`config.setExperimentalFeatureEnabled(ExperimentalFeature.${experiment}, true);`); } this.push(''); } @@ -88,58 +97,57 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, { this.push(`expect(${v1}).toBe(${v0});`); }}, - YGAlignAuto:{value:'Yoga.ALIGN_AUTO'}, - YGAlignCenter:{value:'Yoga.ALIGN_CENTER'}, - YGAlignFlexEnd:{value:'Yoga.ALIGN_FLEX_END'}, - YGAlignFlexStart:{value:'Yoga.ALIGN_FLEX_START'}, - YGAlignStretch:{value:'Yoga.ALIGN_STRETCH'}, - YGAlignSpaceBetween:{value:'Yoga.ALIGN_SPACE_BETWEEN'}, - YGAlignSpaceAround:{value:'Yoga.ALIGN_SPACE_AROUND'}, - YGAlignBaseline:{value:'Yoga.ALIGN_BASELINE'}, + YGAlignAuto:{value: 'Align.Auto'}, + YGAlignCenter:{value: 'Align.Center'}, + YGAlignFlexEnd:{value: 'Align.FlexEnd'}, + YGAlignFlexStart:{value: 'Align.FlexStart'}, + YGAlignStretch:{value: 'Align.Stretch'}, + YGAlignSpaceBetween:{value: 'Align.SpaceBetween'}, + YGAlignSpaceAround:{value: 'Align.SpaceAround'}, + YGAlignBaseline:{value: 'Align.Baseline'}, - YGDirectionInherit:{value:'Yoga.DIRECTION_INHERIT'}, - YGDirectionLTR:{value:'Yoga.DIRECTION_LTR'}, - YGDirectionRTL:{value:'Yoga.DIRECTION_RTL'}, + YGDirectionInherit:{value: 'Direction.Inherit'}, + YGDirectionLTR:{value: 'Direction.LTR'}, + YGDirectionRTL:{value: 'Direction.RTL'}, - YGEdgeBottom:{value:'Yoga.EDGE_BOTTOM'}, - YGEdgeEnd:{value:'Yoga.EDGE_END'}, - YGEdgeLeft:{value:'Yoga.EDGE_LEFT'}, - YGEdgeRight:{value:'Yoga.EDGE_RIGHT'}, - YGEdgeStart:{value:'Yoga.EDGE_START'}, - YGEdgeTop:{value:'Yoga.EDGE_TOP'}, + YGEdgeBottom:{value: 'Edge.Bottom'}, + YGEdgeEnd:{value: 'Edge.End'}, + YGEdgeLeft:{value: 'Edge.Left'}, + YGEdgeRight:{value: 'Edge.Right'}, + YGEdgeStart:{value: 'Edge.Start'}, + YGEdgeTop:{value: 'Edge.Top'}, - YGGutterAll:{value:'Yoga.GUTTER_ALL'}, - YGGutterColumn:{value:'Yoga.GUTTER_COLUMN'}, - YGGutterRow:{value:'Yoga.GUTTER_ROW'}, + YGGutterAll:{value: 'Gutter.All'}, + YGGutterColumn:{value: 'Gutter.Column'}, + YGGutterRow:{value: 'Gutter.Row'}, - YGFlexDirectionColumn:{value:'Yoga.FLEX_DIRECTION_COLUMN'}, - YGFlexDirectionColumnReverse:{value:'Yoga.FLEX_DIRECTION_COLUMN_REVERSE'}, - YGFlexDirectionRow:{value:'Yoga.FLEX_DIRECTION_ROW'}, - YGFlexDirectionRowReverse:{value:'Yoga.FLEX_DIRECTION_ROW_REVERSE'}, + YGFlexDirectionColumn:{value: 'FlexDirection.Column'}, + YGFlexDirectionColumnReverse:{value: 'FlexDirection.ColumnReverse'}, + YGFlexDirectionRow:{value: 'FlexDirection.Row'}, + YGFlexDirectionRowReverse:{value: 'FlexDirection.RowReverse'}, - YGJustifyCenter:{value:'Yoga.JUSTIFY_CENTER'}, - YGJustifyFlexEnd:{value:'Yoga.JUSTIFY_FLEX_END'}, - YGJustifyFlexStart:{value:'Yoga.JUSTIFY_FLEX_START'}, - YGJustifySpaceAround:{value:'Yoga.JUSTIFY_SPACE_AROUND'}, - YGJustifySpaceBetween:{value:'Yoga.JUSTIFY_SPACE_BETWEEN'}, - YGJustifySpaceEvenly:{value:'Yoga.JUSTIFY_SPACE_EVENLY'}, + YGJustifyCenter:{value: 'Justify.Center'}, + YGJustifyFlexEnd:{value: 'Justify.FlexEnd'}, + YGJustifyFlexStart:{value: 'Justify.FlexStart'}, + YGJustifySpaceAround:{value: 'Justify.SpaceAround'}, + YGJustifySpaceBetween:{value: 'Justify.SpaceBetween'}, + YGJustifySpaceEvenly:{value: 'Justify.SpaceEvenly'}, - YGOverflowHidden:{value:'Yoga.OVERFLOW_HIDDEN'}, - YGOverflowVisible:{value:'Yoga.OVERFLOW_VISIBLE'}, + YGOverflowHidden:{value: 'Overflow.Hidden'}, + YGOverflowVisible:{value: 'Overflow.Visible'}, - YGPositionTypeAbsolute:{value:'Yoga.POSITION_TYPE_ABSOLUTE'}, - YGPositionTypeRelative:{value:'Yoga.POSITION_TYPE_RELATIVE'}, - - YGAuto:{value:'Yoga.AUTO'}, - - YGWrapNoWrap:{value:'Yoga.WRAP_NO_WRAP'}, - YGWrapWrap:{value:'Yoga.WRAP_WRAP'}, - YGWrapWrapReverse:{value: 'Yoga.WRAP_WRAP_REVERSE'}, + YGPositionTypeAbsolute:{value: 'PositionType.Absolute'}, + YGPositionTypeRelative:{value: 'PositionType.Relative'}, + YGAuto:{value:'\'auto\''}, YGUndefined:{value:'undefined'}, - YGDisplayFlex:{value:'Yoga.DISPLAY_FLEX'}, - YGDisplayNone:{value:'Yoga.DISPLAY_NONE'}, + YGWrapNoWrap:{value: 'Wrap.NoWrap'}, + YGWrapWrap:{value: 'Wrap.Wrap'}, + YGWrapWrapReverse:{value: 'Wrap.WrapReverse'}, + + YGDisplayFlex:{value: 'Display.Flex'}, + YGDisplayNone:{value: 'Display.None'}, YGNodeCalculateLayout:{value:function(node, dir, experiments) { this.push(node + '.calculateLayout(undefined, undefined, ' + dir + ');'); diff --git a/gentest/gentest.rb b/gentest/gentest.rb index 22c93721..4cc7f301 100644 --- a/gentest/gentest.rb +++ b/gentest/gentest.rb @@ -56,7 +56,7 @@ Dir['fixtures/*.html'].each do |file| print logs[4] - f = File.open("../javascript/tests/generated/#{name}.test.js", 'w') + f = File.open("../javascript/tests/generated/#{name}.test.ts", 'w') f.write eval(logs[3].message.sub(/^[^"]*/, '')).sub('YogaTest', name) f.close end diff --git a/javascript/jest.config.ts b/javascript/jest.config.ts index 62f66a99..477f6646 100644 --- a/javascript/jest.config.ts +++ b/javascript/jest.config.ts @@ -12,6 +12,16 @@ import type {Config} from 'jest'; const config: Config = { setupFiles: ['./jest.setup.ts'], testRegex: '/tests/.*\\.test\\.[jt]s$', + moduleNameMapper: { + 'yoga-layout': + process.env['SYNC'] === '1' && process.env['WASM'] === '1' + ? 'yoga-layout/wasm-sync' + : process.env['SYNC'] === '1' + ? 'yoga-layout/asmjs-sync' + : process.env['WASM'] === '1' + ? 'yoga-layout/wasm-async' + : 'yoga-layout/asmjs-async', + }, }; export default config; diff --git a/javascript/jest.setup.ts b/javascript/jest.setup.ts index 7ec11a77..705024ce 100644 --- a/javascript/jest.setup.ts +++ b/javascript/jest.setup.ts @@ -8,15 +8,8 @@ */ module.exports = async () => { - if (process.env['SYNC'] === '1' && process.env['WASM'] === '1') { - globalThis.Yoga = require('yoga-layout/wasm-sync').default; - } else if (process.env['SYNC'] === '1') { - globalThis.Yoga = require('yoga-layout/asmjs-sync').default; - } else if (process.env['WASM'] === '1') { - globalThis.Yoga = await require('yoga-layout/wasm-async').loadYoga(); - } else { - globalThis.Yoga = await require('yoga-layout/asmjs-async').loadYoga(); - } + const {loadYoga, default: Yoga} = require('yoga-layout'); + globalThis.Yoga = Yoga ?? (await loadYoga()); }; Object.defineProperty(globalThis, 'YGBENCHMARK', { diff --git a/javascript/tests/generated/YGAbsolutePositionTest.test.js b/javascript/tests/generated/YGAbsolutePositionTest.test.ts similarity index 70% rename from javascript/tests/generated/YGAbsolutePositionTest.test.js rename to javascript/tests/generated/YGAbsolutePositionTest.test.ts index d3f4c65d..ddf0c2ce 100644 --- a/javascript/tests/generated/YGAbsolutePositionTest.test.js +++ b/javascript/tests/generated/YGAbsolutePositionTest.test.ts @@ -7,12 +7,30 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAbsolutePositionTest.html +import {Yoga} from "../tools/globals"; +import { + Align, + Direction, + Display, + Edge, + Errata, + ExperimentalFeature, + FlexDirection, + Gutter, + Justify, + MeasureMode, + Overflow, + PositionType, + Unit, + Wrap, +} from 'yoga-layout'; + test('absolute_layout_width_height_start_top', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -20,13 +38,13 @@ test('absolute_layout_width_height_start_top', () => { root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); - root_child0.setPosition(Yoga.EDGE_START, 10); - root_child0.setPosition(Yoga.EDGE_TOP, 10); + root_child0.setPositionType(PositionType.Absolute); + root_child0.setPosition(Edge.Start, 10); + root_child0.setPosition(Edge.Top, 10); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -38,7 +56,7 @@ test('absolute_layout_width_height_start_top', () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -61,8 +79,8 @@ test('absolute_layout_width_height_end_bottom', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -70,13 +88,13 @@ test('absolute_layout_width_height_end_bottom', () => { root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); - root_child0.setPosition(Yoga.EDGE_END, 10); - root_child0.setPosition(Yoga.EDGE_BOTTOM, 10); + root_child0.setPositionType(PositionType.Absolute); + root_child0.setPosition(Edge.End, 10); + root_child0.setPosition(Edge.Bottom, 10); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -88,7 +106,7 @@ test('absolute_layout_width_height_end_bottom', () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -111,8 +129,8 @@ test('absolute_layout_start_top_end_bottom', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -120,13 +138,13 @@ test('absolute_layout_start_top_end_bottom', () => { root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); - root_child0.setPosition(Yoga.EDGE_START, 10); - root_child0.setPosition(Yoga.EDGE_TOP, 10); - root_child0.setPosition(Yoga.EDGE_END, 10); - root_child0.setPosition(Yoga.EDGE_BOTTOM, 10); + root_child0.setPositionType(PositionType.Absolute); + root_child0.setPosition(Edge.Start, 10); + root_child0.setPosition(Edge.Top, 10); + root_child0.setPosition(Edge.End, 10); + root_child0.setPosition(Edge.Bottom, 10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -138,7 +156,7 @@ test('absolute_layout_start_top_end_bottom', () => { expect(root_child0.getComputedWidth()).toBe(80); expect(root_child0.getComputedHeight()).toBe(80); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -161,8 +179,8 @@ test('absolute_layout_width_height_start_top_end_bottom', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -170,15 +188,15 @@ test('absolute_layout_width_height_start_top_end_bottom', () => { root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); - root_child0.setPosition(Yoga.EDGE_START, 10); - root_child0.setPosition(Yoga.EDGE_TOP, 10); - root_child0.setPosition(Yoga.EDGE_END, 10); - root_child0.setPosition(Yoga.EDGE_BOTTOM, 10); + root_child0.setPositionType(PositionType.Absolute); + root_child0.setPosition(Edge.Start, 10); + root_child0.setPosition(Edge.Top, 10); + root_child0.setPosition(Edge.End, 10); + root_child0.setPosition(Edge.Bottom, 10); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -190,7 +208,7 @@ test('absolute_layout_width_height_start_top_end_bottom', () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -213,27 +231,27 @@ test('do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_pare const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setOverflow(Yoga.OVERFLOW_HIDDEN); + root.setFlexDirection(FlexDirection.Row); + root.setOverflow(Overflow.Hidden); root.setWidth(50); root.setHeight(50); const root_child0 = Yoga.Node.create(config); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); - root_child0.setPosition(Yoga.EDGE_START, 0); - root_child0.setPosition(Yoga.EDGE_TOP, 0); + root_child0.setPositionType(PositionType.Absolute); + root_child0.setPosition(Edge.Start, 0); + root_child0.setPosition(Edge.Top, 0); root.insertChild(root_child0, 0); const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setWidth(100); root_child0_child0.setHeight(100); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -250,7 +268,7 @@ test('do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_pare expect(root_child0_child0.getComputedWidth()).toBe(100); expect(root_child0_child0.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -278,66 +296,66 @@ test('absolute_layout_within_border', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setMargin(Yoga.EDGE_LEFT, 10); - root.setMargin(Yoga.EDGE_TOP, 10); - root.setMargin(Yoga.EDGE_RIGHT, 10); - root.setMargin(Yoga.EDGE_BOTTOM, 10); - root.setPadding(Yoga.EDGE_LEFT, 10); - root.setPadding(Yoga.EDGE_TOP, 10); - root.setPadding(Yoga.EDGE_RIGHT, 10); - root.setPadding(Yoga.EDGE_BOTTOM, 10); - root.setBorder(Yoga.EDGE_LEFT, 10); - root.setBorder(Yoga.EDGE_TOP, 10); - root.setBorder(Yoga.EDGE_RIGHT, 10); - root.setBorder(Yoga.EDGE_BOTTOM, 10); + root.setMargin(Edge.Left, 10); + root.setMargin(Edge.Top, 10); + root.setMargin(Edge.Right, 10); + root.setMargin(Edge.Bottom, 10); + root.setPadding(Edge.Left, 10); + root.setPadding(Edge.Top, 10); + root.setPadding(Edge.Right, 10); + root.setPadding(Edge.Bottom, 10); + root.setBorder(Edge.Left, 10); + root.setBorder(Edge.Top, 10); + root.setBorder(Edge.Right, 10); + root.setBorder(Edge.Bottom, 10); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); - root_child0.setPosition(Yoga.EDGE_LEFT, 0); - root_child0.setPosition(Yoga.EDGE_TOP, 0); + root_child0.setPositionType(PositionType.Absolute); + root_child0.setPosition(Edge.Left, 0); + root_child0.setPosition(Edge.Top, 0); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(config); - root_child1.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); - root_child1.setPosition(Yoga.EDGE_RIGHT, 0); - root_child1.setPosition(Yoga.EDGE_BOTTOM, 0); + root_child1.setPositionType(PositionType.Absolute); + root_child1.setPosition(Edge.Right, 0); + root_child1.setPosition(Edge.Bottom, 0); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); const root_child2 = Yoga.Node.create(config); - root_child2.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); - root_child2.setPosition(Yoga.EDGE_LEFT, 0); - root_child2.setPosition(Yoga.EDGE_TOP, 0); - root_child2.setMargin(Yoga.EDGE_LEFT, 10); - root_child2.setMargin(Yoga.EDGE_TOP, 10); - root_child2.setMargin(Yoga.EDGE_RIGHT, 10); - root_child2.setMargin(Yoga.EDGE_BOTTOM, 10); + root_child2.setPositionType(PositionType.Absolute); + root_child2.setPosition(Edge.Left, 0); + root_child2.setPosition(Edge.Top, 0); + root_child2.setMargin(Edge.Left, 10); + root_child2.setMargin(Edge.Top, 10); + root_child2.setMargin(Edge.Right, 10); + root_child2.setMargin(Edge.Bottom, 10); root_child2.setWidth(50); root_child2.setHeight(50); root.insertChild(root_child2, 2); const root_child3 = Yoga.Node.create(config); - root_child3.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); - root_child3.setPosition(Yoga.EDGE_RIGHT, 0); - root_child3.setPosition(Yoga.EDGE_BOTTOM, 0); - root_child3.setMargin(Yoga.EDGE_LEFT, 10); - root_child3.setMargin(Yoga.EDGE_TOP, 10); - root_child3.setMargin(Yoga.EDGE_RIGHT, 10); - root_child3.setMargin(Yoga.EDGE_BOTTOM, 10); + root_child3.setPositionType(PositionType.Absolute); + root_child3.setPosition(Edge.Right, 0); + root_child3.setPosition(Edge.Bottom, 0); + root_child3.setMargin(Edge.Left, 10); + root_child3.setMargin(Edge.Top, 10); + root_child3.setMargin(Edge.Right, 10); + root_child3.setMargin(Edge.Bottom, 10); root_child3.setWidth(50); root_child3.setHeight(50); root.insertChild(root_child3, 3); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(10); expect(root.getComputedTop()).toBe(10); @@ -364,7 +382,7 @@ test('absolute_layout_within_border', () => { expect(root_child3.getComputedWidth()).toBe(50); expect(root_child3.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(10); expect(root.getComputedTop()).toBe(10); @@ -402,23 +420,23 @@ test('absolute_layout_align_items_and_justify_content_center', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setJustifyContent(Justify.Center); + root.setAlignItems(Align.Center); root.setFlexGrow(1); root.setWidth(110); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); + root_child0.setPositionType(PositionType.Absolute); root_child0.setWidth(60); root_child0.setHeight(40); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -430,7 +448,7 @@ test('absolute_layout_align_items_and_justify_content_center', () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -453,23 +471,23 @@ test('absolute_layout_align_items_and_justify_content_flex_end', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); - root.setAlignItems(Yoga.ALIGN_FLEX_END); + root.setJustifyContent(Justify.FlexEnd); + root.setAlignItems(Align.FlexEnd); root.setFlexGrow(1); root.setWidth(110); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); + root_child0.setPositionType(PositionType.Absolute); root_child0.setWidth(60); root_child0.setHeight(40); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -481,7 +499,7 @@ test('absolute_layout_align_items_and_justify_content_flex_end', () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -504,22 +522,22 @@ test('absolute_layout_justify_content_center', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); + root.setJustifyContent(Justify.Center); root.setFlexGrow(1); root.setWidth(110); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); + root_child0.setPositionType(PositionType.Absolute); root_child0.setWidth(60); root_child0.setHeight(40); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -531,7 +549,7 @@ test('absolute_layout_justify_content_center', () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -554,22 +572,22 @@ test('absolute_layout_align_items_center', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setAlignItems(Align.Center); root.setFlexGrow(1); root.setWidth(110); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); + root_child0.setPositionType(PositionType.Absolute); root_child0.setWidth(60); root_child0.setHeight(40); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -581,7 +599,7 @@ test('absolute_layout_align_items_center', () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -604,8 +622,8 @@ test('absolute_layout_align_items_center_on_child_only', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -614,12 +632,12 @@ test('absolute_layout_align_items_center_on_child_only', () => { root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setAlignSelf(Yoga.ALIGN_CENTER); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); + root_child0.setAlignSelf(Align.Center); + root_child0.setPositionType(PositionType.Absolute); root_child0.setWidth(60); root_child0.setHeight(40); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -631,7 +649,7 @@ test('absolute_layout_align_items_center_on_child_only', () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -654,24 +672,24 @@ test('absolute_layout_align_items_and_justify_content_center_and_top_position', const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setJustifyContent(Justify.Center); + root.setAlignItems(Align.Center); root.setFlexGrow(1); root.setWidth(110); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); - root_child0.setPosition(Yoga.EDGE_TOP, 10); + root_child0.setPositionType(PositionType.Absolute); + root_child0.setPosition(Edge.Top, 10); root_child0.setWidth(60); root_child0.setHeight(40); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -683,7 +701,7 @@ test('absolute_layout_align_items_and_justify_content_center_and_top_position', expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -706,24 +724,24 @@ test('absolute_layout_align_items_and_justify_content_center_and_bottom_position const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setJustifyContent(Justify.Center); + root.setAlignItems(Align.Center); root.setFlexGrow(1); root.setWidth(110); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); - root_child0.setPosition(Yoga.EDGE_BOTTOM, 10); + root_child0.setPositionType(PositionType.Absolute); + root_child0.setPosition(Edge.Bottom, 10); root_child0.setWidth(60); root_child0.setHeight(40); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -735,7 +753,7 @@ test('absolute_layout_align_items_and_justify_content_center_and_bottom_position expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -758,24 +776,24 @@ test('absolute_layout_align_items_and_justify_content_center_and_left_position', const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setJustifyContent(Justify.Center); + root.setAlignItems(Align.Center); root.setFlexGrow(1); root.setWidth(110); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); - root_child0.setPosition(Yoga.EDGE_LEFT, 5); + root_child0.setPositionType(PositionType.Absolute); + root_child0.setPosition(Edge.Left, 5); root_child0.setWidth(60); root_child0.setHeight(40); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -787,7 +805,7 @@ test('absolute_layout_align_items_and_justify_content_center_and_left_position', expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -810,24 +828,24 @@ test('absolute_layout_align_items_and_justify_content_center_and_right_position' const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setJustifyContent(Justify.Center); + root.setAlignItems(Align.Center); root.setFlexGrow(1); root.setWidth(110); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); - root_child0.setPosition(Yoga.EDGE_RIGHT, 5); + root_child0.setPositionType(PositionType.Absolute); + root_child0.setPosition(Edge.Right, 5); root_child0.setWidth(60); root_child0.setHeight(40); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -839,7 +857,7 @@ test('absolute_layout_align_items_and_justify_content_center_and_right_position' expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(40); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -862,22 +880,22 @@ test('position_root_with_rtl_should_position_withoutdirection', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setPosition(Yoga.EDGE_LEFT, 72); + root.setPosition(Edge.Left, 72); root.setWidth(52); root.setHeight(52); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(72); expect(root.getComputedTop()).toBe(0); expect(root.getComputedWidth()).toBe(52); expect(root.getComputedHeight()).toBe(52); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(72); expect(root.getComputedTop()).toBe(0); @@ -895,8 +913,8 @@ test('absolute_layout_percentage_bottom_based_on_parent_height', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -904,26 +922,26 @@ test('absolute_layout_percentage_bottom_based_on_parent_height', () => { root.setHeight(200); const root_child0 = Yoga.Node.create(config); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); - root_child0.setPosition(Yoga.EDGE_TOP, "50%"); + root_child0.setPositionType(PositionType.Absolute); + root_child0.setPosition(Edge.Top, "50%"); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(config); - root_child1.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); - root_child1.setPosition(Yoga.EDGE_BOTTOM, "50%"); + root_child1.setPositionType(PositionType.Absolute); + root_child1.setPosition(Edge.Bottom, "50%"); root_child1.setWidth(10); root_child1.setHeight(10); root.insertChild(root_child1, 1); const root_child2 = Yoga.Node.create(config); - root_child2.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); - root_child2.setPosition(Yoga.EDGE_TOP, "10%"); - root_child2.setPosition(Yoga.EDGE_BOTTOM, "10%"); + root_child2.setPositionType(PositionType.Absolute); + root_child2.setPosition(Edge.Top, "10%"); + root_child2.setPosition(Edge.Bottom, "10%"); root_child2.setWidth(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -945,7 +963,7 @@ test('absolute_layout_percentage_bottom_based_on_parent_height', () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(160); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -978,21 +996,21 @@ test('absolute_layout_in_wrap_reverse_column_container', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); + root.setFlexWrap(Wrap.WrapReverse); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); + root_child0.setPositionType(PositionType.Absolute); root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1004,7 +1022,7 @@ test('absolute_layout_in_wrap_reverse_column_container', () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1027,22 +1045,22 @@ test('absolute_layout_in_wrap_reverse_row_container', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); + root.setFlexDirection(FlexDirection.Row); + root.setFlexWrap(Wrap.WrapReverse); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); + root_child0.setPositionType(PositionType.Absolute); root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1054,7 +1072,7 @@ test('absolute_layout_in_wrap_reverse_row_container', () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1077,22 +1095,22 @@ test('absolute_layout_in_wrap_reverse_column_container_flex_end', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); + root.setFlexWrap(Wrap.WrapReverse); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setAlignSelf(Yoga.ALIGN_FLEX_END); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); + root_child0.setAlignSelf(Align.FlexEnd); + root_child0.setPositionType(PositionType.Absolute); root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1104,7 +1122,7 @@ test('absolute_layout_in_wrap_reverse_column_container_flex_end', () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1127,23 +1145,23 @@ test('absolute_layout_in_wrap_reverse_row_container_flex_end', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); + root.setFlexDirection(FlexDirection.Row); + root.setFlexWrap(Wrap.WrapReverse); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setAlignSelf(Yoga.ALIGN_FLEX_END); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); + root_child0.setAlignSelf(Align.FlexEnd); + root_child0.setPositionType(PositionType.Absolute); root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1155,7 +1173,7 @@ test('absolute_layout_in_wrap_reverse_row_container_flex_end', () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1178,8 +1196,8 @@ test('percent_absolute_position_infinite_height', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -1190,13 +1208,13 @@ test('percent_absolute_position_infinite_height', () => { root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(config); - root_child1.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); - root_child1.setPosition(Yoga.EDGE_LEFT, "20%"); - root_child1.setPosition(Yoga.EDGE_TOP, "20%"); + root_child1.setPositionType(PositionType.Absolute); + root_child1.setPosition(Edge.Left, "20%"); + root_child1.setPosition(Edge.Top, "20%"); root_child1.setWidth("20%"); root_child1.setHeight("20%"); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1213,7 +1231,7 @@ test('percent_absolute_position_infinite_height', () => { expect(root_child1.getComputedWidth()).toBe(60); expect(root_child1.getComputedHeight()).toBe(0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1241,22 +1259,22 @@ test('absolute_layout_percentage_height_based_on_padded_parent', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setPadding(Yoga.EDGE_TOP, 10); - root.setBorder(Yoga.EDGE_TOP, 10); + root.setPadding(Edge.Top, 10); + root.setBorder(Edge.Top, 10); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); + root_child0.setPositionType(PositionType.Absolute); root_child0.setWidth(100); root_child0.setHeight("50%"); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1268,7 +1286,7 @@ test('absolute_layout_percentage_height_based_on_padded_parent', () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1291,24 +1309,24 @@ test('absolute_layout_percentage_height_based_on_padded_parent_and_align_items_c const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); - root.setAlignItems(Yoga.ALIGN_CENTER); - root.setPadding(Yoga.EDGE_TOP, 20); - root.setPadding(Yoga.EDGE_BOTTOM, 20); + root.setJustifyContent(Justify.Center); + root.setAlignItems(Align.Center); + root.setPadding(Edge.Top, 20); + root.setPadding(Edge.Bottom, 20); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); + root_child0.setPositionType(PositionType.Absolute); root_child0.setWidth(100); root_child0.setHeight("50%"); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1320,7 +1338,7 @@ test('absolute_layout_percentage_height_based_on_padded_parent_and_align_items_c expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); diff --git a/javascript/tests/generated/YGAlignContentTest.test.js b/javascript/tests/generated/YGAlignContentTest.test.ts similarity index 86% rename from javascript/tests/generated/YGAlignContentTest.test.js rename to javascript/tests/generated/YGAlignContentTest.test.ts index f5fc0119..2c5bc91e 100644 --- a/javascript/tests/generated/YGAlignContentTest.test.js +++ b/javascript/tests/generated/YGAlignContentTest.test.ts @@ -7,17 +7,35 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignContentTest.html +import {Yoga} from "../tools/globals"; +import { + Align, + Direction, + Display, + Edge, + Errata, + ExperimentalFeature, + FlexDirection, + Gutter, + Justify, + MeasureMode, + Overflow, + PositionType, + Unit, + Wrap, +} from 'yoga-layout'; + test('align_content_flex_start', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setFlexWrap(Wrap.Wrap); root.setWidth(130); root.setHeight(100); @@ -45,7 +63,7 @@ test('align_content_flex_start', () => { root_child4.setWidth(50); root_child4.setHeight(10); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -77,7 +95,7 @@ test('align_content_flex_start', () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -120,12 +138,12 @@ test('align_content_flex_start_without_height_on_children', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexWrap(Wrap.Wrap); root.setWidth(100); root.setHeight(100); @@ -150,7 +168,7 @@ test('align_content_flex_start_without_height_on_children', () => { const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -182,7 +200,7 @@ test('align_content_flex_start_without_height_on_children', () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -225,12 +243,12 @@ test('align_content_flex_start_with_flex', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexWrap(Wrap.Wrap); root.setWidth(100); root.setHeight(120); @@ -261,7 +279,7 @@ test('align_content_flex_start_with_flex', () => { const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -293,7 +311,7 @@ test('align_content_flex_start_with_flex', () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -336,13 +354,13 @@ test('align_content_flex_end', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignContent(Yoga.ALIGN_FLEX_END); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setAlignContent(Align.FlexEnd); + root.setFlexWrap(Wrap.Wrap); root.setWidth(100); root.setHeight(100); @@ -370,7 +388,7 @@ test('align_content_flex_end', () => { root_child4.setWidth(50); root_child4.setHeight(10); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -402,7 +420,7 @@ test('align_content_flex_end', () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -445,13 +463,13 @@ test('align_content_stretch', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignContent(Yoga.ALIGN_STRETCH); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setAlignContent(Align.Stretch); + root.setFlexWrap(Wrap.Wrap); root.setWidth(150); root.setHeight(100); @@ -474,7 +492,7 @@ test('align_content_stretch', () => { const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -506,7 +524,7 @@ test('align_content_stretch', () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -549,14 +567,14 @@ test('align_content_spacebetween', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignContent(Yoga.ALIGN_SPACE_BETWEEN); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignContent(Align.SpaceBetween); + root.setFlexWrap(Wrap.Wrap); root.setWidth(130); root.setHeight(100); @@ -584,7 +602,7 @@ test('align_content_spacebetween', () => { root_child4.setWidth(50); root_child4.setHeight(10); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -616,7 +634,7 @@ test('align_content_spacebetween', () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -659,14 +677,14 @@ test('align_content_spacearound', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignContent(Yoga.ALIGN_SPACE_AROUND); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignContent(Align.SpaceAround); + root.setFlexWrap(Wrap.Wrap); root.setWidth(140); root.setHeight(120); @@ -694,7 +712,7 @@ test('align_content_spacearound', () => { root_child4.setWidth(50); root_child4.setHeight(10); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -726,7 +744,7 @@ test('align_content_spacearound', () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -769,14 +787,14 @@ test('align_content_stretch_row', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignContent(Yoga.ALIGN_STRETCH); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignContent(Align.Stretch); + root.setFlexWrap(Wrap.Wrap); root.setWidth(150); root.setHeight(100); @@ -799,7 +817,7 @@ test('align_content_stretch_row', () => { const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -831,7 +849,7 @@ test('align_content_stretch_row', () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -874,14 +892,14 @@ test('align_content_stretch_row_with_children', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignContent(Yoga.ALIGN_STRETCH); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignContent(Align.Stretch); + root.setFlexWrap(Wrap.Wrap); root.setWidth(150); root.setHeight(100); @@ -910,7 +928,7 @@ test('align_content_stretch_row_with_children', () => { const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -947,7 +965,7 @@ test('align_content_stretch_row_with_children', () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -995,14 +1013,14 @@ test('align_content_stretch_row_with_flex', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignContent(Yoga.ALIGN_STRETCH); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignContent(Align.Stretch); + root.setFlexWrap(Wrap.Wrap); root.setWidth(150); root.setHeight(100); @@ -1031,7 +1049,7 @@ test('align_content_stretch_row_with_flex', () => { const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1063,7 +1081,7 @@ test('align_content_stretch_row_with_flex', () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1106,14 +1124,14 @@ test('align_content_stretch_row_with_flex_no_shrink', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignContent(Yoga.ALIGN_STRETCH); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignContent(Align.Stretch); + root.setFlexWrap(Wrap.Wrap); root.setWidth(150); root.setHeight(100); @@ -1141,7 +1159,7 @@ test('align_content_stretch_row_with_flex_no_shrink', () => { const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1173,7 +1191,7 @@ test('align_content_stretch_row_with_flex_no_shrink', () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1216,14 +1234,14 @@ test('align_content_stretch_row_with_margin', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignContent(Yoga.ALIGN_STRETCH); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignContent(Align.Stretch); + root.setFlexWrap(Wrap.Wrap); root.setWidth(150); root.setHeight(100); @@ -1232,10 +1250,10 @@ test('align_content_stretch_row_with_margin', () => { root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(config); - root_child1.setMargin(Yoga.EDGE_LEFT, 10); - root_child1.setMargin(Yoga.EDGE_TOP, 10); - root_child1.setMargin(Yoga.EDGE_RIGHT, 10); - root_child1.setMargin(Yoga.EDGE_BOTTOM, 10); + root_child1.setMargin(Edge.Left, 10); + root_child1.setMargin(Edge.Top, 10); + root_child1.setMargin(Edge.Right, 10); + root_child1.setMargin(Edge.Bottom, 10); root_child1.setWidth(50); root.insertChild(root_child1, 1); @@ -1244,17 +1262,17 @@ test('align_content_stretch_row_with_margin', () => { root.insertChild(root_child2, 2); const root_child3 = Yoga.Node.create(config); - root_child3.setMargin(Yoga.EDGE_LEFT, 10); - root_child3.setMargin(Yoga.EDGE_TOP, 10); - root_child3.setMargin(Yoga.EDGE_RIGHT, 10); - root_child3.setMargin(Yoga.EDGE_BOTTOM, 10); + root_child3.setMargin(Edge.Left, 10); + root_child3.setMargin(Edge.Top, 10); + root_child3.setMargin(Edge.Right, 10); + root_child3.setMargin(Edge.Bottom, 10); root_child3.setWidth(50); root.insertChild(root_child3, 3); const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1286,7 +1304,7 @@ test('align_content_stretch_row_with_margin', () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1329,14 +1347,14 @@ test('align_content_stretch_row_with_padding', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignContent(Yoga.ALIGN_STRETCH); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignContent(Align.Stretch); + root.setFlexWrap(Wrap.Wrap); root.setWidth(150); root.setHeight(100); @@ -1345,10 +1363,10 @@ test('align_content_stretch_row_with_padding', () => { root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(config); - root_child1.setPadding(Yoga.EDGE_LEFT, 10); - root_child1.setPadding(Yoga.EDGE_TOP, 10); - root_child1.setPadding(Yoga.EDGE_RIGHT, 10); - root_child1.setPadding(Yoga.EDGE_BOTTOM, 10); + root_child1.setPadding(Edge.Left, 10); + root_child1.setPadding(Edge.Top, 10); + root_child1.setPadding(Edge.Right, 10); + root_child1.setPadding(Edge.Bottom, 10); root_child1.setWidth(50); root.insertChild(root_child1, 1); @@ -1357,17 +1375,17 @@ test('align_content_stretch_row_with_padding', () => { root.insertChild(root_child2, 2); const root_child3 = Yoga.Node.create(config); - root_child3.setPadding(Yoga.EDGE_LEFT, 10); - root_child3.setPadding(Yoga.EDGE_TOP, 10); - root_child3.setPadding(Yoga.EDGE_RIGHT, 10); - root_child3.setPadding(Yoga.EDGE_BOTTOM, 10); + root_child3.setPadding(Edge.Left, 10); + root_child3.setPadding(Edge.Top, 10); + root_child3.setPadding(Edge.Right, 10); + root_child3.setPadding(Edge.Bottom, 10); root_child3.setWidth(50); root.insertChild(root_child3, 3); const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1399,7 +1417,7 @@ test('align_content_stretch_row_with_padding', () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1442,14 +1460,14 @@ test('align_content_stretch_row_with_single_row', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignContent(Yoga.ALIGN_STRETCH); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignContent(Align.Stretch); + root.setFlexWrap(Wrap.Wrap); root.setWidth(150); root.setHeight(100); @@ -1460,7 +1478,7 @@ test('align_content_stretch_row_with_single_row', () => { const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1477,7 +1495,7 @@ test('align_content_stretch_row_with_single_row', () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1505,14 +1523,14 @@ test('align_content_stretch_row_with_fixed_height', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignContent(Yoga.ALIGN_STRETCH); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignContent(Align.Stretch); + root.setFlexWrap(Wrap.Wrap); root.setWidth(150); root.setHeight(100); @@ -1536,7 +1554,7 @@ test('align_content_stretch_row_with_fixed_height', () => { const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1568,7 +1586,7 @@ test('align_content_stretch_row_with_fixed_height', () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1611,14 +1629,14 @@ test('align_content_stretch_row_with_max_height', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignContent(Yoga.ALIGN_STRETCH); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignContent(Align.Stretch); + root.setFlexWrap(Wrap.Wrap); root.setWidth(150); root.setHeight(100); @@ -1642,7 +1660,7 @@ test('align_content_stretch_row_with_max_height', () => { const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1674,7 +1692,7 @@ test('align_content_stretch_row_with_max_height', () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1717,14 +1735,14 @@ test('align_content_stretch_row_with_min_height', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignContent(Yoga.ALIGN_STRETCH); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignContent(Align.Stretch); + root.setFlexWrap(Wrap.Wrap); root.setWidth(150); root.setHeight(100); @@ -1748,7 +1766,7 @@ test('align_content_stretch_row_with_min_height', () => { const root_child4 = Yoga.Node.create(config); root_child4.setWidth(50); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1780,7 +1798,7 @@ test('align_content_stretch_row_with_min_height', () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1823,13 +1841,13 @@ test('align_content_stretch_column', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignContent(Yoga.ALIGN_STRETCH); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setAlignContent(Align.Stretch); + root.setFlexWrap(Wrap.Wrap); root.setWidth(100); root.setHeight(150); @@ -1861,7 +1879,7 @@ test('align_content_stretch_column', () => { const root_child4 = Yoga.Node.create(config); root_child4.setHeight(50); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1898,7 +1916,7 @@ test('align_content_stretch_column', () => { expect(root_child4.getComputedWidth()).toBe(50); expect(root_child4.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1946,27 +1964,27 @@ test('align_content_stretch_is_not_overriding_align_items', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignContent(Yoga.ALIGN_STRETCH); + root.setAlignContent(Align.Stretch); const root_child0 = Yoga.Node.create(config); - root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0.setAlignContent(Yoga.ALIGN_STRETCH); - root_child0.setAlignItems(Yoga.ALIGN_CENTER); + root_child0.setFlexDirection(FlexDirection.Row); + root_child0.setAlignContent(Align.Stretch); + root_child0.setAlignItems(Align.Center); root_child0.setWidth(100); root_child0.setHeight(100); root.insertChild(root_child0, 0); const root_child0_child0 = Yoga.Node.create(config); - root_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); + root_child0_child0.setAlignContent(Align.Stretch); root_child0_child0.setWidth(10); root_child0_child0.setHeight(10); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1983,7 +2001,7 @@ test('align_content_stretch_is_not_overriding_align_items', () => { expect(root_child0_child0.getComputedWidth()).toBe(10); expect(root_child0_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); diff --git a/javascript/tests/generated/YGAlignItemsTest.test.js b/javascript/tests/generated/YGAlignItemsTest.test.ts similarity index 84% rename from javascript/tests/generated/YGAlignItemsTest.test.js rename to javascript/tests/generated/YGAlignItemsTest.test.ts index dd0ae00b..806bbcdf 100644 --- a/javascript/tests/generated/YGAlignItemsTest.test.js +++ b/javascript/tests/generated/YGAlignItemsTest.test.ts @@ -7,12 +7,30 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignItemsTest.html +import {Yoga} from "../tools/globals"; +import { + Align, + Direction, + Display, + Edge, + Errata, + ExperimentalFeature, + FlexDirection, + Gutter, + Justify, + MeasureMode, + Overflow, + PositionType, + Unit, + Wrap, +} from 'yoga-layout'; + test('align_items_stretch', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -22,7 +40,7 @@ test('align_items_stretch', () => { const root_child0 = Yoga.Node.create(config); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -34,7 +52,7 @@ test('align_items_stretch', () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -57,12 +75,12 @@ test('align_items_center', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setAlignItems(Align.Center); root.setWidth(100); root.setHeight(100); @@ -70,7 +88,7 @@ test('align_items_center', () => { root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -82,7 +100,7 @@ test('align_items_center', () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -105,12 +123,12 @@ test('align_items_flex_start', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_FLEX_START); + root.setAlignItems(Align.FlexStart); root.setWidth(100); root.setHeight(100); @@ -118,7 +136,7 @@ test('align_items_flex_start', () => { root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -130,7 +148,7 @@ test('align_items_flex_start', () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -153,12 +171,12 @@ test('align_items_flex_end', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_FLEX_END); + root.setAlignItems(Align.FlexEnd); root.setWidth(100); root.setHeight(100); @@ -166,7 +184,7 @@ test('align_items_flex_end', () => { root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -178,7 +196,7 @@ test('align_items_flex_end', () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -201,13 +219,13 @@ test('align_baseline', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignItems(Yoga.ALIGN_BASELINE); + root.setFlexDirection(FlexDirection.Row); + root.setAlignItems(Align.Baseline); root.setWidth(100); root.setHeight(100); @@ -220,7 +238,7 @@ test('align_baseline', () => { root_child1.setWidth(50); root_child1.setHeight(20); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -237,7 +255,7 @@ test('align_baseline', () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -265,13 +283,13 @@ test('align_baseline_child', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignItems(Yoga.ALIGN_BASELINE); + root.setFlexDirection(FlexDirection.Row); + root.setAlignItems(Align.Baseline); root.setWidth(100); root.setHeight(100); @@ -289,7 +307,7 @@ test('align_baseline_child', () => { root_child1_child0.setWidth(50); root_child1_child0.setHeight(10); root_child1.insertChild(root_child1_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -311,7 +329,7 @@ test('align_baseline_child', () => { expect(root_child1_child0.getComputedWidth()).toBe(50); expect(root_child1_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -344,13 +362,13 @@ test('align_baseline_child_multiline', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignItems(Yoga.ALIGN_BASELINE); + root.setFlexDirection(FlexDirection.Row); + root.setAlignItems(Align.Baseline); root.setWidth(100); root.setHeight(100); @@ -360,8 +378,8 @@ test('align_baseline_child_multiline', () => { root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(config); - root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child1.setFlexWrap(Yoga.WRAP_WRAP); + root_child1.setFlexDirection(FlexDirection.Row); + root_child1.setFlexWrap(Wrap.Wrap); root_child1.setWidth(50); root_child1.setHeight(25); root.insertChild(root_child1, 1); @@ -385,7 +403,7 @@ test('align_baseline_child_multiline', () => { root_child1_child3.setWidth(25); root_child1_child3.setHeight(10); root_child1.insertChild(root_child1_child3, 3); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -422,7 +440,7 @@ test('align_baseline_child_multiline', () => { expect(root_child1_child3.getComputedWidth()).toBe(25); expect(root_child1_child3.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -470,13 +488,13 @@ test('align_baseline_child_multiline_override', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignItems(Yoga.ALIGN_BASELINE); + root.setFlexDirection(FlexDirection.Row); + root.setAlignItems(Align.Baseline); root.setWidth(100); root.setHeight(100); @@ -486,8 +504,8 @@ test('align_baseline_child_multiline_override', () => { root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(config); - root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child1.setFlexWrap(Yoga.WRAP_WRAP); + root_child1.setFlexDirection(FlexDirection.Row); + root_child1.setFlexWrap(Wrap.Wrap); root_child1.setWidth(50); root_child1.setHeight(25); root.insertChild(root_child1, 1); @@ -498,7 +516,7 @@ test('align_baseline_child_multiline_override', () => { root_child1.insertChild(root_child1_child0, 0); const root_child1_child1 = Yoga.Node.create(config); - root_child1_child1.setAlignSelf(Yoga.ALIGN_BASELINE); + root_child1_child1.setAlignSelf(Align.Baseline); root_child1_child1.setWidth(25); root_child1_child1.setHeight(10); root_child1.insertChild(root_child1_child1, 1); @@ -509,11 +527,11 @@ test('align_baseline_child_multiline_override', () => { root_child1.insertChild(root_child1_child2, 2); const root_child1_child3 = Yoga.Node.create(config); - root_child1_child3.setAlignSelf(Yoga.ALIGN_BASELINE); + root_child1_child3.setAlignSelf(Align.Baseline); root_child1_child3.setWidth(25); root_child1_child3.setHeight(10); root_child1.insertChild(root_child1_child3, 3); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -550,7 +568,7 @@ test('align_baseline_child_multiline_override', () => { expect(root_child1_child3.getComputedWidth()).toBe(25); expect(root_child1_child3.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -598,13 +616,13 @@ test('align_baseline_child_multiline_no_override_on_secondline', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignItems(Yoga.ALIGN_BASELINE); + root.setFlexDirection(FlexDirection.Row); + root.setAlignItems(Align.Baseline); root.setWidth(100); root.setHeight(100); @@ -614,8 +632,8 @@ test('align_baseline_child_multiline_no_override_on_secondline', () => { root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(config); - root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child1.setFlexWrap(Yoga.WRAP_WRAP); + root_child1.setFlexDirection(FlexDirection.Row); + root_child1.setFlexWrap(Wrap.Wrap); root_child1.setWidth(50); root_child1.setHeight(25); root.insertChild(root_child1, 1); @@ -636,11 +654,11 @@ test('align_baseline_child_multiline_no_override_on_secondline', () => { root_child1.insertChild(root_child1_child2, 2); const root_child1_child3 = Yoga.Node.create(config); - root_child1_child3.setAlignSelf(Yoga.ALIGN_BASELINE); + root_child1_child3.setAlignSelf(Align.Baseline); root_child1_child3.setWidth(25); root_child1_child3.setHeight(10); root_child1.insertChild(root_child1_child3, 3); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -677,7 +695,7 @@ test('align_baseline_child_multiline_no_override_on_secondline', () => { expect(root_child1_child3.getComputedWidth()).toBe(25); expect(root_child1_child3.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -725,18 +743,18 @@ test('align_baseline_child_top', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignItems(Yoga.ALIGN_BASELINE); + root.setFlexDirection(FlexDirection.Row); + root.setAlignItems(Align.Baseline); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setPosition(Yoga.EDGE_TOP, 10); + root_child0.setPosition(Edge.Top, 10); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); @@ -750,7 +768,7 @@ test('align_baseline_child_top', () => { root_child1_child0.setWidth(50); root_child1_child0.setHeight(10); root_child1.insertChild(root_child1_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -772,7 +790,7 @@ test('align_baseline_child_top', () => { expect(root_child1_child0.getComputedWidth()).toBe(50); expect(root_child1_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -805,13 +823,13 @@ test('align_baseline_child_top2', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignItems(Yoga.ALIGN_BASELINE); + root.setFlexDirection(FlexDirection.Row); + root.setAlignItems(Align.Baseline); root.setWidth(100); root.setHeight(100); @@ -821,7 +839,7 @@ test('align_baseline_child_top2', () => { root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(config); - root_child1.setPosition(Yoga.EDGE_TOP, 5); + root_child1.setPosition(Edge.Top, 5); root_child1.setWidth(50); root_child1.setHeight(20); root.insertChild(root_child1, 1); @@ -830,7 +848,7 @@ test('align_baseline_child_top2', () => { root_child1_child0.setWidth(50); root_child1_child0.setHeight(10); root_child1.insertChild(root_child1_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -852,7 +870,7 @@ test('align_baseline_child_top2', () => { expect(root_child1_child0.getComputedWidth()).toBe(50); expect(root_child1_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -885,13 +903,13 @@ test('align_baseline_double_nested_child', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignItems(Yoga.ALIGN_BASELINE); + root.setFlexDirection(FlexDirection.Row); + root.setAlignItems(Align.Baseline); root.setWidth(100); root.setHeight(100); @@ -914,7 +932,7 @@ test('align_baseline_double_nested_child', () => { root_child1_child0.setWidth(50); root_child1_child0.setHeight(15); root_child1.insertChild(root_child1_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -941,7 +959,7 @@ test('align_baseline_double_nested_child', () => { expect(root_child1_child0.getComputedWidth()).toBe(50); expect(root_child1_child0.getComputedHeight()).toBe(15); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -979,12 +997,12 @@ test('align_baseline_column', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_BASELINE); + root.setAlignItems(Align.Baseline); root.setWidth(100); root.setHeight(100); @@ -997,7 +1015,7 @@ test('align_baseline_column', () => { root_child1.setWidth(50); root_child1.setHeight(20); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1014,7 +1032,7 @@ test('align_baseline_column', () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1042,21 +1060,21 @@ test('align_baseline_child_margin', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignItems(Yoga.ALIGN_BASELINE); + root.setFlexDirection(FlexDirection.Row); + root.setAlignItems(Align.Baseline); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_LEFT, 5); - root_child0.setMargin(Yoga.EDGE_TOP, 5); - root_child0.setMargin(Yoga.EDGE_RIGHT, 5); - root_child0.setMargin(Yoga.EDGE_BOTTOM, 5); + root_child0.setMargin(Edge.Left, 5); + root_child0.setMargin(Edge.Top, 5); + root_child0.setMargin(Edge.Right, 5); + root_child0.setMargin(Edge.Bottom, 5); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); @@ -1067,14 +1085,14 @@ test('align_baseline_child_margin', () => { root.insertChild(root_child1, 1); const root_child1_child0 = Yoga.Node.create(config); - root_child1_child0.setMargin(Yoga.EDGE_LEFT, 1); - root_child1_child0.setMargin(Yoga.EDGE_TOP, 1); - root_child1_child0.setMargin(Yoga.EDGE_RIGHT, 1); - root_child1_child0.setMargin(Yoga.EDGE_BOTTOM, 1); + root_child1_child0.setMargin(Edge.Left, 1); + root_child1_child0.setMargin(Edge.Top, 1); + root_child1_child0.setMargin(Edge.Right, 1); + root_child1_child0.setMargin(Edge.Bottom, 1); root_child1_child0.setWidth(50); root_child1_child0.setHeight(10); root_child1.insertChild(root_child1_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1096,7 +1114,7 @@ test('align_baseline_child_margin', () => { expect(root_child1_child0.getComputedWidth()).toBe(50); expect(root_child1_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1129,17 +1147,17 @@ test('align_baseline_child_padding', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignItems(Yoga.ALIGN_BASELINE); - root.setPadding(Yoga.EDGE_LEFT, 5); - root.setPadding(Yoga.EDGE_TOP, 5); - root.setPadding(Yoga.EDGE_RIGHT, 5); - root.setPadding(Yoga.EDGE_BOTTOM, 5); + root.setFlexDirection(FlexDirection.Row); + root.setAlignItems(Align.Baseline); + root.setPadding(Edge.Left, 5); + root.setPadding(Edge.Top, 5); + root.setPadding(Edge.Right, 5); + root.setPadding(Edge.Bottom, 5); root.setWidth(100); root.setHeight(100); @@ -1149,10 +1167,10 @@ test('align_baseline_child_padding', () => { root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(config); - root_child1.setPadding(Yoga.EDGE_LEFT, 5); - root_child1.setPadding(Yoga.EDGE_TOP, 5); - root_child1.setPadding(Yoga.EDGE_RIGHT, 5); - root_child1.setPadding(Yoga.EDGE_BOTTOM, 5); + root_child1.setPadding(Edge.Left, 5); + root_child1.setPadding(Edge.Top, 5); + root_child1.setPadding(Edge.Right, 5); + root_child1.setPadding(Edge.Bottom, 5); root_child1.setWidth(50); root_child1.setHeight(20); root.insertChild(root_child1, 1); @@ -1161,7 +1179,7 @@ test('align_baseline_child_padding', () => { root_child1_child0.setWidth(50); root_child1_child0.setHeight(10); root_child1.insertChild(root_child1_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1183,7 +1201,7 @@ test('align_baseline_child_padding', () => { expect(root_child1_child0.getComputedWidth()).toBe(50); expect(root_child1_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1216,14 +1234,14 @@ test('align_baseline_multiline', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignItems(Yoga.ALIGN_BASELINE); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignItems(Align.Baseline); + root.setFlexWrap(Wrap.Wrap); root.setWidth(100); root.setHeight(100); @@ -1256,7 +1274,7 @@ test('align_baseline_multiline', () => { root_child3.setWidth(50); root_child3.setHeight(50); root.insertChild(root_child3, 3); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1293,7 +1311,7 @@ test('align_baseline_multiline', () => { expect(root_child3.getComputedWidth()).toBe(50); expect(root_child3.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1341,13 +1359,13 @@ test.skip('align_baseline_multiline_column', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_BASELINE); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setAlignItems(Align.Baseline); + root.setFlexWrap(Wrap.Wrap); root.setWidth(100); root.setHeight(100); @@ -1380,7 +1398,7 @@ test.skip('align_baseline_multiline_column', () => { root_child3.setWidth(50); root_child3.setHeight(20); root.insertChild(root_child3, 3); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1417,7 +1435,7 @@ test.skip('align_baseline_multiline_column', () => { expect(root_child3.getComputedWidth()).toBe(50); expect(root_child3.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1465,13 +1483,13 @@ test.skip('align_baseline_multiline_column2', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_BASELINE); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setAlignItems(Align.Baseline); + root.setFlexWrap(Wrap.Wrap); root.setWidth(100); root.setHeight(100); @@ -1504,7 +1522,7 @@ test.skip('align_baseline_multiline_column2', () => { root_child3.setWidth(50); root_child3.setHeight(20); root.insertChild(root_child3, 3); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1541,7 +1559,7 @@ test.skip('align_baseline_multiline_column2', () => { expect(root_child3.getComputedWidth()).toBe(50); expect(root_child3.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1589,14 +1607,14 @@ test('align_baseline_multiline_row_and_column', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignItems(Yoga.ALIGN_BASELINE); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignItems(Align.Baseline); + root.setFlexWrap(Wrap.Wrap); root.setWidth(100); root.setHeight(100); @@ -1629,7 +1647,7 @@ test('align_baseline_multiline_row_and_column', () => { root_child3.setWidth(50); root_child3.setHeight(20); root.insertChild(root_child3, 3); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1666,7 +1684,7 @@ test('align_baseline_multiline_row_and_column', () => { expect(root_child3.getComputedWidth()).toBe(50); expect(root_child3.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1714,27 +1732,27 @@ test('align_items_center_child_with_margin_bigger_than_parent', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setJustifyContent(Justify.Center); + root.setAlignItems(Align.Center); root.setWidth(52); root.setHeight(52); const root_child0 = Yoga.Node.create(config); - root_child0.setAlignItems(Yoga.ALIGN_CENTER); + root_child0.setAlignItems(Align.Center); root.insertChild(root_child0, 0); const root_child0_child0 = Yoga.Node.create(config); - root_child0_child0.setMargin(Yoga.EDGE_LEFT, 10); - root_child0_child0.setMargin(Yoga.EDGE_RIGHT, 10); + root_child0_child0.setMargin(Edge.Left, 10); + root_child0_child0.setMargin(Edge.Right, 10); root_child0_child0.setWidth(52); root_child0_child0.setHeight(52); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1751,7 +1769,7 @@ test('align_items_center_child_with_margin_bigger_than_parent', () => { expect(root_child0_child0.getComputedWidth()).toBe(52); expect(root_child0_child0.getComputedHeight()).toBe(52); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1779,27 +1797,27 @@ test('align_items_flex_end_child_with_margin_bigger_than_parent', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setJustifyContent(Justify.Center); + root.setAlignItems(Align.Center); root.setWidth(52); root.setHeight(52); const root_child0 = Yoga.Node.create(config); - root_child0.setAlignItems(Yoga.ALIGN_FLEX_END); + root_child0.setAlignItems(Align.FlexEnd); root.insertChild(root_child0, 0); const root_child0_child0 = Yoga.Node.create(config); - root_child0_child0.setMargin(Yoga.EDGE_LEFT, 10); - root_child0_child0.setMargin(Yoga.EDGE_RIGHT, 10); + root_child0_child0.setMargin(Edge.Left, 10); + root_child0_child0.setMargin(Edge.Right, 10); root_child0_child0.setWidth(52); root_child0_child0.setHeight(52); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1816,7 +1834,7 @@ test('align_items_flex_end_child_with_margin_bigger_than_parent', () => { expect(root_child0_child0.getComputedWidth()).toBe(52); expect(root_child0_child0.getComputedHeight()).toBe(52); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1844,25 +1862,25 @@ test('align_items_center_child_without_margin_bigger_than_parent', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setJustifyContent(Justify.Center); + root.setAlignItems(Align.Center); root.setWidth(52); root.setHeight(52); const root_child0 = Yoga.Node.create(config); - root_child0.setAlignItems(Yoga.ALIGN_CENTER); + root_child0.setAlignItems(Align.Center); root.insertChild(root_child0, 0); const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setWidth(72); root_child0_child0.setHeight(72); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1879,7 +1897,7 @@ test('align_items_center_child_without_margin_bigger_than_parent', () => { expect(root_child0_child0.getComputedWidth()).toBe(72); expect(root_child0_child0.getComputedHeight()).toBe(72); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1907,25 +1925,25 @@ test('align_items_flex_end_child_without_margin_bigger_than_parent', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setJustifyContent(Justify.Center); + root.setAlignItems(Align.Center); root.setWidth(52); root.setHeight(52); const root_child0 = Yoga.Node.create(config); - root_child0.setAlignItems(Yoga.ALIGN_FLEX_END); + root_child0.setAlignItems(Align.FlexEnd); root.insertChild(root_child0, 0); const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setWidth(72); root_child0_child0.setHeight(72); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1942,7 +1960,7 @@ test('align_items_flex_end_child_without_margin_bigger_than_parent', () => { expect(root_child0_child0.getComputedWidth()).toBe(72); expect(root_child0_child0.getComputedHeight()).toBe(72); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1970,18 +1988,18 @@ test('align_center_should_size_based_on_content', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_CENTER); - root.setMargin(Yoga.EDGE_TOP, 20); + root.setAlignItems(Align.Center); + root.setMargin(Edge.Top, 20); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setJustifyContent(Yoga.JUSTIFY_CENTER); + root_child0.setJustifyContent(Justify.Center); root_child0.setFlexShrink(1); root.insertChild(root_child0, 0); @@ -1994,7 +2012,7 @@ test('align_center_should_size_based_on_content', () => { root_child0_child0_child0.setWidth(20); root_child0_child0_child0.setHeight(20); root_child0_child0.insertChild(root_child0_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(20); @@ -2016,7 +2034,7 @@ test('align_center_should_size_based_on_content', () => { expect(root_child0_child0_child0.getComputedWidth()).toBe(20); expect(root_child0_child0_child0.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(20); @@ -2049,17 +2067,17 @@ test('align_stretch_should_size_based_on_parent', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setMargin(Yoga.EDGE_TOP, 20); + root.setMargin(Edge.Top, 20); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setJustifyContent(Yoga.JUSTIFY_CENTER); + root_child0.setJustifyContent(Justify.Center); root_child0.setFlexShrink(1); root.insertChild(root_child0, 0); @@ -2072,7 +2090,7 @@ test('align_stretch_should_size_based_on_parent', () => { root_child0_child0_child0.setWidth(20); root_child0_child0_child0.setHeight(20); root_child0_child0.insertChild(root_child0_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(20); @@ -2094,7 +2112,7 @@ test('align_stretch_should_size_based_on_parent', () => { expect(root_child0_child0_child0.getComputedWidth()).toBe(20); expect(root_child0_child0_child0.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(20); @@ -2127,8 +2145,8 @@ test('align_flex_start_with_shrinking_children', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -2136,7 +2154,7 @@ test('align_flex_start_with_shrinking_children', () => { root.setHeight(500); const root_child0 = Yoga.Node.create(config); - root_child0.setAlignItems(Yoga.ALIGN_FLEX_START); + root_child0.setAlignItems(Align.FlexStart); root.insertChild(root_child0, 0); const root_child0_child0 = Yoga.Node.create(config); @@ -2148,7 +2166,7 @@ test('align_flex_start_with_shrinking_children', () => { root_child0_child0_child0.setFlexGrow(1); root_child0_child0_child0.setFlexShrink(1); root_child0_child0.insertChild(root_child0_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2170,7 +2188,7 @@ test('align_flex_start_with_shrinking_children', () => { expect(root_child0_child0_child0.getComputedWidth()).toBe(0); expect(root_child0_child0_child0.getComputedHeight()).toBe(0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2203,8 +2221,8 @@ test('align_flex_start_with_stretching_children', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -2223,7 +2241,7 @@ test('align_flex_start_with_stretching_children', () => { root_child0_child0_child0.setFlexGrow(1); root_child0_child0_child0.setFlexShrink(1); root_child0_child0.insertChild(root_child0_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2245,7 +2263,7 @@ test('align_flex_start_with_stretching_children', () => { expect(root_child0_child0_child0.getComputedWidth()).toBe(500); expect(root_child0_child0_child0.getComputedHeight()).toBe(0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2278,8 +2296,8 @@ test('align_flex_start_with_shrinking_children_with_stretch', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -2287,7 +2305,7 @@ test('align_flex_start_with_shrinking_children_with_stretch', () => { root.setHeight(500); const root_child0 = Yoga.Node.create(config); - root_child0.setAlignItems(Yoga.ALIGN_FLEX_START); + root_child0.setAlignItems(Align.FlexStart); root.insertChild(root_child0, 0); const root_child0_child0 = Yoga.Node.create(config); @@ -2299,7 +2317,7 @@ test('align_flex_start_with_shrinking_children_with_stretch', () => { root_child0_child0_child0.setFlexGrow(1); root_child0_child0_child0.setFlexShrink(1); root_child0_child0.insertChild(root_child0_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2321,7 +2339,7 @@ test('align_flex_start_with_shrinking_children_with_stretch', () => { expect(root_child0_child0_child0.getComputedWidth()).toBe(0); expect(root_child0_child0_child0.getComputedHeight()).toBe(0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); diff --git a/javascript/tests/generated/YGAlignSelfTest.test.js b/javascript/tests/generated/YGAlignSelfTest.test.ts similarity index 77% rename from javascript/tests/generated/YGAlignSelfTest.test.js rename to javascript/tests/generated/YGAlignSelfTest.test.ts index 518b1e70..b179160a 100644 --- a/javascript/tests/generated/YGAlignSelfTest.test.js +++ b/javascript/tests/generated/YGAlignSelfTest.test.ts @@ -7,12 +7,30 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAlignSelfTest.html +import {Yoga} from "../tools/globals"; +import { + Align, + Direction, + Display, + Edge, + Errata, + ExperimentalFeature, + FlexDirection, + Gutter, + Justify, + MeasureMode, + Overflow, + PositionType, + Unit, + Wrap, +} from 'yoga-layout'; + test('align_self_center', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -20,11 +38,11 @@ test('align_self_center', () => { root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setAlignSelf(Yoga.ALIGN_CENTER); + root_child0.setAlignSelf(Align.Center); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -36,7 +54,7 @@ test('align_self_center', () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -59,8 +77,8 @@ test('align_self_flex_end', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -68,11 +86,11 @@ test('align_self_flex_end', () => { root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setAlignSelf(Yoga.ALIGN_FLEX_END); + root_child0.setAlignSelf(Align.FlexEnd); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -84,7 +102,7 @@ test('align_self_flex_end', () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -107,8 +125,8 @@ test('align_self_flex_start', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -116,11 +134,11 @@ test('align_self_flex_start', () => { root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setAlignSelf(Yoga.ALIGN_FLEX_START); + root_child0.setAlignSelf(Align.FlexStart); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -132,7 +150,7 @@ test('align_self_flex_start', () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -155,21 +173,21 @@ test('align_self_flex_end_override_flex_start', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_FLEX_START); + root.setAlignItems(Align.FlexStart); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setAlignSelf(Yoga.ALIGN_FLEX_END); + root_child0.setAlignSelf(Align.FlexEnd); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -181,7 +199,7 @@ test('align_self_flex_end_override_flex_start', () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -204,23 +222,23 @@ test('align_self_baseline', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setAlignSelf(Yoga.ALIGN_BASELINE); + root_child0.setAlignSelf(Align.Baseline); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(config); - root_child1.setAlignSelf(Yoga.ALIGN_BASELINE); + root_child1.setAlignSelf(Align.Baseline); root_child1.setWidth(50); root_child1.setHeight(20); root.insertChild(root_child1, 1); @@ -229,7 +247,7 @@ test('align_self_baseline', () => { root_child1_child0.setWidth(50); root_child1_child0.setHeight(10); root_child1.insertChild(root_child1_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -251,7 +269,7 @@ test('align_self_baseline', () => { expect(root_child1_child0.getComputedWidth()).toBe(50); expect(root_child1_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); diff --git a/javascript/tests/generated/YGAndroidNewsFeed.test.js b/javascript/tests/generated/YGAndroidNewsFeed.test.ts similarity index 83% rename from javascript/tests/generated/YGAndroidNewsFeed.test.js rename to javascript/tests/generated/YGAndroidNewsFeed.test.ts index be8255fb..0384cf06 100644 --- a/javascript/tests/generated/YGAndroidNewsFeed.test.js +++ b/javascript/tests/generated/YGAndroidNewsFeed.test.ts @@ -7,113 +7,131 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGAndroidNewsFeed.html +import {Yoga} from "../tools/globals"; +import { + Align, + Direction, + Display, + Edge, + Errata, + ExperimentalFeature, + FlexDirection, + Gutter, + Justify, + MeasureMode, + Overflow, + PositionType, + Unit, + Wrap, +} from 'yoga-layout'; + test('android_news_feed', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignContent(Yoga.ALIGN_STRETCH); + root.setAlignContent(Align.Stretch); root.setWidth(1080); const root_child0 = Yoga.Node.create(config); root.insertChild(root_child0, 0); const root_child0_child0 = Yoga.Node.create(config); - root_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); + root_child0_child0.setAlignContent(Align.Stretch); root_child0.insertChild(root_child0_child0, 0); const root_child0_child0_child0 = Yoga.Node.create(config); - root_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); + root_child0_child0_child0.setAlignContent(Align.Stretch); root_child0_child0.insertChild(root_child0_child0_child0, 0); const root_child0_child0_child0_child0 = Yoga.Node.create(config); - root_child0_child0_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); - root_child0_child0_child0_child0.setAlignItems(Yoga.ALIGN_FLEX_START); - root_child0_child0_child0_child0.setMargin(Yoga.EDGE_START, 36); - root_child0_child0_child0_child0.setMargin(Yoga.EDGE_TOP, 24); + root_child0_child0_child0_child0.setFlexDirection(FlexDirection.Row); + root_child0_child0_child0_child0.setAlignContent(Align.Stretch); + root_child0_child0_child0_child0.setAlignItems(Align.FlexStart); + root_child0_child0_child0_child0.setMargin(Edge.Start, 36); + root_child0_child0_child0_child0.setMargin(Edge.Top, 24); root_child0_child0_child0.insertChild(root_child0_child0_child0_child0, 0); const root_child0_child0_child0_child0_child0 = Yoga.Node.create(config); - root_child0_child0_child0_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0_child0_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); + root_child0_child0_child0_child0_child0.setFlexDirection(FlexDirection.Row); + root_child0_child0_child0_child0_child0.setAlignContent(Align.Stretch); root_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child0, 0); const root_child0_child0_child0_child0_child0_child0 = Yoga.Node.create(config); - root_child0_child0_child0_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); + root_child0_child0_child0_child0_child0_child0.setAlignContent(Align.Stretch); root_child0_child0_child0_child0_child0_child0.setWidth(120); root_child0_child0_child0_child0_child0_child0.setHeight(120); root_child0_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child0_child0, 0); const root_child0_child0_child0_child0_child1 = Yoga.Node.create(config); - root_child0_child0_child0_child0_child1.setAlignContent(Yoga.ALIGN_STRETCH); + root_child0_child0_child0_child0_child1.setAlignContent(Align.Stretch); root_child0_child0_child0_child0_child1.setFlexShrink(1); - root_child0_child0_child0_child0_child1.setMargin(Yoga.EDGE_RIGHT, 36); - root_child0_child0_child0_child0_child1.setPadding(Yoga.EDGE_LEFT, 36); - root_child0_child0_child0_child0_child1.setPadding(Yoga.EDGE_TOP, 21); - root_child0_child0_child0_child0_child1.setPadding(Yoga.EDGE_RIGHT, 36); - root_child0_child0_child0_child0_child1.setPadding(Yoga.EDGE_BOTTOM, 18); + root_child0_child0_child0_child0_child1.setMargin(Edge.Right, 36); + root_child0_child0_child0_child0_child1.setPadding(Edge.Left, 36); + root_child0_child0_child0_child0_child1.setPadding(Edge.Top, 21); + root_child0_child0_child0_child0_child1.setPadding(Edge.Right, 36); + root_child0_child0_child0_child0_child1.setPadding(Edge.Bottom, 18); root_child0_child0_child0_child0.insertChild(root_child0_child0_child0_child0_child1, 1); const root_child0_child0_child0_child0_child1_child0 = Yoga.Node.create(config); - root_child0_child0_child0_child0_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0_child0_child0_child0_child1_child0.setAlignContent(Yoga.ALIGN_STRETCH); + root_child0_child0_child0_child0_child1_child0.setFlexDirection(FlexDirection.Row); + root_child0_child0_child0_child0_child1_child0.setAlignContent(Align.Stretch); root_child0_child0_child0_child0_child1_child0.setFlexShrink(1); root_child0_child0_child0_child0_child1.insertChild(root_child0_child0_child0_child0_child1_child0, 0); const root_child0_child0_child0_child0_child1_child1 = Yoga.Node.create(config); - root_child0_child0_child0_child0_child1_child1.setAlignContent(Yoga.ALIGN_STRETCH); + root_child0_child0_child0_child0_child1_child1.setAlignContent(Align.Stretch); root_child0_child0_child0_child0_child1_child1.setFlexShrink(1); root_child0_child0_child0_child0_child1.insertChild(root_child0_child0_child0_child0_child1_child1, 1); const root_child0_child0_child1 = Yoga.Node.create(config); - root_child0_child0_child1.setAlignContent(Yoga.ALIGN_STRETCH); + root_child0_child0_child1.setAlignContent(Align.Stretch); root_child0_child0.insertChild(root_child0_child0_child1, 1); const root_child0_child0_child1_child0 = Yoga.Node.create(config); - root_child0_child0_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0_child0_child1_child0.setAlignContent(Yoga.ALIGN_STRETCH); - root_child0_child0_child1_child0.setAlignItems(Yoga.ALIGN_FLEX_START); - root_child0_child0_child1_child0.setMargin(Yoga.EDGE_START, 174); - root_child0_child0_child1_child0.setMargin(Yoga.EDGE_TOP, 24); + root_child0_child0_child1_child0.setFlexDirection(FlexDirection.Row); + root_child0_child0_child1_child0.setAlignContent(Align.Stretch); + root_child0_child0_child1_child0.setAlignItems(Align.FlexStart); + root_child0_child0_child1_child0.setMargin(Edge.Start, 174); + root_child0_child0_child1_child0.setMargin(Edge.Top, 24); root_child0_child0_child1.insertChild(root_child0_child0_child1_child0, 0); const root_child0_child0_child1_child0_child0 = Yoga.Node.create(config); - root_child0_child0_child1_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0_child0_child1_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); + root_child0_child0_child1_child0_child0.setFlexDirection(FlexDirection.Row); + root_child0_child0_child1_child0_child0.setAlignContent(Align.Stretch); root_child0_child0_child1_child0.insertChild(root_child0_child0_child1_child0_child0, 0); const root_child0_child0_child1_child0_child0_child0 = Yoga.Node.create(config); - root_child0_child0_child1_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); + root_child0_child0_child1_child0_child0_child0.setAlignContent(Align.Stretch); root_child0_child0_child1_child0_child0_child0.setWidth(72); root_child0_child0_child1_child0_child0_child0.setHeight(72); root_child0_child0_child1_child0_child0.insertChild(root_child0_child0_child1_child0_child0_child0, 0); const root_child0_child0_child1_child0_child1 = Yoga.Node.create(config); - root_child0_child0_child1_child0_child1.setAlignContent(Yoga.ALIGN_STRETCH); + root_child0_child0_child1_child0_child1.setAlignContent(Align.Stretch); root_child0_child0_child1_child0_child1.setFlexShrink(1); - root_child0_child0_child1_child0_child1.setMargin(Yoga.EDGE_RIGHT, 36); - root_child0_child0_child1_child0_child1.setPadding(Yoga.EDGE_LEFT, 36); - root_child0_child0_child1_child0_child1.setPadding(Yoga.EDGE_TOP, 21); - root_child0_child0_child1_child0_child1.setPadding(Yoga.EDGE_RIGHT, 36); - root_child0_child0_child1_child0_child1.setPadding(Yoga.EDGE_BOTTOM, 18); + root_child0_child0_child1_child0_child1.setMargin(Edge.Right, 36); + root_child0_child0_child1_child0_child1.setPadding(Edge.Left, 36); + root_child0_child0_child1_child0_child1.setPadding(Edge.Top, 21); + root_child0_child0_child1_child0_child1.setPadding(Edge.Right, 36); + root_child0_child0_child1_child0_child1.setPadding(Edge.Bottom, 18); root_child0_child0_child1_child0.insertChild(root_child0_child0_child1_child0_child1, 1); const root_child0_child0_child1_child0_child1_child0 = Yoga.Node.create(config); - root_child0_child0_child1_child0_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0_child0_child1_child0_child1_child0.setAlignContent(Yoga.ALIGN_STRETCH); + root_child0_child0_child1_child0_child1_child0.setFlexDirection(FlexDirection.Row); + root_child0_child0_child1_child0_child1_child0.setAlignContent(Align.Stretch); root_child0_child0_child1_child0_child1_child0.setFlexShrink(1); root_child0_child0_child1_child0_child1.insertChild(root_child0_child0_child1_child0_child1_child0, 0); const root_child0_child0_child1_child0_child1_child1 = Yoga.Node.create(config); - root_child0_child0_child1_child0_child1_child1.setAlignContent(Yoga.ALIGN_STRETCH); + root_child0_child0_child1_child0_child1_child1.setAlignContent(Align.Stretch); root_child0_child0_child1_child0_child1_child1.setFlexShrink(1); root_child0_child0_child1_child0_child1.insertChild(root_child0_child0_child1_child0_child1_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -200,7 +218,7 @@ test('android_news_feed', () => { expect(root_child0_child0_child1_child0_child1_child1.getComputedWidth()).toBe(0); expect(root_child0_child0_child1_child0_child1_child1.getComputedHeight()).toBe(0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); diff --git a/javascript/tests/generated/YGBorderTest.test.js b/javascript/tests/generated/YGBorderTest.test.ts similarity index 68% rename from javascript/tests/generated/YGBorderTest.test.js rename to javascript/tests/generated/YGBorderTest.test.ts index 2f15b840..500243cd 100644 --- a/javascript/tests/generated/YGBorderTest.test.js +++ b/javascript/tests/generated/YGBorderTest.test.ts @@ -7,27 +7,45 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGBorderTest.html +import {Yoga} from "../tools/globals"; +import { + Align, + Direction, + Display, + Edge, + Errata, + ExperimentalFeature, + FlexDirection, + Gutter, + Justify, + MeasureMode, + Overflow, + PositionType, + Unit, + Wrap, +} from 'yoga-layout'; + test('border_no_size', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setBorder(Yoga.EDGE_LEFT, 10); - root.setBorder(Yoga.EDGE_TOP, 10); - root.setBorder(Yoga.EDGE_RIGHT, 10); - root.setBorder(Yoga.EDGE_BOTTOM, 10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.setBorder(Edge.Left, 10); + root.setBorder(Edge.Top, 10); + root.setBorder(Edge.Right, 10); + root.setBorder(Edge.Bottom, 10); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); expect(root.getComputedWidth()).toBe(20); expect(root.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -45,21 +63,21 @@ test('border_container_match_child', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setBorder(Yoga.EDGE_LEFT, 10); - root.setBorder(Yoga.EDGE_TOP, 10); - root.setBorder(Yoga.EDGE_RIGHT, 10); - root.setBorder(Yoga.EDGE_BOTTOM, 10); + root.setBorder(Edge.Left, 10); + root.setBorder(Edge.Top, 10); + root.setBorder(Edge.Right, 10); + root.setBorder(Edge.Bottom, 10); const root_child0 = Yoga.Node.create(config); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -71,7 +89,7 @@ test('border_container_match_child', () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -94,15 +112,15 @@ test('border_flex_child', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setBorder(Yoga.EDGE_LEFT, 10); - root.setBorder(Yoga.EDGE_TOP, 10); - root.setBorder(Yoga.EDGE_RIGHT, 10); - root.setBorder(Yoga.EDGE_BOTTOM, 10); + root.setBorder(Edge.Left, 10); + root.setBorder(Edge.Top, 10); + root.setBorder(Edge.Right, 10); + root.setBorder(Edge.Bottom, 10); root.setWidth(100); root.setHeight(100); @@ -110,7 +128,7 @@ test('border_flex_child', () => { root_child0.setFlexGrow(1); root_child0.setWidth(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -122,7 +140,7 @@ test('border_flex_child', () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(80); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -145,22 +163,22 @@ test('border_stretch_child', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setBorder(Yoga.EDGE_LEFT, 10); - root.setBorder(Yoga.EDGE_TOP, 10); - root.setBorder(Yoga.EDGE_RIGHT, 10); - root.setBorder(Yoga.EDGE_BOTTOM, 10); + root.setBorder(Edge.Left, 10); + root.setBorder(Edge.Top, 10); + root.setBorder(Edge.Right, 10); + root.setBorder(Edge.Bottom, 10); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -172,7 +190,7 @@ test('border_stretch_child', () => { expect(root_child0.getComputedWidth()).toBe(80); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -195,16 +213,16 @@ test('border_center_child', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); - root.setAlignItems(Yoga.ALIGN_CENTER); - root.setBorder(Yoga.EDGE_START, 10); - root.setBorder(Yoga.EDGE_END, 20); - root.setBorder(Yoga.EDGE_BOTTOM, 20); + root.setJustifyContent(Justify.Center); + root.setAlignItems(Align.Center); + root.setBorder(Edge.Start, 10); + root.setBorder(Edge.End, 20); + root.setBorder(Edge.Bottom, 20); root.setWidth(100); root.setHeight(100); @@ -212,7 +230,7 @@ test('border_center_child', () => { root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -224,7 +242,7 @@ test('border_center_child', () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); diff --git a/javascript/tests/generated/YGDimensionTest.test.js b/javascript/tests/generated/YGDimensionTest.test.ts similarity index 78% rename from javascript/tests/generated/YGDimensionTest.test.js rename to javascript/tests/generated/YGDimensionTest.test.ts index 8693958e..7f2a8e4d 100644 --- a/javascript/tests/generated/YGDimensionTest.test.js +++ b/javascript/tests/generated/YGDimensionTest.test.ts @@ -7,12 +7,30 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGDimensionTest.html +import {Yoga} from "../tools/globals"; +import { + Align, + Direction, + Display, + Edge, + Errata, + ExperimentalFeature, + FlexDirection, + Gutter, + Justify, + MeasureMode, + Overflow, + PositionType, + Unit, + Wrap, +} from 'yoga-layout'; + test('wrap_child', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -21,7 +39,7 @@ test('wrap_child', () => { root_child0.setWidth(100); root_child0.setHeight(100); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -33,7 +51,7 @@ test('wrap_child', () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -56,8 +74,8 @@ test('wrap_grandchild', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -69,7 +87,7 @@ test('wrap_grandchild', () => { root_child0_child0.setWidth(100); root_child0_child0.setHeight(100); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -86,7 +104,7 @@ test('wrap_grandchild', () => { expect(root_child0_child0.getComputedWidth()).toBe(100); expect(root_child0_child0.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); diff --git a/javascript/tests/generated/YGDisplayTest.test.js b/javascript/tests/generated/YGDisplayTest.test.ts similarity index 79% rename from javascript/tests/generated/YGDisplayTest.test.js rename to javascript/tests/generated/YGDisplayTest.test.ts index f634928d..d05309d1 100644 --- a/javascript/tests/generated/YGDisplayTest.test.js +++ b/javascript/tests/generated/YGDisplayTest.test.ts @@ -7,16 +7,34 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGDisplayTest.html +import {Yoga} from "../tools/globals"; +import { + Align, + Direction, + Display, + Edge, + Errata, + ExperimentalFeature, + FlexDirection, + Gutter, + Justify, + MeasureMode, + Overflow, + PositionType, + Unit, + Wrap, +} from 'yoga-layout'; + test('display_none', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(100); root.setHeight(100); @@ -26,9 +44,9 @@ test('display_none', () => { const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); - root_child1.setDisplay(Yoga.DISPLAY_NONE); + root_child1.setDisplay(Display.None); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -45,7 +63,7 @@ test('display_none', () => { expect(root_child1.getComputedWidth()).toBe(0); expect(root_child1.getComputedHeight()).toBe(0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -73,12 +91,12 @@ test('display_none_fixed_size', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(100); root.setHeight(100); @@ -89,9 +107,9 @@ test('display_none_fixed_size', () => { const root_child1 = Yoga.Node.create(config); root_child1.setWidth(20); root_child1.setHeight(20); - root_child1.setDisplay(Yoga.DISPLAY_NONE); + root_child1.setDisplay(Display.None); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -108,7 +126,7 @@ test('display_none_fixed_size', () => { expect(root_child1.getComputedWidth()).toBe(0); expect(root_child1.getComputedHeight()).toBe(0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -136,29 +154,29 @@ test('display_none_with_margin', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_LEFT, 10); - root_child0.setMargin(Yoga.EDGE_TOP, 10); - root_child0.setMargin(Yoga.EDGE_RIGHT, 10); - root_child0.setMargin(Yoga.EDGE_BOTTOM, 10); + root_child0.setMargin(Edge.Left, 10); + root_child0.setMargin(Edge.Top, 10); + root_child0.setMargin(Edge.Right, 10); + root_child0.setMargin(Edge.Bottom, 10); root_child0.setWidth(20); root_child0.setHeight(20); - root_child0.setDisplay(Yoga.DISPLAY_NONE); + root_child0.setDisplay(Display.None); root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -175,7 +193,7 @@ test('display_none_with_margin', () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -203,12 +221,12 @@ test('display_none_with_child', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(100); root.setHeight(100); @@ -222,7 +240,7 @@ test('display_none_with_child', () => { root_child1.setFlexGrow(1); root_child1.setFlexShrink(1); root_child1.setFlexBasis("0%"); - root_child1.setDisplay(Yoga.DISPLAY_NONE); + root_child1.setDisplay(Display.None); root.insertChild(root_child1, 1); const root_child1_child0 = Yoga.Node.create(config); @@ -237,7 +255,7 @@ test('display_none_with_child', () => { root_child2.setFlexShrink(1); root_child2.setFlexBasis("0%"); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -264,7 +282,7 @@ test('display_none_with_child', () => { expect(root_child2.getComputedWidth()).toBe(50); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -302,12 +320,12 @@ test('display_none_with_position', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(100); root.setHeight(100); @@ -317,10 +335,10 @@ test('display_none_with_position', () => { const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); - root_child1.setPosition(Yoga.EDGE_TOP, 10); - root_child1.setDisplay(Yoga.DISPLAY_NONE); + root_child1.setPosition(Edge.Top, 10); + root_child1.setDisplay(Display.None); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -337,7 +355,7 @@ test('display_none_with_position', () => { expect(root_child1.getComputedWidth()).toBe(0); expect(root_child1.getComputedHeight()).toBe(0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -365,8 +383,8 @@ test('display_none_with_position_absolute', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -374,12 +392,12 @@ test('display_none_with_position_absolute', () => { root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); + root_child0.setPositionType(PositionType.Absolute); root_child0.setWidth(100); root_child0.setHeight(100); - root_child0.setDisplay(Yoga.DISPLAY_NONE); + root_child0.setDisplay(Display.None); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -391,7 +409,7 @@ test('display_none_with_position_absolute', () => { expect(root_child0.getComputedWidth()).toBe(0); expect(root_child0.getComputedHeight()).toBe(0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); diff --git a/javascript/tests/generated/YGFlexDirectionTest.test.js b/javascript/tests/generated/YGFlexDirectionTest.test.ts similarity index 85% rename from javascript/tests/generated/YGFlexDirectionTest.test.js rename to javascript/tests/generated/YGFlexDirectionTest.test.ts index 59a65383..275eca8c 100644 --- a/javascript/tests/generated/YGFlexDirectionTest.test.js +++ b/javascript/tests/generated/YGFlexDirectionTest.test.ts @@ -7,12 +7,30 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexDirectionTest.html +import {Yoga} from "../tools/globals"; +import { + Align, + Direction, + Display, + Edge, + Errata, + ExperimentalFeature, + FlexDirection, + Gutter, + Justify, + MeasureMode, + Overflow, + PositionType, + Unit, + Wrap, +} from 'yoga-layout'; + test('flex_direction_column_no_height', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -29,7 +47,7 @@ test('flex_direction_column_no_height', () => { const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -51,7 +69,7 @@ test('flex_direction_column_no_height', () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -84,12 +102,12 @@ test('flex_direction_row_no_width', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setHeight(100); const root_child0 = Yoga.Node.create(config); @@ -103,7 +121,7 @@ test('flex_direction_row_no_width', () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -125,7 +143,7 @@ test('flex_direction_row_no_width', () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -158,8 +176,8 @@ test('flex_direction_column', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -177,7 +195,7 @@ test('flex_direction_column', () => { const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -199,7 +217,7 @@ test('flex_direction_column', () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -232,12 +250,12 @@ test('flex_direction_row', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(100); root.setHeight(100); @@ -252,7 +270,7 @@ test('flex_direction_row', () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -274,7 +292,7 @@ test('flex_direction_row', () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -307,12 +325,12 @@ test('flex_direction_column_reverse', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN_REVERSE); + root.setFlexDirection(FlexDirection.ColumnReverse); root.setWidth(100); root.setHeight(100); @@ -327,7 +345,7 @@ test('flex_direction_column_reverse', () => { const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -349,7 +367,7 @@ test('flex_direction_column_reverse', () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -382,12 +400,12 @@ test('flex_direction_row_reverse', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW_REVERSE); + root.setFlexDirection(FlexDirection.RowReverse); root.setWidth(100); root.setHeight(100); @@ -402,7 +420,7 @@ test('flex_direction_row_reverse', () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -424,7 +442,7 @@ test('flex_direction_row_reverse', () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); diff --git a/javascript/tests/generated/YGFlexTest.test.js b/javascript/tests/generated/YGFlexTest.test.ts similarity index 84% rename from javascript/tests/generated/YGFlexTest.test.js rename to javascript/tests/generated/YGFlexTest.test.ts index 055b5ad6..6d2f94fe 100644 --- a/javascript/tests/generated/YGFlexTest.test.js +++ b/javascript/tests/generated/YGFlexTest.test.ts @@ -7,12 +7,30 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexTest.html +import {Yoga} from "../tools/globals"; +import { + Align, + Direction, + Display, + Edge, + Errata, + ExperimentalFeature, + FlexDirection, + Gutter, + Justify, + MeasureMode, + Overflow, + PositionType, + Unit, + Wrap, +} from 'yoga-layout'; + test('flex_basis_flex_grow_column', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -27,7 +45,7 @@ test('flex_basis_flex_grow_column', () => { const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -44,7 +62,7 @@ test('flex_basis_flex_grow_column', () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(25); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -72,12 +90,12 @@ test('flex_shrink_flex_grow_row', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(500); root.setHeight(500); @@ -92,7 +110,7 @@ test('flex_shrink_flex_grow_row', () => { root_child1.setWidth(500); root_child1.setHeight(100); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -109,7 +127,7 @@ test('flex_shrink_flex_grow_row', () => { expect(root_child1.getComputedWidth()).toBe(250); expect(root_child1.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -137,12 +155,12 @@ test('flex_shrink_flex_grow_child_flex_shrink_other_child', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(500); root.setHeight(500); @@ -158,7 +176,7 @@ test('flex_shrink_flex_grow_child_flex_shrink_other_child', () => { root_child1.setWidth(500); root_child1.setHeight(100); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -175,7 +193,7 @@ test('flex_shrink_flex_grow_child_flex_shrink_other_child', () => { expect(root_child1.getComputedWidth()).toBe(250); expect(root_child1.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -203,12 +221,12 @@ test('flex_basis_flex_grow_row', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(100); root.setHeight(100); @@ -220,7 +238,7 @@ test('flex_basis_flex_grow_row', () => { const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -237,7 +255,7 @@ test('flex_basis_flex_grow_row', () => { expect(root_child1.getComputedWidth()).toBe(25); expect(root_child1.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -265,8 +283,8 @@ test('flex_basis_flex_shrink_column', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -281,7 +299,7 @@ test('flex_basis_flex_shrink_column', () => { const root_child1 = Yoga.Node.create(config); root_child1.setFlexBasis(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -298,7 +316,7 @@ test('flex_basis_flex_shrink_column', () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -326,12 +344,12 @@ test('flex_basis_flex_shrink_row', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(100); root.setHeight(100); @@ -343,7 +361,7 @@ test('flex_basis_flex_shrink_row', () => { const root_child1 = Yoga.Node.create(config); root_child1.setFlexBasis(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -360,7 +378,7 @@ test('flex_basis_flex_shrink_row', () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -388,8 +406,8 @@ test('flex_shrink_to_zero', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -410,7 +428,7 @@ test('flex_shrink_to_zero', () => { root_child2.setWidth(50); root_child2.setHeight(50); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -432,7 +450,7 @@ test('flex_shrink_to_zero', () => { expect(root_child2.getComputedWidth()).toBe(50); expect(root_child2.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -465,8 +483,8 @@ test('flex_basis_overrides_main_size', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -488,7 +506,7 @@ test('flex_basis_overrides_main_size', () => { root_child2.setFlexGrow(1); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -510,7 +528,7 @@ test('flex_basis_overrides_main_size', () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -543,8 +561,8 @@ test('flex_grow_shrink_at_most', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -558,7 +576,7 @@ test('flex_grow_shrink_at_most', () => { root_child0_child0.setFlexGrow(1); root_child0_child0.setFlexShrink(1); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -575,7 +593,7 @@ test('flex_grow_shrink_at_most', () => { expect(root_child0_child0.getComputedWidth()).toBe(100); expect(root_child0_child0.getComputedHeight()).toBe(0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -603,8 +621,8 @@ test('flex_grow_less_than_factor_one', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -623,7 +641,7 @@ test('flex_grow_less_than_factor_one', () => { const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(0.4); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -645,7 +663,7 @@ test('flex_grow_less_than_factor_one', () => { expect(root_child2.getComputedWidth()).toBe(200); expect(root_child2.getComputedHeight()).toBe(184); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); diff --git a/javascript/tests/generated/YGFlexWrapTest.test.js b/javascript/tests/generated/YGFlexWrapTest.test.ts similarity index 85% rename from javascript/tests/generated/YGFlexWrapTest.test.js rename to javascript/tests/generated/YGFlexWrapTest.test.ts index 3981a07b..2dc4b3c2 100644 --- a/javascript/tests/generated/YGFlexWrapTest.test.js +++ b/javascript/tests/generated/YGFlexWrapTest.test.ts @@ -7,16 +7,34 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGFlexWrapTest.html +import {Yoga} from "../tools/globals"; +import { + Align, + Direction, + Display, + Edge, + Errata, + ExperimentalFeature, + FlexDirection, + Gutter, + Justify, + MeasureMode, + Overflow, + PositionType, + Unit, + Wrap, +} from 'yoga-layout'; + test('wrap_column', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexWrap(Wrap.Wrap); root.setHeight(100); const root_child0 = Yoga.Node.create(config); @@ -38,7 +56,7 @@ test('wrap_column', () => { root_child3.setWidth(30); root_child3.setHeight(30); root.insertChild(root_child3, 3); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -65,7 +83,7 @@ test('wrap_column', () => { expect(root_child3.getComputedWidth()).toBe(30); expect(root_child3.getComputedHeight()).toBe(30); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -103,13 +121,13 @@ test('wrap_row', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setFlexWrap(Wrap.Wrap); root.setWidth(100); const root_child0 = Yoga.Node.create(config); @@ -131,7 +149,7 @@ test('wrap_row', () => { root_child3.setWidth(30); root_child3.setHeight(30); root.insertChild(root_child3, 3); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -158,7 +176,7 @@ test('wrap_row', () => { expect(root_child3.getComputedWidth()).toBe(30); expect(root_child3.getComputedHeight()).toBe(30); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -196,14 +214,14 @@ test('wrap_row_align_items_flex_end', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignItems(Yoga.ALIGN_FLEX_END); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignItems(Align.FlexEnd); + root.setFlexWrap(Wrap.Wrap); root.setWidth(100); const root_child0 = Yoga.Node.create(config); @@ -225,7 +243,7 @@ test('wrap_row_align_items_flex_end', () => { root_child3.setWidth(30); root_child3.setHeight(30); root.insertChild(root_child3, 3); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -252,7 +270,7 @@ test('wrap_row_align_items_flex_end', () => { expect(root_child3.getComputedWidth()).toBe(30); expect(root_child3.getComputedHeight()).toBe(30); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -290,14 +308,14 @@ test('wrap_row_align_items_center', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignItems(Yoga.ALIGN_CENTER); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignItems(Align.Center); + root.setFlexWrap(Wrap.Wrap); root.setWidth(100); const root_child0 = Yoga.Node.create(config); @@ -319,7 +337,7 @@ test('wrap_row_align_items_center', () => { root_child3.setWidth(30); root_child3.setHeight(30); root.insertChild(root_child3, 3); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -346,7 +364,7 @@ test('wrap_row_align_items_center', () => { expect(root_child3.getComputedWidth()).toBe(30); expect(root_child3.getComputedHeight()).toBe(30); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -384,13 +402,13 @@ test('flex_wrap_children_with_min_main_overriding_flex_basis', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setFlexWrap(Wrap.Wrap); root.setWidth(100); const root_child0 = Yoga.Node.create(config); @@ -404,7 +422,7 @@ test('flex_wrap_children_with_min_main_overriding_flex_basis', () => { root_child1.setMinWidth(55); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -421,7 +439,7 @@ test('flex_wrap_children_with_min_main_overriding_flex_basis', () => { expect(root_child1.getComputedWidth()).toBe(55); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -449,16 +467,16 @@ test('flex_wrap_wrap_to_child_height', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); const root_child0 = Yoga.Node.create(config); - root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0.setAlignItems(Yoga.ALIGN_FLEX_START); - root_child0.setFlexWrap(Yoga.WRAP_WRAP); + root_child0.setFlexDirection(FlexDirection.Row); + root_child0.setAlignItems(Align.FlexStart); + root_child0.setFlexWrap(Wrap.Wrap); root.insertChild(root_child0, 0); const root_child0_child0 = Yoga.Node.create(config); @@ -474,7 +492,7 @@ test('flex_wrap_wrap_to_child_height', () => { root_child1.setWidth(100); root_child1.setHeight(100); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -501,7 +519,7 @@ test('flex_wrap_wrap_to_child_height', () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -539,13 +557,13 @@ test('flex_wrap_align_stretch_fits_one_row', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setFlexWrap(Wrap.Wrap); root.setWidth(150); root.setHeight(100); @@ -556,7 +574,7 @@ test('flex_wrap_align_stretch_fits_one_row', () => { const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -573,7 +591,7 @@ test('flex_wrap_align_stretch_fits_one_row', () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -601,13 +619,13 @@ test('wrap_reverse_row_align_content_flex_start', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); + root.setFlexDirection(FlexDirection.Row); + root.setFlexWrap(Wrap.WrapReverse); root.setWidth(100); const root_child0 = Yoga.Node.create(config); @@ -634,7 +652,7 @@ test('wrap_reverse_row_align_content_flex_start', () => { root_child4.setWidth(30); root_child4.setHeight(50); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -666,7 +684,7 @@ test('wrap_reverse_row_align_content_flex_start', () => { expect(root_child4.getComputedWidth()).toBe(30); expect(root_child4.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -709,14 +727,14 @@ test('wrap_reverse_row_align_content_center', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignContent(Yoga.ALIGN_CENTER); - root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); + root.setFlexDirection(FlexDirection.Row); + root.setAlignContent(Align.Center); + root.setFlexWrap(Wrap.WrapReverse); root.setWidth(100); const root_child0 = Yoga.Node.create(config); @@ -743,7 +761,7 @@ test('wrap_reverse_row_align_content_center', () => { root_child4.setWidth(30); root_child4.setHeight(50); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -775,7 +793,7 @@ test('wrap_reverse_row_align_content_center', () => { expect(root_child4.getComputedWidth()).toBe(30); expect(root_child4.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -818,13 +836,13 @@ test('wrap_reverse_row_single_line_different_size', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); + root.setFlexDirection(FlexDirection.Row); + root.setFlexWrap(Wrap.WrapReverse); root.setWidth(300); const root_child0 = Yoga.Node.create(config); @@ -851,7 +869,7 @@ test('wrap_reverse_row_single_line_different_size', () => { root_child4.setWidth(30); root_child4.setHeight(50); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -883,7 +901,7 @@ test('wrap_reverse_row_single_line_different_size', () => { expect(root_child4.getComputedWidth()).toBe(30); expect(root_child4.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -926,14 +944,14 @@ test('wrap_reverse_row_align_content_stretch', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignContent(Yoga.ALIGN_STRETCH); - root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); + root.setFlexDirection(FlexDirection.Row); + root.setAlignContent(Align.Stretch); + root.setFlexWrap(Wrap.WrapReverse); root.setWidth(100); const root_child0 = Yoga.Node.create(config); @@ -960,7 +978,7 @@ test('wrap_reverse_row_align_content_stretch', () => { root_child4.setWidth(30); root_child4.setHeight(50); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -992,7 +1010,7 @@ test('wrap_reverse_row_align_content_stretch', () => { expect(root_child4.getComputedWidth()).toBe(30); expect(root_child4.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1035,14 +1053,14 @@ test('wrap_reverse_row_align_content_space_around', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignContent(Yoga.ALIGN_SPACE_AROUND); - root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); + root.setFlexDirection(FlexDirection.Row); + root.setAlignContent(Align.SpaceAround); + root.setFlexWrap(Wrap.WrapReverse); root.setWidth(100); const root_child0 = Yoga.Node.create(config); @@ -1069,7 +1087,7 @@ test('wrap_reverse_row_align_content_space_around', () => { root_child4.setWidth(30); root_child4.setHeight(50); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1101,7 +1119,7 @@ test('wrap_reverse_row_align_content_space_around', () => { expect(root_child4.getComputedWidth()).toBe(30); expect(root_child4.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1144,13 +1162,13 @@ test('wrap_reverse_column_fixed_size', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_CENTER); - root.setFlexWrap(Yoga.WRAP_WRAP_REVERSE); + root.setAlignItems(Align.Center); + root.setFlexWrap(Wrap.WrapReverse); root.setWidth(200); root.setHeight(100); @@ -1178,7 +1196,7 @@ test('wrap_reverse_column_fixed_size', () => { root_child4.setWidth(30); root_child4.setHeight(50); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1210,7 +1228,7 @@ test('wrap_reverse_column_fixed_size', () => { expect(root_child4.getComputedWidth()).toBe(30); expect(root_child4.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1253,18 +1271,18 @@ test('wrapped_row_within_align_items_center', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setAlignItems(Align.Center); root.setWidth(200); root.setHeight(200); const root_child0 = Yoga.Node.create(config); - root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0.setFlexWrap(Yoga.WRAP_WRAP); + root_child0.setFlexDirection(FlexDirection.Row); + root_child0.setFlexWrap(Wrap.Wrap); root.insertChild(root_child0, 0); const root_child0_child0 = Yoga.Node.create(config); @@ -1276,7 +1294,7 @@ test('wrapped_row_within_align_items_center', () => { root_child0_child1.setWidth(80); root_child0_child1.setHeight(80); root_child0.insertChild(root_child0_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1298,7 +1316,7 @@ test('wrapped_row_within_align_items_center', () => { expect(root_child0_child1.getComputedWidth()).toBe(80); expect(root_child0_child1.getComputedHeight()).toBe(80); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1331,18 +1349,18 @@ test('wrapped_row_within_align_items_flex_start', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_FLEX_START); + root.setAlignItems(Align.FlexStart); root.setWidth(200); root.setHeight(200); const root_child0 = Yoga.Node.create(config); - root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0.setFlexWrap(Yoga.WRAP_WRAP); + root_child0.setFlexDirection(FlexDirection.Row); + root_child0.setFlexWrap(Wrap.Wrap); root.insertChild(root_child0, 0); const root_child0_child0 = Yoga.Node.create(config); @@ -1354,7 +1372,7 @@ test('wrapped_row_within_align_items_flex_start', () => { root_child0_child1.setWidth(80); root_child0_child1.setHeight(80); root_child0.insertChild(root_child0_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1376,7 +1394,7 @@ test('wrapped_row_within_align_items_flex_start', () => { expect(root_child0_child1.getComputedWidth()).toBe(80); expect(root_child0_child1.getComputedHeight()).toBe(80); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1409,18 +1427,18 @@ test('wrapped_row_within_align_items_flex_end', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_FLEX_END); + root.setAlignItems(Align.FlexEnd); root.setWidth(200); root.setHeight(200); const root_child0 = Yoga.Node.create(config); - root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0.setFlexWrap(Yoga.WRAP_WRAP); + root_child0.setFlexDirection(FlexDirection.Row); + root_child0.setFlexWrap(Wrap.Wrap); root.insertChild(root_child0, 0); const root_child0_child0 = Yoga.Node.create(config); @@ -1432,7 +1450,7 @@ test('wrapped_row_within_align_items_flex_end', () => { root_child0_child1.setWidth(80); root_child0_child1.setHeight(80); root_child0.insertChild(root_child0_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1454,7 +1472,7 @@ test('wrapped_row_within_align_items_flex_end', () => { expect(root_child0_child1.getComputedWidth()).toBe(80); expect(root_child0_child1.getComputedHeight()).toBe(80); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1487,15 +1505,15 @@ test('wrapped_column_max_height', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); - root.setAlignContent(Yoga.ALIGN_CENTER); - root.setAlignItems(Yoga.ALIGN_CENTER); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setJustifyContent(Justify.Center); + root.setAlignContent(Align.Center); + root.setAlignItems(Align.Center); + root.setFlexWrap(Wrap.Wrap); root.setWidth(700); root.setHeight(500); @@ -1506,10 +1524,10 @@ test('wrapped_column_max_height', () => { root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(config); - root_child1.setMargin(Yoga.EDGE_LEFT, 20); - root_child1.setMargin(Yoga.EDGE_TOP, 20); - root_child1.setMargin(Yoga.EDGE_RIGHT, 20); - root_child1.setMargin(Yoga.EDGE_BOTTOM, 20); + root_child1.setMargin(Edge.Left, 20); + root_child1.setMargin(Edge.Top, 20); + root_child1.setMargin(Edge.Right, 20); + root_child1.setMargin(Edge.Bottom, 20); root_child1.setWidth(200); root_child1.setHeight(200); root.insertChild(root_child1, 1); @@ -1518,7 +1536,7 @@ test('wrapped_column_max_height', () => { root_child2.setWidth(100); root_child2.setHeight(100); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1540,7 +1558,7 @@ test('wrapped_column_max_height', () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1573,15 +1591,15 @@ test('wrapped_column_max_height_flex', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); - root.setAlignContent(Yoga.ALIGN_CENTER); - root.setAlignItems(Yoga.ALIGN_CENTER); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setJustifyContent(Justify.Center); + root.setAlignContent(Align.Center); + root.setAlignItems(Align.Center); + root.setFlexWrap(Wrap.Wrap); root.setWidth(700); root.setHeight(500); @@ -1598,10 +1616,10 @@ test('wrapped_column_max_height_flex', () => { root_child1.setFlexGrow(1); root_child1.setFlexShrink(1); root_child1.setFlexBasis("0%"); - root_child1.setMargin(Yoga.EDGE_LEFT, 20); - root_child1.setMargin(Yoga.EDGE_TOP, 20); - root_child1.setMargin(Yoga.EDGE_RIGHT, 20); - root_child1.setMargin(Yoga.EDGE_BOTTOM, 20); + root_child1.setMargin(Edge.Left, 20); + root_child1.setMargin(Edge.Top, 20); + root_child1.setMargin(Edge.Right, 20); + root_child1.setMargin(Edge.Bottom, 20); root_child1.setWidth(200); root_child1.setHeight(200); root.insertChild(root_child1, 1); @@ -1610,7 +1628,7 @@ test('wrapped_column_max_height_flex', () => { root_child2.setWidth(100); root_child2.setHeight(100); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1632,7 +1650,7 @@ test('wrapped_column_max_height_flex', () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1665,8 +1683,8 @@ test('wrap_nodes_with_content_sizing_overflowing_margin', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -1674,8 +1692,8 @@ test('wrap_nodes_with_content_sizing_overflowing_margin', () => { root.setHeight(500); const root_child0 = Yoga.Node.create(config); - root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0.setFlexWrap(Yoga.WRAP_WRAP); + root_child0.setFlexDirection(FlexDirection.Row); + root_child0.setFlexWrap(Wrap.Wrap); root_child0.setWidth(85); root.insertChild(root_child0, 0); @@ -1688,14 +1706,14 @@ test('wrap_nodes_with_content_sizing_overflowing_margin', () => { root_child0_child0.insertChild(root_child0_child0_child0, 0); const root_child0_child1 = Yoga.Node.create(config); - root_child0_child1.setMargin(Yoga.EDGE_RIGHT, 10); + root_child0_child1.setMargin(Edge.Right, 10); root_child0.insertChild(root_child0_child1, 1); const root_child0_child1_child0 = Yoga.Node.create(config); root_child0_child1_child0.setWidth(40); root_child0_child1_child0.setHeight(40); root_child0_child1.insertChild(root_child0_child1_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1727,7 +1745,7 @@ test('wrap_nodes_with_content_sizing_overflowing_margin', () => { expect(root_child0_child1_child0.getComputedWidth()).toBe(40); expect(root_child0_child1_child0.getComputedHeight()).toBe(40); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1770,8 +1788,8 @@ test('wrap_nodes_with_content_sizing_margin_cross', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -1779,8 +1797,8 @@ test('wrap_nodes_with_content_sizing_margin_cross', () => { root.setHeight(500); const root_child0 = Yoga.Node.create(config); - root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0.setFlexWrap(Yoga.WRAP_WRAP); + root_child0.setFlexDirection(FlexDirection.Row); + root_child0.setFlexWrap(Wrap.Wrap); root_child0.setWidth(70); root.insertChild(root_child0, 0); @@ -1793,14 +1811,14 @@ test('wrap_nodes_with_content_sizing_margin_cross', () => { root_child0_child0.insertChild(root_child0_child0_child0, 0); const root_child0_child1 = Yoga.Node.create(config); - root_child0_child1.setMargin(Yoga.EDGE_TOP, 10); + root_child0_child1.setMargin(Edge.Top, 10); root_child0.insertChild(root_child0_child1, 1); const root_child0_child1_child0 = Yoga.Node.create(config); root_child0_child1_child0.setWidth(40); root_child0_child1_child0.setHeight(40); root_child0_child1.insertChild(root_child0_child1_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1832,7 +1850,7 @@ test('wrap_nodes_with_content_sizing_margin_cross', () => { expect(root_child0_child1_child0.getComputedWidth()).toBe(40); expect(root_child0_child1_child0.getComputedHeight()).toBe(40); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); diff --git a/javascript/tests/generated/YGGapTest.test.js b/javascript/tests/generated/YGGapTest.test.ts similarity index 85% rename from javascript/tests/generated/YGGapTest.test.js rename to javascript/tests/generated/YGGapTest.test.ts index dcec0450..2485c6df 100644 --- a/javascript/tests/generated/YGGapTest.test.js +++ b/javascript/tests/generated/YGGapTest.test.ts @@ -7,20 +7,38 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGGapTest.html +import {Yoga} from "../tools/globals"; +import { + Align, + Direction, + Display, + Edge, + Errata, + ExperimentalFeature, + FlexDirection, + Gutter, + Justify, + MeasureMode, + Overflow, + PositionType, + Unit, + Wrap, +} from 'yoga-layout'; + test('column_gap_flexible', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(80); root.setHeight(100); - root.setGap(Yoga.GUTTER_COLUMN, 10); - root.setGap(Yoga.GUTTER_ROW, 20); + root.setGap(Gutter.Column, 10); + root.setGap(Gutter.Row, 20); const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); @@ -39,7 +57,7 @@ test('column_gap_flexible', () => { root_child2.setFlexShrink(1); root_child2.setFlexBasis("0%"); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -61,7 +79,7 @@ test('column_gap_flexible', () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -94,15 +112,15 @@ test('column_gap_inflexible', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(80); root.setHeight(100); - root.setGap(Yoga.GUTTER_COLUMN, 10); + root.setGap(Gutter.Column, 10); const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); @@ -115,7 +133,7 @@ test('column_gap_inflexible', () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -137,7 +155,7 @@ test('column_gap_inflexible', () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -170,15 +188,15 @@ test('column_gap_mixed_flexible', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(80); root.setHeight(100); - root.setGap(Yoga.GUTTER_COLUMN, 10); + root.setGap(Gutter.Column, 10); const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); @@ -193,7 +211,7 @@ test('column_gap_mixed_flexible', () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -215,7 +233,7 @@ test('column_gap_mixed_flexible', () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -248,40 +266,40 @@ test('column_gap_child_margins', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(80); root.setHeight(100); - root.setGap(Yoga.GUTTER_COLUMN, 10); + root.setGap(Gutter.Column, 10); const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexShrink(1); root_child0.setFlexBasis("0%"); - root_child0.setMargin(Yoga.EDGE_LEFT, 2); - root_child0.setMargin(Yoga.EDGE_RIGHT, 2); + root_child0.setMargin(Edge.Left, 2); + root_child0.setMargin(Edge.Right, 2); root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setFlexShrink(1); root_child1.setFlexBasis("0%"); - root_child1.setMargin(Yoga.EDGE_LEFT, 10); - root_child1.setMargin(Yoga.EDGE_RIGHT, 10); + root_child1.setMargin(Edge.Left, 10); + root_child1.setMargin(Edge.Right, 10); root.insertChild(root_child1, 1); const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(1); root_child2.setFlexShrink(1); root_child2.setFlexBasis("0%"); - root_child2.setMargin(Yoga.EDGE_LEFT, 15); - root_child2.setMargin(Yoga.EDGE_RIGHT, 15); + root_child2.setMargin(Edge.Left, 15); + root_child2.setMargin(Edge.Right, 15); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -303,7 +321,7 @@ test('column_gap_child_margins', () => { expect(root_child2.getComputedWidth()).toBe(2); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -336,16 +354,16 @@ test('column_row_gap_wrapping', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setFlexWrap(Wrap.Wrap); root.setWidth(80); - root.setGap(Yoga.GUTTER_COLUMN, 10); - root.setGap(Yoga.GUTTER_ROW, 20); + root.setGap(Gutter.Column, 10); + root.setGap(Gutter.Row, 20); const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); @@ -391,7 +409,7 @@ test('column_row_gap_wrapping', () => { root_child8.setWidth(20); root_child8.setHeight(20); root.insertChild(root_child8, 8); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -443,7 +461,7 @@ test('column_row_gap_wrapping', () => { expect(root_child8.getComputedWidth()).toBe(20); expect(root_child8.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -506,15 +524,15 @@ test('column_gap_justify_flex_start', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(100); root.setHeight(100); - root.setGap(Yoga.GUTTER_COLUMN, 10); + root.setGap(Gutter.Column, 10); const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); @@ -527,7 +545,7 @@ test('column_gap_justify_flex_start', () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -549,7 +567,7 @@ test('column_gap_justify_flex_start', () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -582,16 +600,16 @@ test('column_gap_justify_center', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); + root.setFlexDirection(FlexDirection.Row); + root.setJustifyContent(Justify.Center); root.setWidth(100); root.setHeight(100); - root.setGap(Yoga.GUTTER_COLUMN, 10); + root.setGap(Gutter.Column, 10); const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); @@ -604,7 +622,7 @@ test('column_gap_justify_center', () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -626,7 +644,7 @@ test('column_gap_justify_center', () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -659,16 +677,16 @@ test('column_gap_justify_flex_end', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); + root.setFlexDirection(FlexDirection.Row); + root.setJustifyContent(Justify.FlexEnd); root.setWidth(100); root.setHeight(100); - root.setGap(Yoga.GUTTER_COLUMN, 10); + root.setGap(Gutter.Column, 10); const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); @@ -681,7 +699,7 @@ test('column_gap_justify_flex_end', () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -703,7 +721,7 @@ test('column_gap_justify_flex_end', () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -736,16 +754,16 @@ test('column_gap_justify_space_between', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN); + root.setFlexDirection(FlexDirection.Row); + root.setJustifyContent(Justify.SpaceBetween); root.setWidth(100); root.setHeight(100); - root.setGap(Yoga.GUTTER_COLUMN, 10); + root.setGap(Gutter.Column, 10); const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); @@ -758,7 +776,7 @@ test('column_gap_justify_space_between', () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -780,7 +798,7 @@ test('column_gap_justify_space_between', () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -813,16 +831,16 @@ test('column_gap_justify_space_around', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND); + root.setFlexDirection(FlexDirection.Row); + root.setJustifyContent(Justify.SpaceAround); root.setWidth(100); root.setHeight(100); - root.setGap(Yoga.GUTTER_COLUMN, 10); + root.setGap(Gutter.Column, 10); const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); @@ -835,7 +853,7 @@ test('column_gap_justify_space_around', () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -857,7 +875,7 @@ test('column_gap_justify_space_around', () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -890,16 +908,16 @@ test('column_gap_justify_space_evenly', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setJustifyContent(Yoga.JUSTIFY_SPACE_EVENLY); + root.setFlexDirection(FlexDirection.Row); + root.setJustifyContent(Justify.SpaceEvenly); root.setWidth(100); root.setHeight(100); - root.setGap(Yoga.GUTTER_COLUMN, 10); + root.setGap(Gutter.Column, 10); const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); @@ -912,7 +930,7 @@ test('column_gap_justify_space_evenly', () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(20); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -934,7 +952,7 @@ test('column_gap_justify_space_evenly', () => { expect(root_child2.getComputedWidth()).toBe(20); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -967,17 +985,17 @@ test('column_gap_wrap_align_flex_start', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setFlexWrap(Wrap.Wrap); root.setWidth(100); root.setHeight(100); - root.setGap(Yoga.GUTTER_COLUMN, 10); - root.setGap(Yoga.GUTTER_ROW, 20); + root.setGap(Gutter.Column, 10); + root.setGap(Gutter.Row, 20); const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); @@ -1008,7 +1026,7 @@ test('column_gap_wrap_align_flex_start', () => { root_child5.setWidth(20); root_child5.setHeight(20); root.insertChild(root_child5, 5); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1045,7 +1063,7 @@ test('column_gap_wrap_align_flex_start', () => { expect(root_child5.getComputedWidth()).toBe(20); expect(root_child5.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1093,18 +1111,18 @@ test('column_gap_wrap_align_center', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignContent(Yoga.ALIGN_CENTER); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignContent(Align.Center); + root.setFlexWrap(Wrap.Wrap); root.setWidth(100); root.setHeight(100); - root.setGap(Yoga.GUTTER_COLUMN, 10); - root.setGap(Yoga.GUTTER_ROW, 20); + root.setGap(Gutter.Column, 10); + root.setGap(Gutter.Row, 20); const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); @@ -1135,7 +1153,7 @@ test('column_gap_wrap_align_center', () => { root_child5.setWidth(20); root_child5.setHeight(20); root.insertChild(root_child5, 5); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1172,7 +1190,7 @@ test('column_gap_wrap_align_center', () => { expect(root_child5.getComputedWidth()).toBe(20); expect(root_child5.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1220,18 +1238,18 @@ test('column_gap_wrap_align_flex_end', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignContent(Yoga.ALIGN_FLEX_END); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignContent(Align.FlexEnd); + root.setFlexWrap(Wrap.Wrap); root.setWidth(100); root.setHeight(100); - root.setGap(Yoga.GUTTER_COLUMN, 10); - root.setGap(Yoga.GUTTER_ROW, 20); + root.setGap(Gutter.Column, 10); + root.setGap(Gutter.Row, 20); const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); @@ -1262,7 +1280,7 @@ test('column_gap_wrap_align_flex_end', () => { root_child5.setWidth(20); root_child5.setHeight(20); root.insertChild(root_child5, 5); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1299,7 +1317,7 @@ test('column_gap_wrap_align_flex_end', () => { expect(root_child5.getComputedWidth()).toBe(20); expect(root_child5.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1347,18 +1365,18 @@ test('column_gap_wrap_align_space_between', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignContent(Yoga.ALIGN_SPACE_BETWEEN); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignContent(Align.SpaceBetween); + root.setFlexWrap(Wrap.Wrap); root.setWidth(100); root.setHeight(100); - root.setGap(Yoga.GUTTER_COLUMN, 10); - root.setGap(Yoga.GUTTER_ROW, 20); + root.setGap(Gutter.Column, 10); + root.setGap(Gutter.Row, 20); const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); @@ -1389,7 +1407,7 @@ test('column_gap_wrap_align_space_between', () => { root_child5.setWidth(20); root_child5.setHeight(20); root.insertChild(root_child5, 5); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1426,7 +1444,7 @@ test('column_gap_wrap_align_space_between', () => { expect(root_child5.getComputedWidth()).toBe(20); expect(root_child5.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1474,18 +1492,18 @@ test('column_gap_wrap_align_space_around', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignContent(Yoga.ALIGN_SPACE_AROUND); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignContent(Align.SpaceAround); + root.setFlexWrap(Wrap.Wrap); root.setWidth(100); root.setHeight(100); - root.setGap(Yoga.GUTTER_COLUMN, 10); - root.setGap(Yoga.GUTTER_ROW, 20); + root.setGap(Gutter.Column, 10); + root.setGap(Gutter.Row, 20); const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); @@ -1516,7 +1534,7 @@ test('column_gap_wrap_align_space_around', () => { root_child5.setWidth(20); root_child5.setHeight(20); root.insertChild(root_child5, 5); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1553,7 +1571,7 @@ test('column_gap_wrap_align_space_around', () => { expect(root_child5.getComputedWidth()).toBe(20); expect(root_child5.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1601,17 +1619,17 @@ test('column_gap_wrap_align_stretch', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignContent(Yoga.ALIGN_STRETCH); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignContent(Align.Stretch); + root.setFlexWrap(Wrap.Wrap); root.setWidth(300); root.setHeight(300); - root.setGap(Yoga.GUTTER_COLUMN, 5); + root.setGap(Gutter.Column, 5); const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); @@ -1637,7 +1655,7 @@ test('column_gap_wrap_align_stretch', () => { root_child4.setFlexGrow(1); root_child4.setMinWidth(60); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1669,7 +1687,7 @@ test('column_gap_wrap_align_stretch', () => { expect(root_child4.getComputedWidth()).toBe(300); expect(root_child4.getComputedHeight()).toBe(150); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1712,14 +1730,14 @@ test('column_gap_determines_parent_width', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setHeight(100); - root.setGap(Yoga.GUTTER_COLUMN, 10); + root.setGap(Gutter.Column, 10); const root_child0 = Yoga.Node.create(config); root_child0.setWidth(10); @@ -1732,7 +1750,7 @@ test('column_gap_determines_parent_width', () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(30); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1754,7 +1772,7 @@ test('column_gap_determines_parent_width', () => { expect(root_child2.getComputedWidth()).toBe(30); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1787,18 +1805,18 @@ test('row_gap_align_items_stretch', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignContent(Yoga.ALIGN_STRETCH); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignContent(Align.Stretch); + root.setFlexWrap(Wrap.Wrap); root.setWidth(100); root.setHeight(200); - root.setGap(Yoga.GUTTER_COLUMN, 10); - root.setGap(Yoga.GUTTER_ROW, 20); + root.setGap(Gutter.Column, 10); + root.setGap(Gutter.Row, 20); const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); @@ -1823,7 +1841,7 @@ test('row_gap_align_items_stretch', () => { const root_child5 = Yoga.Node.create(config); root_child5.setWidth(20); root.insertChild(root_child5, 5); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1860,7 +1878,7 @@ test('row_gap_align_items_stretch', () => { expect(root_child5.getComputedWidth()).toBe(20); expect(root_child5.getComputedHeight()).toBe(90); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1908,18 +1926,18 @@ test('row_gap_align_items_end', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignItems(Yoga.ALIGN_FLEX_END); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setAlignItems(Align.FlexEnd); + root.setFlexWrap(Wrap.Wrap); root.setWidth(100); root.setHeight(200); - root.setGap(Yoga.GUTTER_COLUMN, 10); - root.setGap(Yoga.GUTTER_ROW, 20); + root.setGap(Gutter.Column, 10); + root.setGap(Gutter.Row, 20); const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); @@ -1944,7 +1962,7 @@ test('row_gap_align_items_end', () => { const root_child5 = Yoga.Node.create(config); root_child5.setWidth(20); root.insertChild(root_child5, 5); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1981,7 +1999,7 @@ test('row_gap_align_items_end', () => { expect(root_child5.getComputedWidth()).toBe(20); expect(root_child5.getComputedHeight()).toBe(0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2029,39 +2047,39 @@ test('row_gap_column_child_margins', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); root.setWidth(100); root.setHeight(200); - root.setGap(Yoga.GUTTER_ROW, 10); + root.setGap(Gutter.Row, 10); const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexShrink(1); root_child0.setFlexBasis("0%"); - root_child0.setMargin(Yoga.EDGE_TOP, 2); - root_child0.setMargin(Yoga.EDGE_BOTTOM, 2); + root_child0.setMargin(Edge.Top, 2); + root_child0.setMargin(Edge.Bottom, 2); root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root_child1.setFlexShrink(1); root_child1.setFlexBasis("0%"); - root_child1.setMargin(Yoga.EDGE_TOP, 10); - root_child1.setMargin(Yoga.EDGE_BOTTOM, 10); + root_child1.setMargin(Edge.Top, 10); + root_child1.setMargin(Edge.Bottom, 10); root.insertChild(root_child1, 1); const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(1); root_child2.setFlexShrink(1); root_child2.setFlexBasis("0%"); - root_child2.setMargin(Yoga.EDGE_TOP, 15); - root_child2.setMargin(Yoga.EDGE_BOTTOM, 15); + root_child2.setMargin(Edge.Top, 15); + root_child2.setMargin(Edge.Bottom, 15); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2083,7 +2101,7 @@ test('row_gap_column_child_margins', () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(42); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2116,35 +2134,35 @@ test('row_gap_row_wrap_child_margins', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setFlexWrap(Yoga.WRAP_WRAP); + root.setFlexDirection(FlexDirection.Row); + root.setFlexWrap(Wrap.Wrap); root.setWidth(100); root.setHeight(200); - root.setGap(Yoga.GUTTER_ROW, 10); + root.setGap(Gutter.Row, 10); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_TOP, 2); - root_child0.setMargin(Yoga.EDGE_BOTTOM, 2); + root_child0.setMargin(Edge.Top, 2); + root_child0.setMargin(Edge.Bottom, 2); root_child0.setWidth(60); root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(config); - root_child1.setMargin(Yoga.EDGE_TOP, 10); - root_child1.setMargin(Yoga.EDGE_BOTTOM, 10); + root_child1.setMargin(Edge.Top, 10); + root_child1.setMargin(Edge.Bottom, 10); root_child1.setWidth(60); root.insertChild(root_child1, 1); const root_child2 = Yoga.Node.create(config); - root_child2.setMargin(Yoga.EDGE_TOP, 15); - root_child2.setMargin(Yoga.EDGE_BOTTOM, 15); + root_child2.setMargin(Edge.Top, 15); + root_child2.setMargin(Edge.Bottom, 15); root_child2.setWidth(60); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2166,7 +2184,7 @@ test('row_gap_row_wrap_child_margins', () => { expect(root_child2.getComputedWidth()).toBe(60); expect(root_child2.getComputedHeight()).toBe(0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2199,13 +2217,13 @@ test('row_gap_determines_parent_height', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); root.setWidth(100); - root.setGap(Yoga.GUTTER_ROW, 10); + root.setGap(Gutter.Row, 10); const root_child0 = Yoga.Node.create(config); root_child0.setHeight(10); @@ -2218,7 +2236,7 @@ test('row_gap_determines_parent_height', () => { const root_child2 = Yoga.Node.create(config); root_child2.setHeight(30); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -2240,7 +2258,7 @@ test('row_gap_determines_parent_height', () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(30); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); diff --git a/javascript/tests/generated/YGJustifyContentTest.test.js b/javascript/tests/generated/YGJustifyContentTest.test.ts similarity index 80% rename from javascript/tests/generated/YGJustifyContentTest.test.js rename to javascript/tests/generated/YGJustifyContentTest.test.ts index 270b650d..b3b9c310 100644 --- a/javascript/tests/generated/YGJustifyContentTest.test.js +++ b/javascript/tests/generated/YGJustifyContentTest.test.ts @@ -7,16 +7,34 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGJustifyContentTest.html +import {Yoga} from "../tools/globals"; +import { + Align, + Direction, + Display, + Edge, + Errata, + ExperimentalFeature, + FlexDirection, + Gutter, + Justify, + MeasureMode, + Overflow, + PositionType, + Unit, + Wrap, +} from 'yoga-layout'; + test('justify_content_row_flex_start', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(102); root.setHeight(102); @@ -31,7 +49,7 @@ test('justify_content_row_flex_start', () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -53,7 +71,7 @@ test('justify_content_row_flex_start', () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(102); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -86,13 +104,13 @@ test('justify_content_row_flex_end', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); + root.setFlexDirection(FlexDirection.Row); + root.setJustifyContent(Justify.FlexEnd); root.setWidth(102); root.setHeight(102); @@ -107,7 +125,7 @@ test('justify_content_row_flex_end', () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -129,7 +147,7 @@ test('justify_content_row_flex_end', () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(102); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -162,13 +180,13 @@ test('justify_content_row_center', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); + root.setFlexDirection(FlexDirection.Row); + root.setJustifyContent(Justify.Center); root.setWidth(102); root.setHeight(102); @@ -183,7 +201,7 @@ test('justify_content_row_center', () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -205,7 +223,7 @@ test('justify_content_row_center', () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(102); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -238,13 +256,13 @@ test('justify_content_row_space_between', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN); + root.setFlexDirection(FlexDirection.Row); + root.setJustifyContent(Justify.SpaceBetween); root.setWidth(102); root.setHeight(102); @@ -259,7 +277,7 @@ test('justify_content_row_space_between', () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -281,7 +299,7 @@ test('justify_content_row_space_between', () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(102); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -314,13 +332,13 @@ test('justify_content_row_space_around', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND); + root.setFlexDirection(FlexDirection.Row); + root.setJustifyContent(Justify.SpaceAround); root.setWidth(102); root.setHeight(102); @@ -335,7 +353,7 @@ test('justify_content_row_space_around', () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -357,7 +375,7 @@ test('justify_content_row_space_around', () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(102); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -390,8 +408,8 @@ test('justify_content_column_flex_start', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -409,7 +427,7 @@ test('justify_content_column_flex_start', () => { const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -431,7 +449,7 @@ test('justify_content_column_flex_start', () => { expect(root_child2.getComputedWidth()).toBe(102); expect(root_child2.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -464,12 +482,12 @@ test('justify_content_column_flex_end', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); + root.setJustifyContent(Justify.FlexEnd); root.setWidth(102); root.setHeight(102); @@ -484,7 +502,7 @@ test('justify_content_column_flex_end', () => { const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -506,7 +524,7 @@ test('justify_content_column_flex_end', () => { expect(root_child2.getComputedWidth()).toBe(102); expect(root_child2.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -539,12 +557,12 @@ test('justify_content_column_center', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); + root.setJustifyContent(Justify.Center); root.setWidth(102); root.setHeight(102); @@ -559,7 +577,7 @@ test('justify_content_column_center', () => { const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -581,7 +599,7 @@ test('justify_content_column_center', () => { expect(root_child2.getComputedWidth()).toBe(102); expect(root_child2.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -614,12 +632,12 @@ test('justify_content_column_space_between', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_SPACE_BETWEEN); + root.setJustifyContent(Justify.SpaceBetween); root.setWidth(102); root.setHeight(102); @@ -634,7 +652,7 @@ test('justify_content_column_space_between', () => { const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -656,7 +674,7 @@ test('justify_content_column_space_between', () => { expect(root_child2.getComputedWidth()).toBe(102); expect(root_child2.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -689,12 +707,12 @@ test('justify_content_column_space_around', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_SPACE_AROUND); + root.setJustifyContent(Justify.SpaceAround); root.setWidth(102); root.setHeight(102); @@ -709,7 +727,7 @@ test('justify_content_column_space_around', () => { const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -731,7 +749,7 @@ test('justify_content_column_space_around', () => { expect(root_child2.getComputedWidth()).toBe(102); expect(root_child2.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -764,21 +782,21 @@ test('justify_content_row_min_width_and_margin', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); - root.setMargin(Yoga.EDGE_LEFT, 100); + root.setFlexDirection(FlexDirection.Row); + root.setJustifyContent(Justify.Center); + root.setMargin(Edge.Left, 100); root.setMinWidth(50); const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(100); expect(root.getComputedTop()).toBe(0); @@ -790,7 +808,7 @@ test('justify_content_row_min_width_and_margin', () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(100); expect(root.getComputedTop()).toBe(0); @@ -813,14 +831,14 @@ test('justify_content_row_max_width_and_margin', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); - root.setMargin(Yoga.EDGE_LEFT, 100); + root.setFlexDirection(FlexDirection.Row); + root.setJustifyContent(Justify.Center); + root.setMargin(Edge.Left, 100); root.setWidth(100); root.setMaxWidth(80); @@ -828,7 +846,7 @@ test('justify_content_row_max_width_and_margin', () => { root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(100); expect(root.getComputedTop()).toBe(0); @@ -840,7 +858,7 @@ test('justify_content_row_max_width_and_margin', () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(100); expect(root.getComputedTop()).toBe(0); @@ -863,20 +881,20 @@ test('justify_content_column_min_height_and_margin', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); - root.setMargin(Yoga.EDGE_TOP, 100); + root.setJustifyContent(Justify.Center); + root.setMargin(Edge.Top, 100); root.setMinHeight(50); const root_child0 = Yoga.Node.create(config); root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(100); @@ -888,7 +906,7 @@ test('justify_content_column_min_height_and_margin', () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(100); @@ -911,13 +929,13 @@ test('justify_content_colunn_max_height_and_margin', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); - root.setMargin(Yoga.EDGE_TOP, 100); + root.setJustifyContent(Justify.Center); + root.setMargin(Edge.Top, 100); root.setHeight(100); root.setMaxHeight(80); @@ -925,7 +943,7 @@ test('justify_content_colunn_max_height_and_margin', () => { root_child0.setWidth(20); root_child0.setHeight(20); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(100); @@ -937,7 +955,7 @@ test('justify_content_colunn_max_height_and_margin', () => { expect(root_child0.getComputedWidth()).toBe(20); expect(root_child0.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(100); @@ -960,12 +978,12 @@ test('justify_content_column_space_evenly', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_SPACE_EVENLY); + root.setJustifyContent(Justify.SpaceEvenly); root.setWidth(102); root.setHeight(102); @@ -980,7 +998,7 @@ test('justify_content_column_space_evenly', () => { const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1002,7 +1020,7 @@ test('justify_content_column_space_evenly', () => { expect(root_child2.getComputedWidth()).toBe(102); expect(root_child2.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1035,13 +1053,13 @@ test('justify_content_row_space_evenly', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setJustifyContent(Yoga.JUSTIFY_SPACE_EVENLY); + root.setFlexDirection(FlexDirection.Row); + root.setJustifyContent(Justify.SpaceEvenly); root.setWidth(102); root.setHeight(102); @@ -1056,7 +1074,7 @@ test('justify_content_row_space_evenly', () => { const root_child2 = Yoga.Node.create(config); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1078,7 +1096,7 @@ test('justify_content_row_space_evenly', () => { expect(root_child2.getComputedWidth()).toBe(0); expect(root_child2.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1111,36 +1129,36 @@ test('justify_content_min_width_with_padding_child_width_greater_than_parent', ( const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignContent(Yoga.ALIGN_STRETCH); + root.setAlignContent(Align.Stretch); root.setWidth(1000); root.setHeight(1584); const root_child0 = Yoga.Node.create(config); - root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0.setAlignContent(Yoga.ALIGN_STRETCH); + root_child0.setFlexDirection(FlexDirection.Row); + root_child0.setAlignContent(Align.Stretch); root.insertChild(root_child0, 0); const root_child0_child0 = Yoga.Node.create(config); - root_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0_child0.setJustifyContent(Yoga.JUSTIFY_CENTER); - root_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); - root_child0_child0.setPadding(Yoga.EDGE_LEFT, 100); - root_child0_child0.setPadding(Yoga.EDGE_RIGHT, 100); + root_child0_child0.setFlexDirection(FlexDirection.Row); + root_child0_child0.setJustifyContent(Justify.Center); + root_child0_child0.setAlignContent(Align.Stretch); + root_child0_child0.setPadding(Edge.Left, 100); + root_child0_child0.setPadding(Edge.Right, 100); root_child0_child0.setMinWidth(400); root_child0.insertChild(root_child0_child0, 0); const root_child0_child0_child0 = Yoga.Node.create(config); - root_child0_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); + root_child0_child0_child0.setFlexDirection(FlexDirection.Row); + root_child0_child0_child0.setAlignContent(Align.Stretch); root_child0_child0_child0.setWidth(300); root_child0_child0_child0.setHeight(100); root_child0_child0.insertChild(root_child0_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1162,7 +1180,7 @@ test('justify_content_min_width_with_padding_child_width_greater_than_parent', ( expect(root_child0_child0_child0.getComputedWidth()).toBe(300); expect(root_child0_child0_child0.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1195,36 +1213,36 @@ test('justify_content_min_width_with_padding_child_width_lower_than_parent', () const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignContent(Yoga.ALIGN_STRETCH); + root.setAlignContent(Align.Stretch); root.setWidth(1080); root.setHeight(1584); const root_child0 = Yoga.Node.create(config); - root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0.setAlignContent(Yoga.ALIGN_STRETCH); + root_child0.setFlexDirection(FlexDirection.Row); + root_child0.setAlignContent(Align.Stretch); root.insertChild(root_child0, 0); const root_child0_child0 = Yoga.Node.create(config); - root_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0_child0.setJustifyContent(Yoga.JUSTIFY_CENTER); - root_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); - root_child0_child0.setPadding(Yoga.EDGE_LEFT, 100); - root_child0_child0.setPadding(Yoga.EDGE_RIGHT, 100); + root_child0_child0.setFlexDirection(FlexDirection.Row); + root_child0_child0.setJustifyContent(Justify.Center); + root_child0_child0.setAlignContent(Align.Stretch); + root_child0_child0.setPadding(Edge.Left, 100); + root_child0_child0.setPadding(Edge.Right, 100); root_child0_child0.setMinWidth(400); root_child0.insertChild(root_child0_child0, 0); const root_child0_child0_child0 = Yoga.Node.create(config); - root_child0_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0_child0_child0.setAlignContent(Yoga.ALIGN_STRETCH); + root_child0_child0_child0.setFlexDirection(FlexDirection.Row); + root_child0_child0_child0.setAlignContent(Align.Stretch); root_child0_child0_child0.setWidth(199); root_child0_child0_child0.setHeight(100); root_child0_child0.insertChild(root_child0_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1246,7 +1264,7 @@ test('justify_content_min_width_with_padding_child_width_lower_than_parent', () expect(root_child0_child0_child0.getComputedWidth()).toBe(199); expect(root_child0_child0_child0.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); diff --git a/javascript/tests/generated/YGMarginTest.test.js b/javascript/tests/generated/YGMarginTest.test.ts similarity index 77% rename from javascript/tests/generated/YGMarginTest.test.js rename to javascript/tests/generated/YGMarginTest.test.ts index fcd4c1a2..c98fa2da 100644 --- a/javascript/tests/generated/YGMarginTest.test.js +++ b/javascript/tests/generated/YGMarginTest.test.ts @@ -7,24 +7,42 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGMarginTest.html +import {Yoga} from "../tools/globals"; +import { + Align, + Direction, + Display, + Edge, + Errata, + ExperimentalFeature, + FlexDirection, + Gutter, + Justify, + MeasureMode, + Overflow, + PositionType, + Unit, + Wrap, +} from 'yoga-layout'; + test('margin_start', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_START, 10); + root_child0.setMargin(Edge.Start, 10); root_child0.setWidth(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -36,7 +54,7 @@ test('margin_start', () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -59,8 +77,8 @@ test('margin_top', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -68,10 +86,10 @@ test('margin_top', () => { root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_TOP, 10); + root_child0.setMargin(Edge.Top, 10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -83,7 +101,7 @@ test('margin_top', () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -106,21 +124,21 @@ test('margin_end', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); + root.setFlexDirection(FlexDirection.Row); + root.setJustifyContent(Justify.FlexEnd); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_END, 10); + root_child0.setMargin(Edge.End, 10); root_child0.setWidth(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -132,7 +150,7 @@ test('margin_end', () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -155,20 +173,20 @@ test('margin_bottom', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); + root.setJustifyContent(Justify.FlexEnd); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_BOTTOM, 10); + root_child0.setMargin(Edge.Bottom, 10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -180,7 +198,7 @@ test('margin_bottom', () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -203,21 +221,21 @@ test('margin_and_flex_row', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); - root_child0.setMargin(Yoga.EDGE_START, 10); - root_child0.setMargin(Yoga.EDGE_END, 10); + root_child0.setMargin(Edge.Start, 10); + root_child0.setMargin(Edge.End, 10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -229,7 +247,7 @@ test('margin_and_flex_row', () => { expect(root_child0.getComputedWidth()).toBe(80); expect(root_child0.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -252,8 +270,8 @@ test('margin_and_flex_column', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -262,10 +280,10 @@ test('margin_and_flex_column', () => { const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); - root_child0.setMargin(Yoga.EDGE_TOP, 10); - root_child0.setMargin(Yoga.EDGE_BOTTOM, 10); + root_child0.setMargin(Edge.Top, 10); + root_child0.setMargin(Edge.Bottom, 10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -277,7 +295,7 @@ test('margin_and_flex_column', () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(80); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -300,21 +318,21 @@ test('margin_and_stretch_row', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); - root_child0.setMargin(Yoga.EDGE_TOP, 10); - root_child0.setMargin(Yoga.EDGE_BOTTOM, 10); + root_child0.setMargin(Edge.Top, 10); + root_child0.setMargin(Edge.Bottom, 10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -326,7 +344,7 @@ test('margin_and_stretch_row', () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(80); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -349,8 +367,8 @@ test('margin_and_stretch_column', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -359,10 +377,10 @@ test('margin_and_stretch_column', () => { const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); - root_child0.setMargin(Yoga.EDGE_START, 10); - root_child0.setMargin(Yoga.EDGE_END, 10); + root_child0.setMargin(Edge.Start, 10); + root_child0.setMargin(Edge.End, 10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -374,7 +392,7 @@ test('margin_and_stretch_column', () => { expect(root_child0.getComputedWidth()).toBe(80); expect(root_child0.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -397,24 +415,24 @@ test('margin_with_sibling_row', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); - root_child0.setMargin(Yoga.EDGE_END, 10); + root_child0.setMargin(Edge.End, 10); root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -431,7 +449,7 @@ test('margin_with_sibling_row', () => { expect(root_child1.getComputedWidth()).toBe(45); expect(root_child1.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -459,8 +477,8 @@ test('margin_with_sibling_column', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -469,13 +487,13 @@ test('margin_with_sibling_column', () => { const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); - root_child0.setMargin(Yoga.EDGE_BOTTOM, 10); + root_child0.setMargin(Edge.Bottom, 10); root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -492,7 +510,7 @@ test('margin_with_sibling_column', () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(45); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -520,17 +538,17 @@ test('margin_auto_bottom', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setAlignItems(Align.Center); root.setWidth(200); root.setHeight(200); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_BOTTOM, "auto"); + root_child0.setMargin(Edge.Bottom, 'auto'); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); @@ -539,7 +557,7 @@ test('margin_auto_bottom', () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -556,7 +574,7 @@ test('margin_auto_bottom', () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -584,17 +602,17 @@ test('margin_auto_top', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setAlignItems(Align.Center); root.setWidth(200); root.setHeight(200); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_TOP, "auto"); + root_child0.setMargin(Edge.Top, 'auto'); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); @@ -603,7 +621,7 @@ test('margin_auto_top', () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -620,7 +638,7 @@ test('margin_auto_top', () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -648,18 +666,18 @@ test('margin_auto_bottom_and_top', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setAlignItems(Align.Center); root.setWidth(200); root.setHeight(200); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_TOP, "auto"); - root_child0.setMargin(Yoga.EDGE_BOTTOM, "auto"); + root_child0.setMargin(Edge.Top, 'auto'); + root_child0.setMargin(Edge.Bottom, 'auto'); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); @@ -668,7 +686,7 @@ test('margin_auto_bottom_and_top', () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -685,7 +703,7 @@ test('margin_auto_bottom_and_top', () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -713,18 +731,18 @@ test('margin_auto_bottom_and_top_justify_center', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); + root.setJustifyContent(Justify.Center); root.setWidth(200); root.setHeight(200); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_TOP, "auto"); - root_child0.setMargin(Yoga.EDGE_BOTTOM, "auto"); + root_child0.setMargin(Edge.Top, 'auto'); + root_child0.setMargin(Edge.Bottom, 'auto'); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); @@ -733,7 +751,7 @@ test('margin_auto_bottom_and_top_justify_center', () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -750,7 +768,7 @@ test('margin_auto_bottom_and_top_justify_center', () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -778,23 +796,23 @@ test('margin_auto_mutiple_children_column', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setAlignItems(Align.Center); root.setWidth(200); root.setHeight(200); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_TOP, "auto"); + root_child0.setMargin(Edge.Top, 'auto'); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(config); - root_child1.setMargin(Yoga.EDGE_TOP, "auto"); + root_child1.setMargin(Edge.Top, 'auto'); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); @@ -803,7 +821,7 @@ test('margin_auto_mutiple_children_column', () => { root_child2.setWidth(50); root_child2.setHeight(50); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -825,7 +843,7 @@ test('margin_auto_mutiple_children_column', () => { expect(root_child2.getComputedWidth()).toBe(50); expect(root_child2.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -858,24 +876,24 @@ test('margin_auto_mutiple_children_row', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setFlexDirection(FlexDirection.Row); + root.setAlignItems(Align.Center); root.setWidth(200); root.setHeight(200); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_RIGHT, "auto"); + root_child0.setMargin(Edge.Right, 'auto'); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(config); - root_child1.setMargin(Yoga.EDGE_RIGHT, "auto"); + root_child1.setMargin(Edge.Right, 'auto'); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); @@ -884,7 +902,7 @@ test('margin_auto_mutiple_children_row', () => { root_child2.setWidth(50); root_child2.setHeight(50); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -906,7 +924,7 @@ test('margin_auto_mutiple_children_row', () => { expect(root_child2.getComputedWidth()).toBe(50); expect(root_child2.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -939,19 +957,19 @@ test('margin_auto_left_and_right_column', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setFlexDirection(FlexDirection.Row); + root.setAlignItems(Align.Center); root.setWidth(200); root.setHeight(200); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_LEFT, "auto"); - root_child0.setMargin(Yoga.EDGE_RIGHT, "auto"); + root_child0.setMargin(Edge.Left, 'auto'); + root_child0.setMargin(Edge.Right, 'auto'); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); @@ -960,7 +978,7 @@ test('margin_auto_left_and_right_column', () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -977,7 +995,7 @@ test('margin_auto_left_and_right_column', () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1005,8 +1023,8 @@ test('margin_auto_left_and_right', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -1014,8 +1032,8 @@ test('margin_auto_left_and_right', () => { root.setHeight(200); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_LEFT, "auto"); - root_child0.setMargin(Yoga.EDGE_RIGHT, "auto"); + root_child0.setMargin(Edge.Left, 'auto'); + root_child0.setMargin(Edge.Right, 'auto'); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); @@ -1024,7 +1042,7 @@ test('margin_auto_left_and_right', () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1041,7 +1059,7 @@ test('margin_auto_left_and_right', () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1069,19 +1087,19 @@ test('margin_auto_start_and_end_column', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setFlexDirection(FlexDirection.Row); + root.setAlignItems(Align.Center); root.setWidth(200); root.setHeight(200); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_START, "auto"); - root_child0.setMargin(Yoga.EDGE_END, "auto"); + root_child0.setMargin(Edge.Start, 'auto'); + root_child0.setMargin(Edge.End, 'auto'); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); @@ -1090,7 +1108,7 @@ test('margin_auto_start_and_end_column', () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1107,7 +1125,7 @@ test('margin_auto_start_and_end_column', () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1135,8 +1153,8 @@ test('margin_auto_start_and_end', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -1144,8 +1162,8 @@ test('margin_auto_start_and_end', () => { root.setHeight(200); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_START, "auto"); - root_child0.setMargin(Yoga.EDGE_END, "auto"); + root_child0.setMargin(Edge.Start, 'auto'); + root_child0.setMargin(Edge.End, 'auto'); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); @@ -1154,7 +1172,7 @@ test('margin_auto_start_and_end', () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1171,7 +1189,7 @@ test('margin_auto_start_and_end', () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1199,18 +1217,18 @@ test('margin_auto_left_and_right_column_and_center', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setAlignItems(Align.Center); root.setWidth(200); root.setHeight(200); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_LEFT, "auto"); - root_child0.setMargin(Yoga.EDGE_RIGHT, "auto"); + root_child0.setMargin(Edge.Left, 'auto'); + root_child0.setMargin(Edge.Right, 'auto'); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); @@ -1219,7 +1237,7 @@ test('margin_auto_left_and_right_column_and_center', () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1236,7 +1254,7 @@ test('margin_auto_left_and_right_column_and_center', () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1264,17 +1282,17 @@ test('margin_auto_left', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setAlignItems(Align.Center); root.setWidth(200); root.setHeight(200); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_LEFT, "auto"); + root_child0.setMargin(Edge.Left, 'auto'); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); @@ -1283,7 +1301,7 @@ test('margin_auto_left', () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1300,7 +1318,7 @@ test('margin_auto_left', () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1328,17 +1346,17 @@ test('margin_auto_right', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setAlignItems(Align.Center); root.setWidth(200); root.setHeight(200); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_RIGHT, "auto"); + root_child0.setMargin(Edge.Right, 'auto'); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); @@ -1347,7 +1365,7 @@ test('margin_auto_right', () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1364,7 +1382,7 @@ test('margin_auto_right', () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1392,18 +1410,18 @@ test('margin_auto_left_and_right_stretch', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(200); root.setHeight(200); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_LEFT, "auto"); - root_child0.setMargin(Yoga.EDGE_RIGHT, "auto"); + root_child0.setMargin(Edge.Left, 'auto'); + root_child0.setMargin(Edge.Right, 'auto'); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); @@ -1412,7 +1430,7 @@ test('margin_auto_left_and_right_stretch', () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1429,7 +1447,7 @@ test('margin_auto_left_and_right_stretch', () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1457,8 +1475,8 @@ test('margin_auto_top_and_bottom_stretch', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -1466,8 +1484,8 @@ test('margin_auto_top_and_bottom_stretch', () => { root.setHeight(200); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_TOP, "auto"); - root_child0.setMargin(Yoga.EDGE_BOTTOM, "auto"); + root_child0.setMargin(Edge.Top, 'auto'); + root_child0.setMargin(Edge.Bottom, 'auto'); root_child0.setWidth(50); root_child0.setHeight(50); root.insertChild(root_child0, 0); @@ -1476,7 +1494,7 @@ test('margin_auto_top_and_bottom_stretch', () => { root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1493,7 +1511,7 @@ test('margin_auto_top_and_bottom_stretch', () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1521,8 +1539,8 @@ test('margin_should_not_be_part_of_max_height', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -1530,12 +1548,12 @@ test('margin_should_not_be_part_of_max_height', () => { root.setHeight(250); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_TOP, 20); + root_child0.setMargin(Edge.Top, 20); root_child0.setWidth(100); root_child0.setHeight(100); root_child0.setMaxHeight(100); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1547,7 +1565,7 @@ test('margin_should_not_be_part_of_max_height', () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1570,8 +1588,8 @@ test('margin_should_not_be_part_of_max_width', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -1579,12 +1597,12 @@ test('margin_should_not_be_part_of_max_width', () => { root.setHeight(250); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_LEFT, 20); + root_child0.setMargin(Edge.Left, 20); root_child0.setWidth(100); root_child0.setMaxWidth(100); root_child0.setHeight(100); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1596,7 +1614,7 @@ test('margin_should_not_be_part_of_max_width', () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1619,22 +1637,22 @@ test('margin_auto_left_right_child_bigger_than_parent', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); + root.setJustifyContent(Justify.Center); root.setWidth(52); root.setHeight(52); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_LEFT, "auto"); - root_child0.setMargin(Yoga.EDGE_RIGHT, "auto"); + root_child0.setMargin(Edge.Left, 'auto'); + root_child0.setMargin(Edge.Right, 'auto'); root_child0.setWidth(72); root_child0.setHeight(72); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1646,7 +1664,7 @@ test('margin_auto_left_right_child_bigger_than_parent', () => { expect(root_child0.getComputedWidth()).toBe(72); expect(root_child0.getComputedHeight()).toBe(72); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1669,21 +1687,21 @@ test('margin_auto_left_child_bigger_than_parent', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); + root.setJustifyContent(Justify.Center); root.setWidth(52); root.setHeight(52); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_LEFT, "auto"); + root_child0.setMargin(Edge.Left, 'auto'); root_child0.setWidth(72); root_child0.setHeight(72); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1695,7 +1713,7 @@ test('margin_auto_left_child_bigger_than_parent', () => { expect(root_child0.getComputedWidth()).toBe(72); expect(root_child0.getComputedHeight()).toBe(72); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1718,22 +1736,22 @@ test('margin_fix_left_auto_right_child_bigger_than_parent', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); + root.setJustifyContent(Justify.Center); root.setWidth(52); root.setHeight(52); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_LEFT, 10); - root_child0.setMargin(Yoga.EDGE_RIGHT, "auto"); + root_child0.setMargin(Edge.Left, 10); + root_child0.setMargin(Edge.Right, 'auto'); root_child0.setWidth(72); root_child0.setHeight(72); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1745,7 +1763,7 @@ test('margin_fix_left_auto_right_child_bigger_than_parent', () => { expect(root_child0.getComputedWidth()).toBe(72); expect(root_child0.getComputedHeight()).toBe(72); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1768,22 +1786,22 @@ test('margin_auto_left_fix_right_child_bigger_than_parent', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); + root.setJustifyContent(Justify.Center); root.setWidth(52); root.setHeight(52); const root_child0 = Yoga.Node.create(config); - root_child0.setMargin(Yoga.EDGE_LEFT, "auto"); - root_child0.setMargin(Yoga.EDGE_RIGHT, 10); + root_child0.setMargin(Edge.Left, 'auto'); + root_child0.setMargin(Edge.Right, 10); root_child0.setWidth(72); root_child0.setHeight(72); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1795,7 +1813,7 @@ test('margin_auto_left_fix_right_child_bigger_than_parent', () => { expect(root_child0.getComputedWidth()).toBe(72); expect(root_child0.getComputedHeight()).toBe(72); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1818,12 +1836,12 @@ test('margin_auto_top_stretching_child', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setAlignItems(Align.Center); root.setWidth(200); root.setHeight(200); @@ -1831,14 +1849,14 @@ test('margin_auto_top_stretching_child', () => { root_child0.setFlexGrow(1); root_child0.setFlexShrink(1); root_child0.setFlexBasis("0%"); - root_child0.setMargin(Yoga.EDGE_TOP, "auto"); + root_child0.setMargin(Edge.Top, 'auto'); root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1855,7 +1873,7 @@ test('margin_auto_top_stretching_child', () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1883,12 +1901,12 @@ test('margin_auto_left_stretching_child', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setAlignItems(Align.Center); root.setWidth(200); root.setHeight(200); @@ -1896,14 +1914,14 @@ test('margin_auto_left_stretching_child', () => { root_child0.setFlexGrow(1); root_child0.setFlexShrink(1); root_child0.setFlexBasis("0%"); - root_child0.setMargin(Yoga.EDGE_LEFT, "auto"); + root_child0.setMargin(Edge.Left, 'auto'); root.insertChild(root_child0, 0); const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1920,7 +1938,7 @@ test('margin_auto_left_stretching_child', () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); diff --git a/javascript/tests/generated/YGMinMaxDimensionTest.test.js b/javascript/tests/generated/YGMinMaxDimensionTest.test.ts similarity index 80% rename from javascript/tests/generated/YGMinMaxDimensionTest.test.js rename to javascript/tests/generated/YGMinMaxDimensionTest.test.ts index 9c4e961f..24ac6976 100644 --- a/javascript/tests/generated/YGMinMaxDimensionTest.test.js +++ b/javascript/tests/generated/YGMinMaxDimensionTest.test.ts @@ -7,12 +7,30 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGMinMaxDimensionTest.html +import {Yoga} from "../tools/globals"; +import { + Align, + Direction, + Display, + Edge, + Errata, + ExperimentalFeature, + FlexDirection, + Gutter, + Justify, + MeasureMode, + Overflow, + PositionType, + Unit, + Wrap, +} from 'yoga-layout'; + test('max_width', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -23,7 +41,7 @@ test('max_width', () => { root_child0.setMaxWidth(50); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -35,7 +53,7 @@ test('max_width', () => { expect(root_child0.getComputedWidth()).toBe(50); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -58,12 +76,12 @@ test('max_height', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(100); root.setHeight(100); @@ -71,7 +89,7 @@ test('max_height', () => { root_child0.setWidth(10); root_child0.setMaxHeight(50); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -83,7 +101,7 @@ test('max_height', () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -106,8 +124,8 @@ test.skip('min_height', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -122,7 +140,7 @@ test.skip('min_height', () => { const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -139,7 +157,7 @@ test.skip('min_height', () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(40); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -167,12 +185,12 @@ test.skip('min_width', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(100); root.setHeight(100); @@ -184,7 +202,7 @@ test.skip('min_width', () => { const root_child1 = Yoga.Node.create(config); root_child1.setFlexGrow(1); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -201,7 +219,7 @@ test.skip('min_width', () => { expect(root_child1.getComputedWidth()).toBe(40); expect(root_child1.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -229,12 +247,12 @@ test('justify_content_min_max', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); + root.setJustifyContent(Justify.Center); root.setWidth(100); root.setMinHeight(100); root.setMaxHeight(200); @@ -243,7 +261,7 @@ test('justify_content_min_max', () => { root_child0.setWidth(60); root_child0.setHeight(60); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -255,7 +273,7 @@ test('justify_content_min_max', () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(60); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -278,12 +296,12 @@ test('align_items_min_max', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setAlignItems(Align.Center); root.setMinWidth(100); root.setMaxWidth(200); root.setHeight(100); @@ -292,7 +310,7 @@ test('align_items_min_max', () => { root_child0.setWidth(60); root_child0.setHeight(60); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -304,7 +322,7 @@ test('align_items_min_max', () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(60); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -327,12 +345,12 @@ test('justify_content_overflow_min_max', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); + root.setJustifyContent(Justify.Center); root.setMinHeight(100); root.setMaxHeight(110); @@ -350,7 +368,7 @@ test('justify_content_overflow_min_max', () => { root_child2.setWidth(50); root_child2.setHeight(50); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -372,7 +390,7 @@ test('justify_content_overflow_min_max', () => { expect(root_child2.getComputedWidth()).toBe(50); expect(root_child2.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -405,8 +423,8 @@ test('flex_grow_to_min', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -422,7 +440,7 @@ test('flex_grow_to_min', () => { const root_child1 = Yoga.Node.create(config); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -439,7 +457,7 @@ test('flex_grow_to_min', () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -467,25 +485,25 @@ test('flex_grow_in_at_most_container', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.setAlignItems(Yoga.ALIGN_FLEX_START); + root.setFlexDirection(FlexDirection.Row); + root.setAlignItems(Align.FlexStart); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root_child0.setFlexDirection(FlexDirection.Row); root.insertChild(root_child0, 0); const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setFlexGrow(1); root_child0_child0.setFlexBasis(0); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -502,7 +520,7 @@ test('flex_grow_in_at_most_container', () => { expect(root_child0_child0.getComputedWidth()).toBe(0); expect(root_child0_child0.getComputedHeight()).toBe(0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -530,19 +548,19 @@ test('flex_grow_child', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis(0); root_child0.setHeight(100); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -554,7 +572,7 @@ test('flex_grow_child', () => { expect(root_child0.getComputedWidth()).toBe(0); expect(root_child0.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -577,8 +595,8 @@ test('flex_grow_within_constrained_min_max_column', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -592,7 +610,7 @@ test('flex_grow_within_constrained_min_max_column', () => { const root_child1 = Yoga.Node.create(config); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -609,7 +627,7 @@ test('flex_grow_within_constrained_min_max_column', () => { expect(root_child1.getComputedWidth()).toBe(0); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -637,8 +655,8 @@ test('flex_grow_within_max_width', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -646,7 +664,7 @@ test('flex_grow_within_max_width', () => { root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root_child0.setFlexDirection(FlexDirection.Row); root_child0.setMaxWidth(100); root.insertChild(root_child0, 0); @@ -654,7 +672,7 @@ test('flex_grow_within_max_width', () => { root_child0_child0.setFlexGrow(1); root_child0_child0.setHeight(20); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -671,7 +689,7 @@ test('flex_grow_within_max_width', () => { expect(root_child0_child0.getComputedWidth()).toBe(100); expect(root_child0_child0.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -699,8 +717,8 @@ test('flex_grow_within_constrained_max_width', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -708,7 +726,7 @@ test('flex_grow_within_constrained_max_width', () => { root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root_child0.setFlexDirection(FlexDirection.Row); root_child0.setMaxWidth(300); root.insertChild(root_child0, 0); @@ -716,7 +734,7 @@ test('flex_grow_within_constrained_max_width', () => { root_child0_child0.setFlexGrow(1); root_child0_child0.setHeight(20); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -733,7 +751,7 @@ test('flex_grow_within_constrained_max_width', () => { expect(root_child0_child0.getComputedWidth()).toBe(200); expect(root_child0_child0.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -761,8 +779,8 @@ test('flex_root_ignored', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -779,7 +797,7 @@ test('flex_root_ignored', () => { const root_child1 = Yoga.Node.create(config); root_child1.setHeight(100); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -796,7 +814,7 @@ test('flex_root_ignored', () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -824,8 +842,8 @@ test('flex_grow_root_minimized', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -847,7 +865,7 @@ test('flex_grow_root_minimized', () => { const root_child0_child1 = Yoga.Node.create(config); root_child0_child1.setHeight(100); root_child0.insertChild(root_child0_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -869,7 +887,7 @@ test('flex_grow_root_minimized', () => { expect(root_child0_child1.getComputedWidth()).toBe(100); expect(root_child0_child1.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -902,8 +920,8 @@ test('flex_grow_height_maximized', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -924,7 +942,7 @@ test('flex_grow_height_maximized', () => { const root_child0_child1 = Yoga.Node.create(config); root_child0_child1.setHeight(100); root_child0.insertChild(root_child0_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -946,7 +964,7 @@ test('flex_grow_height_maximized', () => { expect(root_child0_child1.getComputedWidth()).toBe(100); expect(root_child0_child1.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -979,12 +997,12 @@ test('flex_grow_within_constrained_min_row', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setMinWidth(100); root.setHeight(100); @@ -995,7 +1013,7 @@ test('flex_grow_within_constrained_min_row', () => { const root_child1 = Yoga.Node.create(config); root_child1.setWidth(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1012,7 +1030,7 @@ test('flex_grow_within_constrained_min_row', () => { expect(root_child1.getComputedWidth()).toBe(50); expect(root_child1.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1040,8 +1058,8 @@ test('flex_grow_within_constrained_min_column', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -1054,7 +1072,7 @@ test('flex_grow_within_constrained_min_column', () => { const root_child1 = Yoga.Node.create(config); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1071,7 +1089,7 @@ test('flex_grow_within_constrained_min_column', () => { expect(root_child1.getComputedWidth()).toBe(0); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1099,15 +1117,15 @@ test('flex_grow_within_constrained_max_row', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); root.setWidth(200); const root_child0 = Yoga.Node.create(config); - root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root_child0.setFlexDirection(FlexDirection.Row); root_child0.setMaxWidth(100); root_child0.setHeight(100); root.insertChild(root_child0, 0); @@ -1120,7 +1138,7 @@ test('flex_grow_within_constrained_max_row', () => { const root_child0_child1 = Yoga.Node.create(config); root_child0_child1.setWidth(50); root_child0.insertChild(root_child0_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1142,7 +1160,7 @@ test('flex_grow_within_constrained_max_row', () => { expect(root_child0_child1.getComputedWidth()).toBe(50); expect(root_child0_child1.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1175,8 +1193,8 @@ test('flex_grow_within_constrained_max_column', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -1191,7 +1209,7 @@ test('flex_grow_within_constrained_max_column', () => { const root_child1 = Yoga.Node.create(config); root_child1.setHeight(50); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1208,7 +1226,7 @@ test('flex_grow_within_constrained_max_column', () => { expect(root_child1.getComputedWidth()).toBe(100); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1236,12 +1254,12 @@ test('child_min_max_width_flexing', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(120); root.setHeight(50); @@ -1256,7 +1274,7 @@ test('child_min_max_width_flexing', () => { root_child1.setFlexBasis("50%"); root_child1.setMaxWidth(20); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1273,7 +1291,7 @@ test('child_min_max_width_flexing', () => { expect(root_child1.getComputedWidth()).toBe(20); expect(root_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1301,21 +1319,21 @@ test('min_width_overrides_width', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); root.setWidth(50); root.setMinWidth(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1333,21 +1351,21 @@ test('max_width_overrides_width', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); root.setWidth(200); root.setMaxWidth(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1365,21 +1383,21 @@ test('min_height_overrides_height', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); root.setHeight(50); root.setMinHeight(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); expect(root.getComputedWidth()).toBe(0); expect(root.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1397,21 +1415,21 @@ test('max_height_overrides_height', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); root.setHeight(200); root.setMaxHeight(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); expect(root.getComputedWidth()).toBe(0); expect(root.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1429,12 +1447,12 @@ test('min_max_percent_no_width_height', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setAlignItems(Yoga.ALIGN_FLEX_START); + root.setAlignItems(Align.FlexStart); root.setWidth(100); root.setHeight(100); @@ -1444,7 +1462,7 @@ test('min_max_percent_no_width_height', () => { root_child0.setMinHeight("10%"); root_child0.setMaxHeight("10%"); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1456,7 +1474,7 @@ test('min_max_percent_no_width_height', () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); diff --git a/javascript/tests/generated/YGPaddingTest.test.js b/javascript/tests/generated/YGPaddingTest.test.ts similarity index 67% rename from javascript/tests/generated/YGPaddingTest.test.js rename to javascript/tests/generated/YGPaddingTest.test.ts index 989fbecc..08377fa9 100644 --- a/javascript/tests/generated/YGPaddingTest.test.js +++ b/javascript/tests/generated/YGPaddingTest.test.ts @@ -7,27 +7,45 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGPaddingTest.html +import {Yoga} from "../tools/globals"; +import { + Align, + Direction, + Display, + Edge, + Errata, + ExperimentalFeature, + FlexDirection, + Gutter, + Justify, + MeasureMode, + Overflow, + PositionType, + Unit, + Wrap, +} from 'yoga-layout'; + test('padding_no_size', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setPadding(Yoga.EDGE_LEFT, 10); - root.setPadding(Yoga.EDGE_TOP, 10); - root.setPadding(Yoga.EDGE_RIGHT, 10); - root.setPadding(Yoga.EDGE_BOTTOM, 10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.setPadding(Edge.Left, 10); + root.setPadding(Edge.Top, 10); + root.setPadding(Edge.Right, 10); + root.setPadding(Edge.Bottom, 10); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); expect(root.getComputedWidth()).toBe(20); expect(root.getComputedHeight()).toBe(20); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -45,21 +63,21 @@ test('padding_container_match_child', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setPadding(Yoga.EDGE_LEFT, 10); - root.setPadding(Yoga.EDGE_TOP, 10); - root.setPadding(Yoga.EDGE_RIGHT, 10); - root.setPadding(Yoga.EDGE_BOTTOM, 10); + root.setPadding(Edge.Left, 10); + root.setPadding(Edge.Top, 10); + root.setPadding(Edge.Right, 10); + root.setPadding(Edge.Bottom, 10); const root_child0 = Yoga.Node.create(config); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -71,7 +89,7 @@ test('padding_container_match_child', () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -94,15 +112,15 @@ test('padding_flex_child', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setPadding(Yoga.EDGE_LEFT, 10); - root.setPadding(Yoga.EDGE_TOP, 10); - root.setPadding(Yoga.EDGE_RIGHT, 10); - root.setPadding(Yoga.EDGE_BOTTOM, 10); + root.setPadding(Edge.Left, 10); + root.setPadding(Edge.Top, 10); + root.setPadding(Edge.Right, 10); + root.setPadding(Edge.Bottom, 10); root.setWidth(100); root.setHeight(100); @@ -110,7 +128,7 @@ test('padding_flex_child', () => { root_child0.setFlexGrow(1); root_child0.setWidth(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -122,7 +140,7 @@ test('padding_flex_child', () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(80); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -145,22 +163,22 @@ test('padding_stretch_child', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setPadding(Yoga.EDGE_LEFT, 10); - root.setPadding(Yoga.EDGE_TOP, 10); - root.setPadding(Yoga.EDGE_RIGHT, 10); - root.setPadding(Yoga.EDGE_BOTTOM, 10); + root.setPadding(Edge.Left, 10); + root.setPadding(Edge.Top, 10); + root.setPadding(Edge.Right, 10); + root.setPadding(Edge.Bottom, 10); root.setWidth(100); root.setHeight(100); const root_child0 = Yoga.Node.create(config); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -172,7 +190,7 @@ test('padding_stretch_child', () => { expect(root_child0.getComputedWidth()).toBe(80); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -195,16 +213,16 @@ test('padding_center_child', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); - root.setAlignItems(Yoga.ALIGN_CENTER); - root.setPadding(Yoga.EDGE_START, 10); - root.setPadding(Yoga.EDGE_END, 20); - root.setPadding(Yoga.EDGE_BOTTOM, 20); + root.setJustifyContent(Justify.Center); + root.setAlignItems(Align.Center); + root.setPadding(Edge.Start, 10); + root.setPadding(Edge.End, 20); + root.setPadding(Edge.Bottom, 20); root.setWidth(100); root.setHeight(100); @@ -212,7 +230,7 @@ test('padding_center_child', () => { root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -224,7 +242,7 @@ test('padding_center_child', () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -247,25 +265,25 @@ test('child_with_padding_align_end', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_FLEX_END); - root.setAlignItems(Yoga.ALIGN_FLEX_END); + root.setJustifyContent(Justify.FlexEnd); + root.setAlignItems(Align.FlexEnd); root.setWidth(200); root.setHeight(200); const root_child0 = Yoga.Node.create(config); - root_child0.setPadding(Yoga.EDGE_LEFT, 20); - root_child0.setPadding(Yoga.EDGE_TOP, 20); - root_child0.setPadding(Yoga.EDGE_RIGHT, 20); - root_child0.setPadding(Yoga.EDGE_BOTTOM, 20); + root_child0.setPadding(Edge.Left, 20); + root_child0.setPadding(Edge.Top, 20); + root_child0.setPadding(Edge.Right, 20); + root_child0.setPadding(Edge.Bottom, 20); root_child0.setWidth(100); root_child0.setHeight(100); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -277,7 +295,7 @@ test('child_with_padding_align_end', () => { expect(root_child0.getComputedWidth()).toBe(100); expect(root_child0.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); diff --git a/javascript/tests/generated/YGPercentageTest.test.js b/javascript/tests/generated/YGPercentageTest.test.ts similarity index 79% rename from javascript/tests/generated/YGPercentageTest.test.js rename to javascript/tests/generated/YGPercentageTest.test.ts index 2cd38aad..14a58498 100644 --- a/javascript/tests/generated/YGPercentageTest.test.js +++ b/javascript/tests/generated/YGPercentageTest.test.ts @@ -7,16 +7,34 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGPercentageTest.html +import {Yoga} from "../tools/globals"; +import { + Align, + Direction, + Display, + Edge, + Errata, + ExperimentalFeature, + FlexDirection, + Gutter, + Justify, + MeasureMode, + Overflow, + PositionType, + Unit, + Wrap, +} from 'yoga-layout'; + test('percentage_width_height', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(200); root.setHeight(200); @@ -24,7 +42,7 @@ test('percentage_width_height', () => { root_child0.setWidth("30%"); root_child0.setHeight("30%"); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -36,7 +54,7 @@ test('percentage_width_height', () => { expect(root_child0.getComputedWidth()).toBe(60); expect(root_child0.getComputedHeight()).toBe(60); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -59,22 +77,22 @@ test('percentage_position_left_top', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(400); root.setHeight(400); const root_child0 = Yoga.Node.create(config); - root_child0.setPosition(Yoga.EDGE_LEFT, "10%"); - root_child0.setPosition(Yoga.EDGE_TOP, "20%"); + root_child0.setPosition(Edge.Left, "10%"); + root_child0.setPosition(Edge.Top, "20%"); root_child0.setWidth("45%"); root_child0.setHeight("55%"); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -86,7 +104,7 @@ test('percentage_position_left_top', () => { expect(root_child0.getComputedWidth()).toBe(180); expect(root_child0.getComputedHeight()).toBe(220); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -109,22 +127,22 @@ test('percentage_position_bottom_right', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(500); root.setHeight(500); const root_child0 = Yoga.Node.create(config); - root_child0.setPosition(Yoga.EDGE_RIGHT, "20%"); - root_child0.setPosition(Yoga.EDGE_BOTTOM, "10%"); + root_child0.setPosition(Edge.Right, "20%"); + root_child0.setPosition(Edge.Bottom, "10%"); root_child0.setWidth("55%"); root_child0.setHeight("15%"); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -136,7 +154,7 @@ test('percentage_position_bottom_right', () => { expect(root_child0.getComputedWidth()).toBe(275); expect(root_child0.getComputedHeight()).toBe(75); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -159,12 +177,12 @@ test('percentage_flex_basis', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(200); root.setHeight(200); @@ -177,7 +195,7 @@ test('percentage_flex_basis', () => { root_child1.setFlexGrow(1); root_child1.setFlexBasis("25%"); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -194,7 +212,7 @@ test('percentage_flex_basis', () => { expect(root_child1.getComputedWidth()).toBe(75); expect(root_child1.getComputedHeight()).toBe(200); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -222,8 +240,8 @@ test('percentage_flex_basis_cross', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -239,7 +257,7 @@ test('percentage_flex_basis_cross', () => { root_child1.setFlexGrow(1); root_child1.setFlexBasis("25%"); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -256,7 +274,7 @@ test('percentage_flex_basis_cross', () => { expect(root_child1.getComputedWidth()).toBe(200); expect(root_child1.getComputedHeight()).toBe(75); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -284,8 +302,8 @@ test.skip('percentage_flex_basis_cross_min_height', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -301,7 +319,7 @@ test.skip('percentage_flex_basis_cross_min_height', () => { root_child1.setFlexGrow(2); root_child1.setMinHeight("10%"); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -318,7 +336,7 @@ test.skip('percentage_flex_basis_cross_min_height', () => { expect(root_child1.getComputedWidth()).toBe(200); expect(root_child1.getComputedHeight()).toBe(80); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -346,12 +364,12 @@ test('percentage_flex_basis_main_max_height', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(200); root.setHeight(200); @@ -366,7 +384,7 @@ test('percentage_flex_basis_main_max_height', () => { root_child1.setFlexBasis("10%"); root_child1.setMaxHeight("20%"); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -383,7 +401,7 @@ test('percentage_flex_basis_main_max_height', () => { expect(root_child1.getComputedWidth()).toBe(148); expect(root_child1.getComputedHeight()).toBe(40); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -411,8 +429,8 @@ test('percentage_flex_basis_cross_max_height', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -430,7 +448,7 @@ test('percentage_flex_basis_cross_max_height', () => { root_child1.setFlexBasis("10%"); root_child1.setMaxHeight("20%"); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -447,7 +465,7 @@ test('percentage_flex_basis_cross_max_height', () => { expect(root_child1.getComputedWidth()).toBe(200); expect(root_child1.getComputedHeight()).toBe(40); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -475,12 +493,12 @@ test('percentage_flex_basis_main_max_width', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(200); root.setHeight(200); @@ -495,7 +513,7 @@ test('percentage_flex_basis_main_max_width', () => { root_child1.setFlexBasis("10%"); root_child1.setMaxWidth("20%"); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -512,7 +530,7 @@ test('percentage_flex_basis_main_max_width', () => { expect(root_child1.getComputedWidth()).toBe(40); expect(root_child1.getComputedHeight()).toBe(200); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -540,8 +558,8 @@ test('percentage_flex_basis_cross_max_width', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -559,7 +577,7 @@ test('percentage_flex_basis_cross_max_width', () => { root_child1.setFlexBasis("15%"); root_child1.setMaxWidth("20%"); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -576,7 +594,7 @@ test('percentage_flex_basis_cross_max_width', () => { expect(root_child1.getComputedWidth()).toBe(40); expect(root_child1.getComputedHeight()).toBe(150); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -604,12 +622,12 @@ test('percentage_flex_basis_main_min_width', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(200); root.setHeight(200); @@ -624,7 +642,7 @@ test('percentage_flex_basis_main_min_width', () => { root_child1.setFlexBasis("10%"); root_child1.setMinWidth("20%"); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -641,7 +659,7 @@ test('percentage_flex_basis_main_min_width', () => { expect(root_child1.getComputedWidth()).toBe(80); expect(root_child1.getComputedHeight()).toBe(200); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -669,8 +687,8 @@ test('percentage_flex_basis_cross_min_width', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -688,7 +706,7 @@ test('percentage_flex_basis_cross_min_width', () => { root_child1.setFlexBasis("15%"); root_child1.setMinWidth("20%"); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -705,7 +723,7 @@ test('percentage_flex_basis_cross_min_width', () => { expect(root_child1.getComputedWidth()).toBe(200); expect(root_child1.getComputedHeight()).toBe(150); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -733,8 +751,8 @@ test('percentage_multiple_nested_with_padding_margin_and_percentage_values', () const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -744,38 +762,38 @@ test('percentage_multiple_nested_with_padding_margin_and_percentage_values', () const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); root_child0.setFlexBasis("10%"); - root_child0.setMargin(Yoga.EDGE_LEFT, 5); - root_child0.setMargin(Yoga.EDGE_TOP, 5); - root_child0.setMargin(Yoga.EDGE_RIGHT, 5); - root_child0.setMargin(Yoga.EDGE_BOTTOM, 5); - root_child0.setPadding(Yoga.EDGE_LEFT, 3); - root_child0.setPadding(Yoga.EDGE_TOP, 3); - root_child0.setPadding(Yoga.EDGE_RIGHT, 3); - root_child0.setPadding(Yoga.EDGE_BOTTOM, 3); + root_child0.setMargin(Edge.Left, 5); + root_child0.setMargin(Edge.Top, 5); + root_child0.setMargin(Edge.Right, 5); + root_child0.setMargin(Edge.Bottom, 5); + root_child0.setPadding(Edge.Left, 3); + root_child0.setPadding(Edge.Top, 3); + root_child0.setPadding(Edge.Right, 3); + root_child0.setPadding(Edge.Bottom, 3); root_child0.setMinWidth("60%"); root.insertChild(root_child0, 0); const root_child0_child0 = Yoga.Node.create(config); - root_child0_child0.setMargin(Yoga.EDGE_LEFT, 5); - root_child0_child0.setMargin(Yoga.EDGE_TOP, 5); - root_child0_child0.setMargin(Yoga.EDGE_RIGHT, 5); - root_child0_child0.setMargin(Yoga.EDGE_BOTTOM, 5); - root_child0_child0.setPadding(Yoga.EDGE_LEFT, "3%"); - root_child0_child0.setPadding(Yoga.EDGE_TOP, "3%"); - root_child0_child0.setPadding(Yoga.EDGE_RIGHT, "3%"); - root_child0_child0.setPadding(Yoga.EDGE_BOTTOM, "3%"); + root_child0_child0.setMargin(Edge.Left, 5); + root_child0_child0.setMargin(Edge.Top, 5); + root_child0_child0.setMargin(Edge.Right, 5); + root_child0_child0.setMargin(Edge.Bottom, 5); + root_child0_child0.setPadding(Edge.Left, "3%"); + root_child0_child0.setPadding(Edge.Top, "3%"); + root_child0_child0.setPadding(Edge.Right, "3%"); + root_child0_child0.setPadding(Edge.Bottom, "3%"); root_child0_child0.setWidth("50%"); root_child0.insertChild(root_child0_child0, 0); const root_child0_child0_child0 = Yoga.Node.create(config); - root_child0_child0_child0.setMargin(Yoga.EDGE_LEFT, "5%"); - root_child0_child0_child0.setMargin(Yoga.EDGE_TOP, "5%"); - root_child0_child0_child0.setMargin(Yoga.EDGE_RIGHT, "5%"); - root_child0_child0_child0.setMargin(Yoga.EDGE_BOTTOM, "5%"); - root_child0_child0_child0.setPadding(Yoga.EDGE_LEFT, 3); - root_child0_child0_child0.setPadding(Yoga.EDGE_TOP, 3); - root_child0_child0_child0.setPadding(Yoga.EDGE_RIGHT, 3); - root_child0_child0_child0.setPadding(Yoga.EDGE_BOTTOM, 3); + root_child0_child0_child0.setMargin(Edge.Left, "5%"); + root_child0_child0_child0.setMargin(Edge.Top, "5%"); + root_child0_child0_child0.setMargin(Edge.Right, "5%"); + root_child0_child0_child0.setMargin(Edge.Bottom, "5%"); + root_child0_child0_child0.setPadding(Edge.Left, 3); + root_child0_child0_child0.setPadding(Edge.Top, 3); + root_child0_child0_child0.setPadding(Edge.Right, 3); + root_child0_child0_child0.setPadding(Edge.Bottom, 3); root_child0_child0_child0.setWidth("45%"); root_child0_child0.insertChild(root_child0_child0_child0, 0); @@ -784,7 +802,7 @@ test('percentage_multiple_nested_with_padding_margin_and_percentage_values', () root_child1.setFlexBasis("15%"); root_child1.setMinWidth("20%"); root.insertChild(root_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -811,7 +829,7 @@ test('percentage_multiple_nested_with_padding_margin_and_percentage_values', () expect(root_child1.getComputedWidth()).toBe(200); expect(root_child1.getComputedHeight()).toBe(142); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -849,8 +867,8 @@ test('percentage_margin_should_calculate_based_only_on_width', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -859,17 +877,17 @@ test('percentage_margin_should_calculate_based_only_on_width', () => { const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); - root_child0.setMargin(Yoga.EDGE_LEFT, "10%"); - root_child0.setMargin(Yoga.EDGE_TOP, "10%"); - root_child0.setMargin(Yoga.EDGE_RIGHT, "10%"); - root_child0.setMargin(Yoga.EDGE_BOTTOM, "10%"); + root_child0.setMargin(Edge.Left, "10%"); + root_child0.setMargin(Edge.Top, "10%"); + root_child0.setMargin(Edge.Right, "10%"); + root_child0.setMargin(Edge.Bottom, "10%"); root.insertChild(root_child0, 0); const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setWidth(10); root_child0_child0.setHeight(10); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -886,7 +904,7 @@ test('percentage_margin_should_calculate_based_only_on_width', () => { expect(root_child0_child0.getComputedWidth()).toBe(10); expect(root_child0_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -914,8 +932,8 @@ test('percentage_padding_should_calculate_based_only_on_width', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -924,17 +942,17 @@ test('percentage_padding_should_calculate_based_only_on_width', () => { const root_child0 = Yoga.Node.create(config); root_child0.setFlexGrow(1); - root_child0.setPadding(Yoga.EDGE_LEFT, "10%"); - root_child0.setPadding(Yoga.EDGE_TOP, "10%"); - root_child0.setPadding(Yoga.EDGE_RIGHT, "10%"); - root_child0.setPadding(Yoga.EDGE_BOTTOM, "10%"); + root_child0.setPadding(Edge.Left, "10%"); + root_child0.setPadding(Edge.Top, "10%"); + root_child0.setPadding(Edge.Right, "10%"); + root_child0.setPadding(Edge.Bottom, "10%"); root.insertChild(root_child0, 0); const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setWidth(10); root_child0_child0.setHeight(10); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -951,7 +969,7 @@ test('percentage_padding_should_calculate_based_only_on_width', () => { expect(root_child0_child0.getComputedWidth()).toBe(10); expect(root_child0_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -979,8 +997,8 @@ test('percentage_absolute_position', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -988,13 +1006,13 @@ test('percentage_absolute_position', () => { root.setHeight(100); const root_child0 = Yoga.Node.create(config); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); - root_child0.setPosition(Yoga.EDGE_LEFT, "30%"); - root_child0.setPosition(Yoga.EDGE_TOP, "10%"); + root_child0.setPositionType(PositionType.Absolute); + root_child0.setPosition(Edge.Left, "30%"); + root_child0.setPosition(Edge.Top, "10%"); root_child0.setWidth(10); root_child0.setHeight(10); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1006,7 +1024,7 @@ test('percentage_absolute_position', () => { expect(root_child0.getComputedWidth()).toBe(10); expect(root_child0.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1029,8 +1047,8 @@ test('percentage_width_height_undefined_parent_size', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -1039,7 +1057,7 @@ test('percentage_width_height_undefined_parent_size', () => { root_child0.setWidth("50%"); root_child0.setHeight("50%"); root.insertChild(root_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1051,7 +1069,7 @@ test('percentage_width_height_undefined_parent_size', () => { expect(root_child0.getComputedWidth()).toBe(0); expect(root_child0.getComputedHeight()).toBe(0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1074,12 +1092,12 @@ test('percent_within_flex_grow', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(350); root.setHeight(100); @@ -1098,7 +1116,7 @@ test('percent_within_flex_grow', () => { const root_child2 = Yoga.Node.create(config); root_child2.setWidth(100); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1125,7 +1143,7 @@ test('percent_within_flex_grow', () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1163,13 +1181,13 @@ test('percentage_container_in_wrapping_container', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setJustifyContent(Yoga.JUSTIFY_CENTER); - root.setAlignItems(Yoga.ALIGN_CENTER); + root.setJustifyContent(Justify.Center); + root.setAlignItems(Align.Center); root.setWidth(200); root.setHeight(200); @@ -1177,8 +1195,8 @@ test('percentage_container_in_wrapping_container', () => { root.insertChild(root_child0, 0); const root_child0_child0 = Yoga.Node.create(config); - root_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0_child0.setJustifyContent(Yoga.JUSTIFY_CENTER); + root_child0_child0.setFlexDirection(FlexDirection.Row); + root_child0_child0.setJustifyContent(Justify.Center); root_child0_child0.setWidth("100%"); root_child0.insertChild(root_child0_child0, 0); @@ -1191,7 +1209,7 @@ test('percentage_container_in_wrapping_container', () => { root_child0_child0_child1.setWidth(50); root_child0_child0_child1.setHeight(50); root_child0_child0.insertChild(root_child0_child0_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1218,7 +1236,7 @@ test('percentage_container_in_wrapping_container', () => { expect(root_child0_child0_child1.getComputedWidth()).toBe(50); expect(root_child0_child0_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1256,8 +1274,8 @@ test('percent_absolute_position', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -1265,9 +1283,9 @@ test('percent_absolute_position', () => { root.setHeight(50); const root_child0 = Yoga.Node.create(config); - root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); - root_child0.setPosition(Yoga.EDGE_LEFT, "50%"); + root_child0.setFlexDirection(FlexDirection.Row); + root_child0.setPositionType(PositionType.Absolute); + root_child0.setPosition(Edge.Left, "50%"); root_child0.setWidth("100%"); root_child0.setHeight(50); root.insertChild(root_child0, 0); @@ -1279,7 +1297,7 @@ test('percent_absolute_position', () => { const root_child0_child1 = Yoga.Node.create(config); root_child0_child1.setWidth("100%"); root_child0.insertChild(root_child0_child1, 1); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1301,7 +1319,7 @@ test('percent_absolute_position', () => { expect(root_child0_child1.getComputedWidth()).toBe(60); expect(root_child0_child1.getComputedHeight()).toBe(50); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); diff --git a/javascript/tests/generated/YGRoundingTest.test.js b/javascript/tests/generated/YGRoundingTest.test.ts similarity index 88% rename from javascript/tests/generated/YGRoundingTest.test.js rename to javascript/tests/generated/YGRoundingTest.test.ts index a4932d3e..04c9384f 100644 --- a/javascript/tests/generated/YGRoundingTest.test.js +++ b/javascript/tests/generated/YGRoundingTest.test.ts @@ -7,16 +7,34 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGRoundingTest.html +import {Yoga} from "../tools/globals"; +import { + Align, + Direction, + Display, + Edge, + Errata, + ExperimentalFeature, + FlexDirection, + Gutter, + Justify, + MeasureMode, + Overflow, + PositionType, + Unit, + Wrap, +} from 'yoga-layout'; + test('rounding_flex_basis_flex_grow_row_width_of_100', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(100); root.setHeight(100); @@ -31,7 +49,7 @@ test('rounding_flex_basis_flex_grow_row_width_of_100', () => { const root_child2 = Yoga.Node.create(config); root_child2.setFlexGrow(1); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -53,7 +71,7 @@ test('rounding_flex_basis_flex_grow_row_width_of_100', () => { expect(root_child2.getComputedWidth()).toBe(33); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -86,12 +104,12 @@ test('rounding_flex_basis_flex_grow_row_prime_number_width', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(113); root.setHeight(100); @@ -114,7 +132,7 @@ test('rounding_flex_basis_flex_grow_row_prime_number_width', () => { const root_child4 = Yoga.Node.create(config); root_child4.setFlexGrow(1); root.insertChild(root_child4, 4); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -146,7 +164,7 @@ test('rounding_flex_basis_flex_grow_row_prime_number_width', () => { expect(root_child4.getComputedWidth()).toBe(23); expect(root_child4.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -189,12 +207,12 @@ test('rounding_flex_basis_flex_shrink_row', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(101); root.setHeight(100); @@ -210,7 +228,7 @@ test('rounding_flex_basis_flex_shrink_row', () => { const root_child2 = Yoga.Node.create(config); root_child2.setFlexBasis(25); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -232,7 +250,7 @@ test('rounding_flex_basis_flex_shrink_row', () => { expect(root_child2.getComputedWidth()).toBe(25); expect(root_child2.getComputedHeight()).toBe(100); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -265,8 +283,8 @@ test('rounding_flex_basis_overrides_main_size', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -288,7 +306,7 @@ test('rounding_flex_basis_overrides_main_size', () => { root_child2.setFlexGrow(1); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -310,7 +328,7 @@ test('rounding_flex_basis_overrides_main_size', () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(24); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -343,8 +361,8 @@ test('rounding_total_fractial', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -366,7 +384,7 @@ test('rounding_total_fractial', () => { root_child2.setFlexGrow(1.1); root_child2.setHeight(10.7); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -388,7 +406,7 @@ test('rounding_total_fractial', () => { expect(root_child2.getComputedWidth()).toBe(87); expect(root_child2.getComputedHeight()).toBe(24); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -421,8 +439,8 @@ test('rounding_total_fractial_nested', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -438,14 +456,14 @@ test('rounding_total_fractial_nested', () => { const root_child0_child0 = Yoga.Node.create(config); root_child0_child0.setFlexGrow(1); root_child0_child0.setFlexBasis(0.3); - root_child0_child0.setPosition(Yoga.EDGE_BOTTOM, 13.3); + root_child0_child0.setPosition(Edge.Bottom, 13.3); root_child0_child0.setHeight(9.9); root_child0.insertChild(root_child0_child0, 0); const root_child0_child1 = Yoga.Node.create(config); root_child0_child1.setFlexGrow(4); root_child0_child1.setFlexBasis(0.3); - root_child0_child1.setPosition(Yoga.EDGE_TOP, 13.3); + root_child0_child1.setPosition(Edge.Top, 13.3); root_child0_child1.setHeight(1.1); root_child0.insertChild(root_child0_child1, 1); @@ -458,7 +476,7 @@ test('rounding_total_fractial_nested', () => { root_child2.setFlexGrow(1.1); root_child2.setHeight(10.7); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -490,7 +508,7 @@ test('rounding_total_fractial_nested', () => { expect(root_child2.getComputedWidth()).toBe(87); expect(root_child2.getComputedHeight()).toBe(24); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -533,8 +551,8 @@ test('rounding_fractial_input_1', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -556,7 +574,7 @@ test('rounding_fractial_input_1', () => { root_child2.setFlexGrow(1); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -578,7 +596,7 @@ test('rounding_fractial_input_1', () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(24); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -611,8 +629,8 @@ test('rounding_fractial_input_2', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -634,7 +652,7 @@ test('rounding_fractial_input_2', () => { root_child2.setFlexGrow(1); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -656,7 +674,7 @@ test('rounding_fractial_input_2', () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(25); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -689,12 +707,12 @@ test('rounding_fractial_input_3', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setPosition(Yoga.EDGE_TOP, 0.3); + root.setPosition(Edge.Top, 0.3); root.setWidth(100); root.setHeight(113.4); @@ -713,7 +731,7 @@ test('rounding_fractial_input_3', () => { root_child2.setFlexGrow(1); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -735,7 +753,7 @@ test('rounding_fractial_input_3', () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(25); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -768,12 +786,12 @@ test('rounding_fractial_input_4', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setPosition(Yoga.EDGE_TOP, 0.7); + root.setPosition(Edge.Top, 0.7); root.setWidth(100); root.setHeight(113.4); @@ -792,7 +810,7 @@ test('rounding_fractial_input_4', () => { root_child2.setFlexGrow(1); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(1); @@ -814,7 +832,7 @@ test('rounding_fractial_input_4', () => { expect(root_child2.getComputedWidth()).toBe(100); expect(root_child2.getComputedHeight()).toBe(24); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(1); @@ -847,12 +865,12 @@ test('rounding_inner_node_controversy_horizontal', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(320); const root_child0 = Yoga.Node.create(config); @@ -874,7 +892,7 @@ test('rounding_inner_node_controversy_horizontal', () => { root_child2.setFlexGrow(1); root_child2.setHeight(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -901,7 +919,7 @@ test('rounding_inner_node_controversy_horizontal', () => { expect(root_child2.getComputedWidth()).toBe(107); expect(root_child2.getComputedHeight()).toBe(10); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -939,8 +957,8 @@ test('rounding_inner_node_controversy_vertical', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -965,7 +983,7 @@ test('rounding_inner_node_controversy_vertical', () => { root_child2.setFlexGrow(1); root_child2.setWidth(10); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -992,7 +1010,7 @@ test('rounding_inner_node_controversy_vertical', () => { expect(root_child2.getComputedWidth()).toBe(10); expect(root_child2.getComputedHeight()).toBe(107); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1030,12 +1048,12 @@ test('rounding_inner_node_controversy_combined', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); - root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.setFlexDirection(FlexDirection.Row); root.setWidth(640); root.setHeight(320); @@ -1073,7 +1091,7 @@ test('rounding_inner_node_controversy_combined', () => { root_child2.setFlexGrow(1); root_child2.setHeight("100%"); root.insertChild(root_child2, 2); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -1115,7 +1133,7 @@ test('rounding_inner_node_controversy_combined', () => { expect(root_child2.getComputedWidth()).toBe(213); expect(root_child2.getComputedHeight()).toBe(320); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); diff --git a/javascript/tests/generated/YGSizeOverflowTest.test.js b/javascript/tests/generated/YGSizeOverflowTest.test.ts similarity index 82% rename from javascript/tests/generated/YGSizeOverflowTest.test.js rename to javascript/tests/generated/YGSizeOverflowTest.test.ts index e9546012..d6cce67e 100644 --- a/javascript/tests/generated/YGSizeOverflowTest.test.js +++ b/javascript/tests/generated/YGSizeOverflowTest.test.ts @@ -7,12 +7,30 @@ // @generated by gentest/gentest.rb from gentest/fixtures/YGSizeOverflowTest.html +import {Yoga} from "../tools/globals"; +import { + Align, + Direction, + Display, + Edge, + Errata, + ExperimentalFeature, + FlexDirection, + Gutter, + Justify, + MeasureMode, + Overflow, + PositionType, + Unit, + Wrap, +} from 'yoga-layout'; + test('nested_overflowing_child', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -26,7 +44,7 @@ test('nested_overflowing_child', () => { root_child0_child0.setWidth(200); root_child0_child0.setHeight(200); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -43,7 +61,7 @@ test('nested_overflowing_child', () => { expect(root_child0_child0.getComputedWidth()).toBe(200); expect(root_child0_child0.getComputedHeight()).toBe(200); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -71,8 +89,8 @@ test('nested_overflowing_child_in_constraint_parent', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -88,7 +106,7 @@ test('nested_overflowing_child_in_constraint_parent', () => { root_child0_child0.setWidth(200); root_child0_child0.setHeight(200); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -105,7 +123,7 @@ test('nested_overflowing_child_in_constraint_parent', () => { expect(root_child0_child0.getComputedWidth()).toBe(200); expect(root_child0_child0.getComputedHeight()).toBe(200); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -133,8 +151,8 @@ test('parent_wrap_child_size_overflowing_parent', () => { const config = Yoga.Config.create(); let root; - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true); - config.setExperimentalFeatureEnabled(Yoga.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true); + config.setExperimentalFeatureEnabled(ExperimentalFeature.FixAbsoluteTrailingColumnMargin, true); try { root = Yoga.Node.create(config); @@ -149,7 +167,7 @@ test('parent_wrap_child_size_overflowing_parent', () => { root_child0_child0.setWidth(100); root_child0_child0.setHeight(200); root_child0.insertChild(root_child0_child0, 0); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); + root.calculateLayout(undefined, undefined, Direction.LTR); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); @@ -166,7 +184,7 @@ test('parent_wrap_child_size_overflowing_parent', () => { expect(root_child0_child0.getComputedWidth()).toBe(100); expect(root_child0_child0.getComputedHeight()).toBe(200); - root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); + root.calculateLayout(undefined, undefined, Direction.RTL); expect(root.getComputedLeft()).toBe(0); expect(root.getComputedTop()).toBe(0); -- 2.50.1.windows.1