Flex basis auto is mysteriously missed again (#1225)
Summary: - adds a test to check that `setFlexBasisAuto` is here Pull Request resolved: https://github.com/facebook/yoga/pull/1225 Reviewed By: javache Differential Revision: D43150473 Pulled By: NickGerleman fbshipit-source-id: b5b82fe4a5db069d3ed5672990c9b8ade9141296
This commit is contained in:
committed by
Facebook GitHub Bot
parent
996267dbcb
commit
ba38a2c784
@@ -89,6 +89,7 @@ EMSCRIPTEN_BINDINGS(YOGA_LAYOUT) {
|
|||||||
.function("setFlex", &Node::setFlex)
|
.function("setFlex", &Node::setFlex)
|
||||||
.function("setFlexBasis", &Node::setFlexBasis)
|
.function("setFlexBasis", &Node::setFlexBasis)
|
||||||
.function("setFlexBasisPercent", &Node::setFlexBasisPercent)
|
.function("setFlexBasisPercent", &Node::setFlexBasisPercent)
|
||||||
|
.function("setFlexBasisAuto", &Node::setFlexBasisAuto)
|
||||||
.function("setFlexGrow", &Node::setFlexGrow)
|
.function("setFlexGrow", &Node::setFlexGrow)
|
||||||
.function("setFlexShrink", &Node::setFlexShrink)
|
.function("setFlexShrink", &Node::setFlexShrink)
|
||||||
|
|
||||||
|
21
javascript/tests/YGFlexBasisAuto.test.js
Normal file
21
javascript/tests/YGFlexBasisAuto.test.js
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
test("flex_basis_auto", () => {
|
||||||
|
const root = Yoga.Node.create();
|
||||||
|
|
||||||
|
expect(root.getFlexBasis().unit).toBe(Yoga.UNIT_AUTO);
|
||||||
|
|
||||||
|
root.setFlexBasis(10);
|
||||||
|
expect(root.getFlexBasis().unit).toBe(Yoga.UNIT_POINT);
|
||||||
|
expect(root.getFlexBasis().value).toBe(10);
|
||||||
|
|
||||||
|
root.setFlexBasisAuto();
|
||||||
|
expect(root.getFlexBasis().unit).toBe(Yoga.UNIT_AUTO);
|
||||||
|
|
||||||
|
root.freeRecursive();
|
||||||
|
});
|
Reference in New Issue
Block a user