Skip to content

Commit 06eb154

Browse files
committed
Regenerate YGPercentageTest fixtures after rebase onto main
1 parent 6813a57 commit 06eb154

3 files changed

Lines changed: 340 additions & 4 deletions

File tree

‎java/tests/generated/com/facebook/yoga/YGPercentageTest.java‎

Lines changed: 115 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<f4f43f15e5bcf5ed02e631d44d9260e7>>
7+
* @generated SignedSource<<1bd4fc7d44bfd98f9ac2a49123deb733>>
88
* generated by gentest/src/GentestDriver.ts from gentest/fixtures/YGPercentageTest.html
99
*/
1010

@@ -496,6 +496,7 @@ public void test_percentage_flex_basis_cross_max_width() {
496496
}
497497

498498
@Test
499+
@Ignore
499500
public void test_percentage_flex_basis_main_min_width() {
500501
YogaConfig config = YogaConfigFactory.create();
501502

@@ -1339,6 +1340,119 @@ public void test_percent_of_max_cross_unstretched() {
13391340
assertEquals(20f, root_child0.getLayoutHeight(), 0.0f);
13401341
}
13411342

1343+
@Test
1344+
public void test_percentage_nested_min_width() {
1345+
YogaConfig config = YogaConfigFactory.create();
1346+
1347+
final YogaNode root = createNode(config);
1348+
root.setPositionType(YogaPositionType.ABSOLUTE);
1349+
root.setFlexDirection(YogaFlexDirection.ROW);
1350+
root.setWidth(40f);
1351+
root.setHeight(20f);
1352+
1353+
final YogaNode root_child0 = createNode(config);
1354+
root_child0.setFlexDirection(YogaFlexDirection.ROW);
1355+
root_child0.setWidth(10f);
1356+
root.addChildAt(root_child0, 0);
1357+
1358+
final YogaNode root_child0_child0 = createNode(config);
1359+
root_child0_child0.setFlexDirection(YogaFlexDirection.ROW);
1360+
root_child0_child0.setMinWidthPercent(50f);
1361+
root_child0.addChildAt(root_child0_child0, 0);
1362+
root.setDirection(YogaDirection.LTR);
1363+
root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
1364+
1365+
assertEquals(0f, root.getLayoutX(), 0.0f);
1366+
assertEquals(0f, root.getLayoutY(), 0.0f);
1367+
assertEquals(40f, root.getLayoutWidth(), 0.0f);
1368+
assertEquals(20f, root.getLayoutHeight(), 0.0f);
1369+
1370+
assertEquals(0f, root_child0.getLayoutX(), 0.0f);
1371+
assertEquals(0f, root_child0.getLayoutY(), 0.0f);
1372+
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
1373+
assertEquals(20f, root_child0.getLayoutHeight(), 0.0f);
1374+
1375+
assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
1376+
assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
1377+
assertEquals(5f, root_child0_child0.getLayoutWidth(), 0.0f);
1378+
assertEquals(20f, root_child0_child0.getLayoutHeight(), 0.0f);
1379+
1380+
root.setDirection(YogaDirection.RTL);
1381+
root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
1382+
1383+
assertEquals(0f, root.getLayoutX(), 0.0f);
1384+
assertEquals(0f, root.getLayoutY(), 0.0f);
1385+
assertEquals(40f, root.getLayoutWidth(), 0.0f);
1386+
assertEquals(20f, root.getLayoutHeight(), 0.0f);
1387+
1388+
assertEquals(30f, root_child0.getLayoutX(), 0.0f);
1389+
assertEquals(0f, root_child0.getLayoutY(), 0.0f);
1390+
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
1391+
assertEquals(20f, root_child0.getLayoutHeight(), 0.0f);
1392+
1393+
assertEquals(5f, root_child0_child0.getLayoutX(), 0.0f);
1394+
assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
1395+
assertEquals(5f, root_child0_child0.getLayoutWidth(), 0.0f);
1396+
assertEquals(20f, root_child0_child0.getLayoutHeight(), 0.0f);
1397+
}
1398+
1399+
@Test
1400+
public void test_percentage_nested_max_width() {
1401+
YogaConfig config = YogaConfigFactory.create();
1402+
1403+
final YogaNode root = createNode(config);
1404+
root.setPositionType(YogaPositionType.ABSOLUTE);
1405+
root.setFlexDirection(YogaFlexDirection.ROW);
1406+
root.setWidth(40f);
1407+
root.setHeight(20f);
1408+
1409+
final YogaNode root_child0 = createNode(config);
1410+
root_child0.setFlexDirection(YogaFlexDirection.ROW);
1411+
root_child0.setWidth(10f);
1412+
root.addChildAt(root_child0, 0);
1413+
1414+
final YogaNode root_child0_child0 = createNode(config);
1415+
root_child0_child0.setFlexDirection(YogaFlexDirection.ROW);
1416+
root_child0_child0.setWidth(20f);
1417+
root_child0_child0.setMaxWidthPercent(50f);
1418+
root_child0.addChildAt(root_child0_child0, 0);
1419+
root.setDirection(YogaDirection.LTR);
1420+
root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
1421+
1422+
assertEquals(0f, root.getLayoutX(), 0.0f);
1423+
assertEquals(0f, root.getLayoutY(), 0.0f);
1424+
assertEquals(40f, root.getLayoutWidth(), 0.0f);
1425+
assertEquals(20f, root.getLayoutHeight(), 0.0f);
1426+
1427+
assertEquals(0f, root_child0.getLayoutX(), 0.0f);
1428+
assertEquals(0f, root_child0.getLayoutY(), 0.0f);
1429+
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
1430+
assertEquals(20f, root_child0.getLayoutHeight(), 0.0f);
1431+
1432+
assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
1433+
assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
1434+
assertEquals(5f, root_child0_child0.getLayoutWidth(), 0.0f);
1435+
assertEquals(20f, root_child0_child0.getLayoutHeight(), 0.0f);
1436+
1437+
root.setDirection(YogaDirection.RTL);
1438+
root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
1439+
1440+
assertEquals(0f, root.getLayoutX(), 0.0f);
1441+
assertEquals(0f, root.getLayoutY(), 0.0f);
1442+
assertEquals(40f, root.getLayoutWidth(), 0.0f);
1443+
assertEquals(20f, root.getLayoutHeight(), 0.0f);
1444+
1445+
assertEquals(30f, root_child0.getLayoutX(), 0.0f);
1446+
assertEquals(0f, root_child0.getLayoutY(), 0.0f);
1447+
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
1448+
assertEquals(20f, root_child0.getLayoutHeight(), 0.0f);
1449+
1450+
assertEquals(5f, root_child0_child0.getLayoutX(), 0.0f);
1451+
assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
1452+
assertEquals(5f, root_child0_child0.getLayoutWidth(), 0.0f);
1453+
assertEquals(20f, root_child0_child0.getLayoutHeight(), 0.0f);
1454+
}
1455+
13421456
private YogaNode createNode(YogaConfig config) {
13431457
return mNodeFactory.create(config);
13441458
}

‎javascript/tests/generated/YGPercentageTest.test.ts‎

Lines changed: 107 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<fa608d845c0f657f8a663102234bab2b>>
7+
* @generated SignedSource<<ad520956286161acd1e899925b7f96a9>>
88
* generated by gentest/src/GentestDriver.ts from gentest/fixtures/YGPercentageTest.html
99
*/
1010

@@ -460,7 +460,7 @@ test('percentage_flex_basis_cross_max_width', () => {
460460
expect(root_child1.getComputedWidth()).toBe(40);
461461
expect(root_child1.getComputedHeight()).toBe(150);
462462
});
463-
test('percentage_flex_basis_main_min_width', () => {
463+
test.skip('percentage_flex_basis_main_min_width', () => {
464464
const config = Yoga.Config.create();
465465

466466
const root = Yoga.Node.create(config);
@@ -1244,3 +1244,108 @@ test('percent_of_max_cross_unstretched', () => {
12441244
expect(root_child0.getComputedWidth()).toBe(0);
12451245
expect(root_child0.getComputedHeight()).toBe(20);
12461246
});
1247+
test('percentage_nested_min_width', () => {
1248+
const config = Yoga.Config.create();
1249+
1250+
const root = Yoga.Node.create(config);
1251+
root.setPositionType(PositionType.Absolute);
1252+
root.setFlexDirection(FlexDirection.Row);
1253+
root.setWidth(40);
1254+
root.setHeight(20);
1255+
1256+
const root_child0 = Yoga.Node.create(config);
1257+
root_child0.setFlexDirection(FlexDirection.Row);
1258+
root_child0.setWidth(10);
1259+
root.insertChild(root_child0, 0);
1260+
1261+
const root_child0_child0 = Yoga.Node.create(config);
1262+
root_child0_child0.setFlexDirection(FlexDirection.Row);
1263+
root_child0_child0.setMinWidth("50%");
1264+
root_child0.insertChild(root_child0_child0, 0);
1265+
root.calculateLayout(undefined, undefined, Direction.LTR);
1266+
1267+
expect(root.getComputedLeft()).toBe(0);
1268+
expect(root.getComputedTop()).toBe(0);
1269+
expect(root.getComputedWidth()).toBe(40);
1270+
expect(root.getComputedHeight()).toBe(20);
1271+
1272+
expect(root_child0.getComputedLeft()).toBe(0);
1273+
expect(root_child0.getComputedTop()).toBe(0);
1274+
expect(root_child0.getComputedWidth()).toBe(10);
1275+
expect(root_child0.getComputedHeight()).toBe(20);
1276+
1277+
expect(root_child0_child0.getComputedLeft()).toBe(0);
1278+
expect(root_child0_child0.getComputedTop()).toBe(0);
1279+
expect(root_child0_child0.getComputedWidth()).toBe(5);
1280+
expect(root_child0_child0.getComputedHeight()).toBe(20);
1281+
1282+
root.calculateLayout(undefined, undefined, Direction.RTL);
1283+
1284+
expect(root.getComputedLeft()).toBe(0);
1285+
expect(root.getComputedTop()).toBe(0);
1286+
expect(root.getComputedWidth()).toBe(40);
1287+
expect(root.getComputedHeight()).toBe(20);
1288+
1289+
expect(root_child0.getComputedLeft()).toBe(30);
1290+
expect(root_child0.getComputedTop()).toBe(0);
1291+
expect(root_child0.getComputedWidth()).toBe(10);
1292+
expect(root_child0.getComputedHeight()).toBe(20);
1293+
1294+
expect(root_child0_child0.getComputedLeft()).toBe(5);
1295+
expect(root_child0_child0.getComputedTop()).toBe(0);
1296+
expect(root_child0_child0.getComputedWidth()).toBe(5);
1297+
expect(root_child0_child0.getComputedHeight()).toBe(20);
1298+
});
1299+
test('percentage_nested_max_width', () => {
1300+
const config = Yoga.Config.create();
1301+
1302+
const root = Yoga.Node.create(config);
1303+
root.setPositionType(PositionType.Absolute);
1304+
root.setFlexDirection(FlexDirection.Row);
1305+
root.setWidth(40);
1306+
root.setHeight(20);
1307+
1308+
const root_child0 = Yoga.Node.create(config);
1309+
root_child0.setFlexDirection(FlexDirection.Row);
1310+
root_child0.setWidth(10);
1311+
root.insertChild(root_child0, 0);
1312+
1313+
const root_child0_child0 = Yoga.Node.create(config);
1314+
root_child0_child0.setFlexDirection(FlexDirection.Row);
1315+
root_child0_child0.setWidth(20);
1316+
root_child0_child0.setMaxWidth("50%");
1317+
root_child0.insertChild(root_child0_child0, 0);
1318+
root.calculateLayout(undefined, undefined, Direction.LTR);
1319+
1320+
expect(root.getComputedLeft()).toBe(0);
1321+
expect(root.getComputedTop()).toBe(0);
1322+
expect(root.getComputedWidth()).toBe(40);
1323+
expect(root.getComputedHeight()).toBe(20);
1324+
1325+
expect(root_child0.getComputedLeft()).toBe(0);
1326+
expect(root_child0.getComputedTop()).toBe(0);
1327+
expect(root_child0.getComputedWidth()).toBe(10);
1328+
expect(root_child0.getComputedHeight()).toBe(20);
1329+
1330+
expect(root_child0_child0.getComputedLeft()).toBe(0);
1331+
expect(root_child0_child0.getComputedTop()).toBe(0);
1332+
expect(root_child0_child0.getComputedWidth()).toBe(5);
1333+
expect(root_child0_child0.getComputedHeight()).toBe(20);
1334+
1335+
root.calculateLayout(undefined, undefined, Direction.RTL);
1336+
1337+
expect(root.getComputedLeft()).toBe(0);
1338+
expect(root.getComputedTop()).toBe(0);
1339+
expect(root.getComputedWidth()).toBe(40);
1340+
expect(root.getComputedHeight()).toBe(20);
1341+
1342+
expect(root_child0.getComputedLeft()).toBe(30);
1343+
expect(root_child0.getComputedTop()).toBe(0);
1344+
expect(root_child0.getComputedWidth()).toBe(10);
1345+
expect(root_child0.getComputedHeight()).toBe(20);
1346+
1347+
expect(root_child0_child0.getComputedLeft()).toBe(5);
1348+
expect(root_child0_child0.getComputedTop()).toBe(0);
1349+
expect(root_child0_child0.getComputedWidth()).toBe(5);
1350+
expect(root_child0_child0.getComputedHeight()).toBe(20);
1351+
});

0 commit comments

Comments
 (0)