Skip to content

Commit

Permalink
Revamp tests for row reverse + border after fix
Browse files Browse the repository at this point in the history
Differential Revision: D50348206

fbshipit-source-id: 0cd02d0261d8ecfce3fd0bf6f654cd17052bf99c
  • Loading branch information
Joe Vilches authored and facebook-github-bot committed Oct 17, 2023
1 parent ca0ffb2 commit 34c7924
Show file tree
Hide file tree
Showing 8 changed files with 230 additions and 94 deletions.
4 changes: 2 additions & 2 deletions gentest/fixtures/YGFlexDirectionTest.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
<div style="width: 10px;"></div>
</div>

<div id="flex_direction_row_reverse_border_start" data-disabled="true" style="height: 100px; width: 100px; flex-direction: row-reverse; border-start-width: 100px;">
<div id="flex_direction_row_reverse_border_start" style="height: 100px; width: 100px; flex-direction: row-reverse; border-start-width: 100px;">
<div style="width: 10px;"></div>
<div style="width: 10px;"></div>
<div style="width: 10px;"></div>
Expand All @@ -125,7 +125,7 @@
<div style="width: 10px;"></div>
</div>

<div id="flex_direction_row_reverse_border_end" data-disabled="true" style="height: 100px; width: 100px; flex-direction: row-reverse; border-end-width: 100px;">
<div id="flex_direction_row_reverse_border_end" style="height: 100px; width: 100px; flex-direction: row-reverse; border-end-width: 100px;">
<div style="width: 10px;"></div>
<div style="width: 10px;"></div>
<div style="width: 10px;"></div>
Expand Down
56 changes: 28 additions & 28 deletions java/tests/com/facebook/yoga/YGAspectRatioTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,28 +95,28 @@ public void test_aspect_ratio_does_not_stretch_cross_axis_dim() {

assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
assertEquals(300f, root_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0.getLayoutHeight(), 0.0f);
assertEquals(285f, root_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(187f, root_child0_child0.getLayoutHeight(), 0.0f);

assertEquals(0f, root_child0_child0_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child0.getLayoutY(), 0.0f);
assertEquals(197f, root_child0_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child0.getLayoutHeight(), 0.0f);
assertEquals(187f, root_child0_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(187f, root_child0_child0_child0.getLayoutHeight(), 0.0f);

assertEquals(197f, root_child0_child0_child1.getLayoutX(), 0.0f);
assertEquals(187f, root_child0_child0_child1.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child1.getLayoutY(), 0.0f);
assertEquals(5f, root_child0_child0_child1.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child1.getLayoutHeight(), 0.0f);
assertEquals(187f, root_child0_child0_child1.getLayoutHeight(), 0.0f);

assertEquals(202f, root_child0_child0_child2.getLayoutX(), 0.0f);
assertEquals(192f, root_child0_child0_child2.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2.getLayoutY(), 0.0f);
assertEquals(98f, root_child0_child0_child2.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child2.getLayoutHeight(), 0.0f);
assertEquals(93f, root_child0_child0_child2.getLayoutWidth(), 0.0f);
assertEquals(187f, root_child0_child0_child2.getLayoutHeight(), 0.0f);

assertEquals(0f, root_child0_child0_child2_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0.getLayoutY(), 0.0f);
assertEquals(98f, root_child0_child0_child2_child0.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child2_child0.getLayoutHeight(), 0.0f);
assertEquals(93f, root_child0_child0_child2_child0.getLayoutWidth(), 0.0f);
assertEquals(187f, root_child0_child0_child2_child0.getLayoutHeight(), 0.0f);

assertEquals(0f, root_child0_child0_child2_child0_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0_child0.getLayoutY(), 0.0f);
Expand All @@ -125,8 +125,8 @@ public void test_aspect_ratio_does_not_stretch_cross_axis_dim() {

assertEquals(0f, root_child0_child0_child2_child0_child1.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0_child1.getLayoutY(), 0.0f);
assertEquals(98f, root_child0_child0_child2_child0_child1.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child2_child0_child1.getLayoutHeight(), 0.0f);
assertEquals(93f, root_child0_child0_child2_child0_child1.getLayoutWidth(), 0.0f);
assertEquals(187f, root_child0_child0_child2_child0_child1.getLayoutHeight(), 0.0f);

root.setDirection(YogaDirection.RTL);
root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
Expand All @@ -141,40 +141,40 @@ public void test_aspect_ratio_does_not_stretch_cross_axis_dim() {
assertEquals(300f, root_child0.getLayoutWidth(), 0.0f);
assertEquals(300f, root_child0.getLayoutHeight(), 0.0f);

assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
assertEquals(30f, root_child0_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
assertEquals(300f, root_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0.getLayoutHeight(), 0.0f);
assertEquals(285f, root_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(187f, root_child0_child0.getLayoutHeight(), 0.0f);

assertEquals(103f, root_child0_child0_child0.getLayoutX(), 0.0f);
assertEquals(98f, root_child0_child0_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child0.getLayoutY(), 0.0f);
assertEquals(197f, root_child0_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child0.getLayoutHeight(), 0.0f);
assertEquals(187f, root_child0_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(187f, root_child0_child0_child0.getLayoutHeight(), 0.0f);

assertEquals(98f, root_child0_child0_child1.getLayoutX(), 0.0f);
assertEquals(93f, root_child0_child0_child1.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child1.getLayoutY(), 0.0f);
assertEquals(5f, root_child0_child0_child1.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child1.getLayoutHeight(), 0.0f);
assertEquals(187f, root_child0_child0_child1.getLayoutHeight(), 0.0f);

assertEquals(0f, root_child0_child0_child2.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2.getLayoutY(), 0.0f);
assertEquals(98f, root_child0_child0_child2.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child2.getLayoutHeight(), 0.0f);
assertEquals(93f, root_child0_child0_child2.getLayoutWidth(), 0.0f);
assertEquals(187f, root_child0_child0_child2.getLayoutHeight(), 0.0f);

assertEquals(0f, root_child0_child0_child2_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0.getLayoutY(), 0.0f);
assertEquals(98f, root_child0_child0_child2_child0.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child2_child0.getLayoutHeight(), 0.0f);
assertEquals(93f, root_child0_child0_child2_child0.getLayoutWidth(), 0.0f);
assertEquals(187f, root_child0_child0_child2_child0.getLayoutHeight(), 0.0f);

assertEquals(93f, root_child0_child0_child2_child0_child0.getLayoutX(), 0.0f);
assertEquals(88f, root_child0_child0_child2_child0_child0.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0_child0.getLayoutY(), 0.0f);
assertEquals(5f, root_child0_child0_child2_child0_child0.getLayoutWidth(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0_child0.getLayoutHeight(), 0.0f);

assertEquals(0f, root_child0_child0_child2_child0_child1.getLayoutX(), 0.0f);
assertEquals(0f, root_child0_child0_child2_child0_child1.getLayoutY(), 0.0f);
assertEquals(98f, root_child0_child0_child2_child0_child1.getLayoutWidth(), 0.0f);
assertEquals(197f, root_child0_child0_child2_child0_child1.getLayoutHeight(), 0.0f);
assertEquals(93f, root_child0_child0_child2_child0_child1.getLayoutWidth(), 0.0f);
assertEquals(187f, root_child0_child0_child2_child0_child1.getLayoutHeight(), 0.0f);
}

private YogaNode createNode(YogaConfig config) {
Expand Down
2 changes: 0 additions & 2 deletions java/tests/com/facebook/yoga/YGFlexDirectionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,6 @@ public void test_flex_direction_row_reverse_border_left() {
}

@Test
@Ignore
public void test_flex_direction_row_reverse_border_start() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
Expand Down Expand Up @@ -1468,7 +1467,6 @@ public void test_flex_direction_row_reverse_border_right() {
}

@Test
@Ignore
public void test_flex_direction_row_reverse_border_end() {
YogaConfig config = YogaConfigFactory.create();
config.setExperimentalFeatureEnabled(YogaExperimentalFeature.ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE, true);
Expand Down
56 changes: 28 additions & 28 deletions javascript/tests/generated/YGAspectRatioTest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,28 +95,28 @@ test.skip('aspect_ratio_does_not_stretch_cross_axis_dim', () => {

expect(root_child0_child0.getComputedLeft()).toBe(0);
expect(root_child0_child0.getComputedTop()).toBe(0);
expect(root_child0_child0.getComputedWidth()).toBe(300);
expect(root_child0_child0.getComputedHeight()).toBe(197);
expect(root_child0_child0.getComputedWidth()).toBe(285);
expect(root_child0_child0.getComputedHeight()).toBe(187);

expect(root_child0_child0_child0.getComputedLeft()).toBe(0);
expect(root_child0_child0_child0.getComputedTop()).toBe(0);
expect(root_child0_child0_child0.getComputedWidth()).toBe(197);
expect(root_child0_child0_child0.getComputedHeight()).toBe(197);
expect(root_child0_child0_child0.getComputedWidth()).toBe(187);
expect(root_child0_child0_child0.getComputedHeight()).toBe(187);

expect(root_child0_child0_child1.getComputedLeft()).toBe(197);
expect(root_child0_child0_child1.getComputedLeft()).toBe(187);
expect(root_child0_child0_child1.getComputedTop()).toBe(0);
expect(root_child0_child0_child1.getComputedWidth()).toBe(5);
expect(root_child0_child0_child1.getComputedHeight()).toBe(197);
expect(root_child0_child0_child1.getComputedHeight()).toBe(187);

expect(root_child0_child0_child2.getComputedLeft()).toBe(202);
expect(root_child0_child0_child2.getComputedLeft()).toBe(192);
expect(root_child0_child0_child2.getComputedTop()).toBe(0);
expect(root_child0_child0_child2.getComputedWidth()).toBe(98);
expect(root_child0_child0_child2.getComputedHeight()).toBe(197);
expect(root_child0_child0_child2.getComputedWidth()).toBe(93);
expect(root_child0_child0_child2.getComputedHeight()).toBe(187);

expect(root_child0_child0_child2_child0.getComputedLeft()).toBe(0);
expect(root_child0_child0_child2_child0.getComputedTop()).toBe(0);
expect(root_child0_child0_child2_child0.getComputedWidth()).toBe(98);
expect(root_child0_child0_child2_child0.getComputedHeight()).toBe(197);
expect(root_child0_child0_child2_child0.getComputedWidth()).toBe(93);
expect(root_child0_child0_child2_child0.getComputedHeight()).toBe(187);

expect(root_child0_child0_child2_child0_child0.getComputedLeft()).toBe(0);
expect(root_child0_child0_child2_child0_child0.getComputedTop()).toBe(0);
Expand All @@ -125,8 +125,8 @@ test.skip('aspect_ratio_does_not_stretch_cross_axis_dim', () => {

expect(root_child0_child0_child2_child0_child1.getComputedLeft()).toBe(0);
expect(root_child0_child0_child2_child0_child1.getComputedTop()).toBe(0);
expect(root_child0_child0_child2_child0_child1.getComputedWidth()).toBe(98);
expect(root_child0_child0_child2_child0_child1.getComputedHeight()).toBe(197);
expect(root_child0_child0_child2_child0_child1.getComputedWidth()).toBe(93);
expect(root_child0_child0_child2_child0_child1.getComputedHeight()).toBe(187);

root.calculateLayout(undefined, undefined, Direction.RTL);

Expand All @@ -140,40 +140,40 @@ test.skip('aspect_ratio_does_not_stretch_cross_axis_dim', () => {
expect(root_child0.getComputedWidth()).toBe(300);
expect(root_child0.getComputedHeight()).toBe(300);

expect(root_child0_child0.getComputedLeft()).toBe(0);
expect(root_child0_child0.getComputedLeft()).toBe(30);
expect(root_child0_child0.getComputedTop()).toBe(0);
expect(root_child0_child0.getComputedWidth()).toBe(300);
expect(root_child0_child0.getComputedHeight()).toBe(197);
expect(root_child0_child0.getComputedWidth()).toBe(285);
expect(root_child0_child0.getComputedHeight()).toBe(187);

expect(root_child0_child0_child0.getComputedLeft()).toBe(103);
expect(root_child0_child0_child0.getComputedLeft()).toBe(98);
expect(root_child0_child0_child0.getComputedTop()).toBe(0);
expect(root_child0_child0_child0.getComputedWidth()).toBe(197);
expect(root_child0_child0_child0.getComputedHeight()).toBe(197);
expect(root_child0_child0_child0.getComputedWidth()).toBe(187);
expect(root_child0_child0_child0.getComputedHeight()).toBe(187);

expect(root_child0_child0_child1.getComputedLeft()).toBe(98);
expect(root_child0_child0_child1.getComputedLeft()).toBe(93);
expect(root_child0_child0_child1.getComputedTop()).toBe(0);
expect(root_child0_child0_child1.getComputedWidth()).toBe(5);
expect(root_child0_child0_child1.getComputedHeight()).toBe(197);
expect(root_child0_child0_child1.getComputedHeight()).toBe(187);

expect(root_child0_child0_child2.getComputedLeft()).toBe(0);
expect(root_child0_child0_child2.getComputedTop()).toBe(0);
expect(root_child0_child0_child2.getComputedWidth()).toBe(98);
expect(root_child0_child0_child2.getComputedHeight()).toBe(197);
expect(root_child0_child0_child2.getComputedWidth()).toBe(93);
expect(root_child0_child0_child2.getComputedHeight()).toBe(187);

expect(root_child0_child0_child2_child0.getComputedLeft()).toBe(0);
expect(root_child0_child0_child2_child0.getComputedTop()).toBe(0);
expect(root_child0_child0_child2_child0.getComputedWidth()).toBe(98);
expect(root_child0_child0_child2_child0.getComputedHeight()).toBe(197);
expect(root_child0_child0_child2_child0.getComputedWidth()).toBe(93);
expect(root_child0_child0_child2_child0.getComputedHeight()).toBe(187);

expect(root_child0_child0_child2_child0_child0.getComputedLeft()).toBe(93);
expect(root_child0_child0_child2_child0_child0.getComputedLeft()).toBe(88);
expect(root_child0_child0_child2_child0_child0.getComputedTop()).toBe(0);
expect(root_child0_child0_child2_child0_child0.getComputedWidth()).toBe(5);
expect(root_child0_child0_child2_child0_child0.getComputedHeight()).toBe(0);

expect(root_child0_child0_child2_child0_child1.getComputedLeft()).toBe(0);
expect(root_child0_child0_child2_child0_child1.getComputedTop()).toBe(0);
expect(root_child0_child0_child2_child0_child1.getComputedWidth()).toBe(98);
expect(root_child0_child0_child2_child0_child1.getComputedHeight()).toBe(197);
expect(root_child0_child0_child2_child0_child1.getComputedWidth()).toBe(93);
expect(root_child0_child0_child2_child0_child1.getComputedHeight()).toBe(187);
} finally {
if (typeof root !== 'undefined') {
root.freeRecursive();
Expand Down
4 changes: 2 additions & 2 deletions javascript/tests/generated/YGFlexDirectionTest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@ test('flex_direction_row_reverse_border_left', () => {
config.free();
}
});
test.skip('flex_direction_row_reverse_border_start', () => {
test('flex_direction_row_reverse_border_start', () => {
const config = Yoga.Config.create();
let root;

Expand Down Expand Up @@ -1590,7 +1590,7 @@ test('flex_direction_row_reverse_border_right', () => {
config.free();
}
});
test.skip('flex_direction_row_reverse_border_end', () => {
test('flex_direction_row_reverse_border_end', () => {
const config = Yoga.Config.create();
let root;

Expand Down
Loading

0 comments on commit 34c7924

Please sign in to comment.