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:
Dmitry Ivakhnenko
2023-02-09 02:15:43 -08:00
committed by Facebook GitHub Bot
parent 996267dbcb
commit ba38a2c784
2 changed files with 22 additions and 0 deletions

View File

@@ -89,6 +89,7 @@ EMSCRIPTEN_BINDINGS(YOGA_LAYOUT) {
.function("setFlex", &Node::setFlex)
.function("setFlexBasis", &Node::setFlexBasis)
.function("setFlexBasisPercent", &Node::setFlexBasisPercent)
.function("setFlexBasisAuto", &Node::setFlexBasisAuto)
.function("setFlexGrow", &Node::setFlexGrow)
.function("setFlexShrink", &Node::setFlexShrink)

View 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();
});