2017-01-26 13:36:38 -08:00
|
|
|
/**
|
2022-10-04 13:59:32 -07:00
|
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
2017-01-26 13:36:38 -08:00
|
|
|
*
|
2018-02-16 18:24:55 -08:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2017-01-26 13:36:38 -08:00
|
|
|
*/
|
|
|
|
|
2022-12-24 01:46:20 -08:00
|
|
|
test("border_start", function () {
|
2022-12-24 00:35:10 -08:00
|
|
|
const root = Yoga.Node.create();
|
2017-01-26 13:36:38 -08:00
|
|
|
root.setWidth(100);
|
|
|
|
root.setHeight(100);
|
|
|
|
root.setBorder(Yoga.EDGE_START, 10);
|
|
|
|
|
|
|
|
root.calculateLayout(100, 100, Yoga.DIRECTION_LTR);
|
|
|
|
|
2022-12-24 01:46:20 -08:00
|
|
|
expect(root.getComputedBorder(Yoga.EDGE_LEFT)).toBe(10);
|
|
|
|
expect(root.getComputedBorder(Yoga.EDGE_RIGHT)).toBe(0);
|
2017-01-26 13:36:38 -08:00
|
|
|
|
|
|
|
root.calculateLayout(100, 100, Yoga.DIRECTION_RTL);
|
|
|
|
|
2022-12-24 01:46:20 -08:00
|
|
|
expect(root.getComputedBorder(Yoga.EDGE_LEFT)).toBe(0);
|
|
|
|
expect(root.getComputedBorder(Yoga.EDGE_RIGHT)).toBe(10);
|
2017-01-26 13:36:38 -08:00
|
|
|
|
2022-12-24 01:46:20 -08:00
|
|
|
root.freeRecursive();
|
2017-01-26 13:36:38 -08:00
|
|
|
});
|