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