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:
committed by
Facebook GitHub Bot
parent
e409bfb43a
commit
e769dd97d8
@@ -7,7 +7,7 @@
|
||||
|
||||
// @generated by gentest/gentest.rb from gentest/fixtures/YGFlexTest.html
|
||||
|
||||
test("flex_basis_flex_grow_column", () => {
|
||||
test('flex_basis_flex_grow_column', () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
@@ -27,7 +27,7 @@ test("flex_basis_flex_grow_column", () => {
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setFlexGrow(1);
|
||||
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);
|
||||
@@ -44,7 +44,7 @@ test("flex_basis_flex_grow_column", () => {
|
||||
expect(root_child1.getComputedWidth()).toBe(100);
|
||||
expect(root_child1.getComputedHeight()).toBe(25);
|
||||
|
||||
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);
|
||||
@@ -61,14 +61,14 @@ test("flex_basis_flex_grow_column", () => {
|
||||
expect(root_child1.getComputedWidth()).toBe(100);
|
||||
expect(root_child1.getComputedHeight()).toBe(25);
|
||||
} finally {
|
||||
if (typeof root !== "undefined") {
|
||||
if (typeof root !== 'undefined') {
|
||||
root.freeRecursive();
|
||||
}
|
||||
|
||||
config.free();
|
||||
}
|
||||
});
|
||||
test("flex_shrink_flex_grow_row", () => {
|
||||
test('flex_shrink_flex_grow_row', () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
@@ -92,7 +92,7 @@ test("flex_shrink_flex_grow_row", () => {
|
||||
root_child1.setWidth(500);
|
||||
root_child1.setHeight(100);
|
||||
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);
|
||||
@@ -109,7 +109,7 @@ test("flex_shrink_flex_grow_row", () => {
|
||||
expect(root_child1.getComputedWidth()).toBe(250);
|
||||
expect(root_child1.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);
|
||||
@@ -126,14 +126,14 @@ test("flex_shrink_flex_grow_row", () => {
|
||||
expect(root_child1.getComputedWidth()).toBe(250);
|
||||
expect(root_child1.getComputedHeight()).toBe(100);
|
||||
} finally {
|
||||
if (typeof root !== "undefined") {
|
||||
if (typeof root !== 'undefined') {
|
||||
root.freeRecursive();
|
||||
}
|
||||
|
||||
config.free();
|
||||
}
|
||||
});
|
||||
test("flex_shrink_flex_grow_child_flex_shrink_other_child", () => {
|
||||
test('flex_shrink_flex_grow_child_flex_shrink_other_child', () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
@@ -158,7 +158,7 @@ test("flex_shrink_flex_grow_child_flex_shrink_other_child", () => {
|
||||
root_child1.setWidth(500);
|
||||
root_child1.setHeight(100);
|
||||
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);
|
||||
@@ -175,7 +175,7 @@ test("flex_shrink_flex_grow_child_flex_shrink_other_child", () => {
|
||||
expect(root_child1.getComputedWidth()).toBe(250);
|
||||
expect(root_child1.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);
|
||||
@@ -192,14 +192,14 @@ test("flex_shrink_flex_grow_child_flex_shrink_other_child", () => {
|
||||
expect(root_child1.getComputedWidth()).toBe(250);
|
||||
expect(root_child1.getComputedHeight()).toBe(100);
|
||||
} finally {
|
||||
if (typeof root !== "undefined") {
|
||||
if (typeof root !== 'undefined') {
|
||||
root.freeRecursive();
|
||||
}
|
||||
|
||||
config.free();
|
||||
}
|
||||
});
|
||||
test("flex_basis_flex_grow_row", () => {
|
||||
test('flex_basis_flex_grow_row', () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
@@ -220,7 +220,7 @@ test("flex_basis_flex_grow_row", () => {
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setFlexGrow(1);
|
||||
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);
|
||||
@@ -237,7 +237,7 @@ test("flex_basis_flex_grow_row", () => {
|
||||
expect(root_child1.getComputedWidth()).toBe(25);
|
||||
expect(root_child1.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);
|
||||
@@ -254,14 +254,14 @@ test("flex_basis_flex_grow_row", () => {
|
||||
expect(root_child1.getComputedWidth()).toBe(25);
|
||||
expect(root_child1.getComputedHeight()).toBe(100);
|
||||
} finally {
|
||||
if (typeof root !== "undefined") {
|
||||
if (typeof root !== 'undefined') {
|
||||
root.freeRecursive();
|
||||
}
|
||||
|
||||
config.free();
|
||||
}
|
||||
});
|
||||
test("flex_basis_flex_shrink_column", () => {
|
||||
test('flex_basis_flex_shrink_column', () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
@@ -281,7 +281,7 @@ test("flex_basis_flex_shrink_column", () => {
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setFlexBasis(50);
|
||||
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);
|
||||
@@ -298,7 +298,7 @@ test("flex_basis_flex_shrink_column", () => {
|
||||
expect(root_child1.getComputedWidth()).toBe(100);
|
||||
expect(root_child1.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);
|
||||
@@ -315,14 +315,14 @@ test("flex_basis_flex_shrink_column", () => {
|
||||
expect(root_child1.getComputedWidth()).toBe(100);
|
||||
expect(root_child1.getComputedHeight()).toBe(50);
|
||||
} finally {
|
||||
if (typeof root !== "undefined") {
|
||||
if (typeof root !== 'undefined') {
|
||||
root.freeRecursive();
|
||||
}
|
||||
|
||||
config.free();
|
||||
}
|
||||
});
|
||||
test("flex_basis_flex_shrink_row", () => {
|
||||
test('flex_basis_flex_shrink_row', () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
@@ -343,7 +343,7 @@ test("flex_basis_flex_shrink_row", () => {
|
||||
const root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setFlexBasis(50);
|
||||
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);
|
||||
@@ -360,7 +360,7 @@ test("flex_basis_flex_shrink_row", () => {
|
||||
expect(root_child1.getComputedWidth()).toBe(50);
|
||||
expect(root_child1.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);
|
||||
@@ -377,14 +377,14 @@ test("flex_basis_flex_shrink_row", () => {
|
||||
expect(root_child1.getComputedWidth()).toBe(50);
|
||||
expect(root_child1.getComputedHeight()).toBe(100);
|
||||
} finally {
|
||||
if (typeof root !== "undefined") {
|
||||
if (typeof root !== 'undefined') {
|
||||
root.freeRecursive();
|
||||
}
|
||||
|
||||
config.free();
|
||||
}
|
||||
});
|
||||
test("flex_shrink_to_zero", () => {
|
||||
test('flex_shrink_to_zero', () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
@@ -410,7 +410,7 @@ test("flex_shrink_to_zero", () => {
|
||||
root_child2.setWidth(50);
|
||||
root_child2.setHeight(50);
|
||||
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);
|
||||
@@ -432,7 +432,7 @@ test("flex_shrink_to_zero", () => {
|
||||
expect(root_child2.getComputedWidth()).toBe(50);
|
||||
expect(root_child2.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);
|
||||
@@ -454,14 +454,14 @@ test("flex_shrink_to_zero", () => {
|
||||
expect(root_child2.getComputedWidth()).toBe(50);
|
||||
expect(root_child2.getComputedHeight()).toBe(50);
|
||||
} finally {
|
||||
if (typeof root !== "undefined") {
|
||||
if (typeof root !== 'undefined') {
|
||||
root.freeRecursive();
|
||||
}
|
||||
|
||||
config.free();
|
||||
}
|
||||
});
|
||||
test("flex_basis_overrides_main_size", () => {
|
||||
test('flex_basis_overrides_main_size', () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
@@ -488,7 +488,7 @@ test("flex_basis_overrides_main_size", () => {
|
||||
root_child2.setFlexGrow(1);
|
||||
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);
|
||||
@@ -510,7 +510,7 @@ test("flex_basis_overrides_main_size", () => {
|
||||
expect(root_child2.getComputedWidth()).toBe(100);
|
||||
expect(root_child2.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);
|
||||
@@ -532,14 +532,14 @@ test("flex_basis_overrides_main_size", () => {
|
||||
expect(root_child2.getComputedWidth()).toBe(100);
|
||||
expect(root_child2.getComputedHeight()).toBe(20);
|
||||
} finally {
|
||||
if (typeof root !== "undefined") {
|
||||
if (typeof root !== 'undefined') {
|
||||
root.freeRecursive();
|
||||
}
|
||||
|
||||
config.free();
|
||||
}
|
||||
});
|
||||
test("flex_grow_shrink_at_most", () => {
|
||||
test('flex_grow_shrink_at_most', () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
@@ -558,7 +558,7 @@ test("flex_grow_shrink_at_most", () => {
|
||||
root_child0_child0.setFlexGrow(1);
|
||||
root_child0_child0.setFlexShrink(1);
|
||||
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);
|
||||
@@ -575,7 +575,7 @@ test("flex_grow_shrink_at_most", () => {
|
||||
expect(root_child0_child0.getComputedWidth()).toBe(100);
|
||||
expect(root_child0_child0.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);
|
||||
@@ -592,14 +592,14 @@ test("flex_grow_shrink_at_most", () => {
|
||||
expect(root_child0_child0.getComputedWidth()).toBe(100);
|
||||
expect(root_child0_child0.getComputedHeight()).toBe(0);
|
||||
} finally {
|
||||
if (typeof root !== "undefined") {
|
||||
if (typeof root !== 'undefined') {
|
||||
root.freeRecursive();
|
||||
}
|
||||
|
||||
config.free();
|
||||
}
|
||||
});
|
||||
test("flex_grow_less_than_factor_one", () => {
|
||||
test('flex_grow_less_than_factor_one', () => {
|
||||
const config = Yoga.Config.create();
|
||||
let root;
|
||||
|
||||
@@ -623,7 +623,7 @@ test("flex_grow_less_than_factor_one", () => {
|
||||
const root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setFlexGrow(0.4);
|
||||
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);
|
||||
@@ -645,7 +645,7 @@ test("flex_grow_less_than_factor_one", () => {
|
||||
expect(root_child2.getComputedWidth()).toBe(200);
|
||||
expect(root_child2.getComputedHeight()).toBe(184);
|
||||
|
||||
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);
|
||||
@@ -667,7 +667,7 @@ test("flex_grow_less_than_factor_one", () => {
|
||||
expect(root_child2.getComputedWidth()).toBe(200);
|
||||
expect(root_child2.getComputedHeight()).toBe(184);
|
||||
} finally {
|
||||
if (typeof root !== "undefined") {
|
||||
if (typeof root !== 'undefined') {
|
||||
root.freeRecursive();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user