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