Fix issue in gentest where border-<edge> would add a border to test (#1496)

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

Gentest code has a problem where we try to apply a border in our test when the web browser is not actually adding one. This happens when we do something like `border-top: 10px`. This will actually set the style of the border to `initial` which is just `none`, so nothing renders. This is causing at least 1 test to pass when it actually fails.

I changed it so we ignore setting this value if the style is one of these values. I then re-ran the gentest code and excluded the now failing test (which gets fixed in my static stack).

Reviewed By: NickGerleman

Differential Revision: D51831754

fbshipit-source-id: a325e4a42b2d7cd6f19efc6cd5a2445574467fb7
This commit is contained in:
Joe Vilches
2023-12-05 13:30:03 -08:00
committed by Facebook GitHub Bot
parent 7b3b66d288
commit c93734f579
6 changed files with 81 additions and 52 deletions

View File

@@ -1255,7 +1255,7 @@ test('percent_absolute_position_infinite_height', () => {
config.free();
}
});
test('absolute_layout_percentage_height_based_on_padded_parent', () => {
test.skip('absolute_layout_percentage_height_based_on_padded_parent', () => {
const config = Yoga.Config.create();
let root;
@@ -1282,9 +1282,9 @@ test('absolute_layout_percentage_height_based_on_padded_parent', () => {
expect(root.getComputedHeight()).toBe(100);
expect(root_child0.getComputedLeft()).toBe(0);
expect(root_child0.getComputedTop()).toBe(10);
expect(root_child0.getComputedTop()).toBe(20);
expect(root_child0.getComputedWidth()).toBe(100);
expect(root_child0.getComputedHeight()).toBe(50);
expect(root_child0.getComputedHeight()).toBe(45);
root.calculateLayout(undefined, undefined, Direction.RTL);
@@ -1294,9 +1294,9 @@ test('absolute_layout_percentage_height_based_on_padded_parent', () => {
expect(root.getComputedHeight()).toBe(100);
expect(root_child0.getComputedLeft()).toBe(0);
expect(root_child0.getComputedTop()).toBe(10);
expect(root_child0.getComputedTop()).toBe(20);
expect(root_child0.getComputedWidth()).toBe(100);
expect(root_child0.getComputedHeight()).toBe(50);
expect(root_child0.getComputedHeight()).toBe(45);
} finally {
if (typeof root !== 'undefined') {
root.freeRecursive();