61 lines
1.5 KiB
TypeScript
61 lines
1.5 KiB
TypeScript
![]() |
/**
|
||
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
|
*
|
||
|
* This source code is licensed under the MIT license found in the
|
||
|
* LICENSE file in the root directory of this source tree.
|
||
|
*/
|
||
|
|
||
|
// @generated by gentest/gentest.rb from gentest/fixtures/YGStaticPositionTest.html
|
||
|
|
||
|
import {Yoga} from "../tools/globals";
|
||
|
import {
|
||
|
Align,
|
||
|
Direction,
|
||
|
Display,
|
||
|
Edge,
|
||
|
Errata,
|
||
|
ExperimentalFeature,
|
||
|
FlexDirection,
|
||
|
Gutter,
|
||
|
Justify,
|
||
|
MeasureMode,
|
||
|
Overflow,
|
||
|
PositionType,
|
||
|
Unit,
|
||
|
Wrap,
|
||
|
} from 'yoga-layout';
|
||
|
|
||
|
test.skip('static_position_insets_have_no_effect', () => {
|
||
|
const config = Yoga.Config.create();
|
||
|
let root;
|
||
|
|
||
|
config.setExperimentalFeatureEnabled(ExperimentalFeature.AbsolutePercentageAgainstPaddingEdge, true);
|
||
|
|
||
|
try {
|
||
|
root = Yoga.Node.create(config);
|
||
|
root.setPosition(Edge.Left, 50);
|
||
|
root.setPosition(Edge.Top, 50);
|
||
|
root.setWidth(100);
|
||
|
root.setHeight(100);
|
||
|
root.calculateLayout(undefined, undefined, Direction.LTR);
|
||
|
|
||
|
expect(root.getComputedLeft()).toBe(0);
|
||
|
expect(root.getComputedTop()).toBe(0);
|
||
|
expect(root.getComputedWidth()).toBe(100);
|
||
|
expect(root.getComputedHeight()).toBe(100);
|
||
|
|
||
|
root.calculateLayout(undefined, undefined, Direction.RTL);
|
||
|
|
||
|
expect(root.getComputedLeft()).toBe(0);
|
||
|
expect(root.getComputedTop()).toBe(0);
|
||
|
expect(root.getComputedWidth()).toBe(100);
|
||
|
expect(root.getComputedHeight()).toBe(100);
|
||
|
} finally {
|
||
|
if (typeof root !== 'undefined') {
|
||
|
root.freeRecursive();
|
||
|
}
|
||
|
|
||
|
config.free();
|
||
|
}
|
||
|
});
|