Add data-disabled to test fixtures (#1286)

Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1286

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).

Reviewed By: yungsters

Differential Revision: D45723003

fbshipit-source-id: 337af319ab1c1c12047d6579da8c7e63b4f1537a
This commit is contained in:
Nick Gerleman
2023-05-10 22:46:39 -07:00
committed by Facebook GitHub Bot
parent e409bfb43a
commit e769dd97d8
52 changed files with 1846 additions and 1101 deletions

View File

@@ -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();
}