How to use child1 method in ng-mocks

Best JavaScript code snippet using ng-mocks

YGRoundingTest.js

Source:YGRoundingTest.js Github

copy

Full Screen

1/**2 * Copyright (c) Facebook, Inc. and its affiliates.3 *4 * This source code is licensed under the MIT license found in the LICENSE5 * file in the root directory of this source tree.6 */7// @Generated by gentest/gentest.rb from gentest/fixtures/YGRoundingTest.html8var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);9it("rounding_flex_basis_flex_grow_row_width_of_100", function () {10 var config = Yoga.Config.create();11 try {12 var root = Yoga.Node.create(config);13 root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);14 root.setWidth(100);15 root.setHeight(100);16 var root_child0 = Yoga.Node.create(config);17 root_child0.setFlexGrow(1);18 root.insertChild(root_child0, 0);19 var root_child1 = Yoga.Node.create(config);20 root_child1.setFlexGrow(1);21 root.insertChild(root_child1, 1);22 var root_child2 = Yoga.Node.create(config);23 root_child2.setFlexGrow(1);24 root.insertChild(root_child2, 2);25 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);26 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");27 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");28 console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");29 console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");30 console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");31 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");32 console.assert(33 === root_child0.getComputedWidth(), "33 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");33 console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");34 console.assert(33 === root_child1.getComputedLeft(), "33 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");35 console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");36 console.assert(34 === root_child1.getComputedWidth(), "34 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");37 console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");38 console.assert(67 === root_child2.getComputedLeft(), "67 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");39 console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");40 console.assert(33 === root_child2.getComputedWidth(), "33 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");41 console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");42 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);43 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");44 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");45 console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");46 console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");47 console.assert(67 === root_child0.getComputedLeft(), "67 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");48 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");49 console.assert(33 === root_child0.getComputedWidth(), "33 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");50 console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");51 console.assert(33 === root_child1.getComputedLeft(), "33 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");52 console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");53 console.assert(34 === root_child1.getComputedWidth(), "34 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");54 console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");55 console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");56 console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");57 console.assert(33 === root_child2.getComputedWidth(), "33 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");58 console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");59 } finally {60 if (typeof root !== "undefined") {61 root.freeRecursive();62 }63 config.free();64 }65});66it("rounding_flex_basis_flex_grow_row_prime_number_width", function () {67 var config = Yoga.Config.create();68 try {69 var root = Yoga.Node.create(config);70 root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);71 root.setWidth(113);72 root.setHeight(100);73 var root_child0 = Yoga.Node.create(config);74 root_child0.setFlexGrow(1);75 root.insertChild(root_child0, 0);76 var root_child1 = Yoga.Node.create(config);77 root_child1.setFlexGrow(1);78 root.insertChild(root_child1, 1);79 var root_child2 = Yoga.Node.create(config);80 root_child2.setFlexGrow(1);81 root.insertChild(root_child2, 2);82 var root_child3 = Yoga.Node.create(config);83 root_child3.setFlexGrow(1);84 root.insertChild(root_child3, 3);85 var root_child4 = Yoga.Node.create(config);86 root_child4.setFlexGrow(1);87 root.insertChild(root_child4, 4);88 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);89 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");90 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");91 console.assert(113 === root.getComputedWidth(), "113 === root.getComputedWidth() (" + root.getComputedWidth() + ")");92 console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");93 console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");94 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");95 console.assert(23 === root_child0.getComputedWidth(), "23 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");96 console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");97 console.assert(23 === root_child1.getComputedLeft(), "23 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");98 console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");99 console.assert(22 === root_child1.getComputedWidth(), "22 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");100 console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");101 console.assert(45 === root_child2.getComputedLeft(), "45 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");102 console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");103 console.assert(23 === root_child2.getComputedWidth(), "23 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");104 console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");105 console.assert(68 === root_child3.getComputedLeft(), "68 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");106 console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");107 console.assert(22 === root_child3.getComputedWidth(), "22 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");108 console.assert(100 === root_child3.getComputedHeight(), "100 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");109 console.assert(90 === root_child4.getComputedLeft(), "90 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");110 console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");111 console.assert(23 === root_child4.getComputedWidth(), "23 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");112 console.assert(100 === root_child4.getComputedHeight(), "100 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");113 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);114 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");115 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");116 console.assert(113 === root.getComputedWidth(), "113 === root.getComputedWidth() (" + root.getComputedWidth() + ")");117 console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");118 console.assert(90 === root_child0.getComputedLeft(), "90 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");119 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");120 console.assert(23 === root_child0.getComputedWidth(), "23 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");121 console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");122 console.assert(68 === root_child1.getComputedLeft(), "68 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");123 console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");124 console.assert(22 === root_child1.getComputedWidth(), "22 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");125 console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");126 console.assert(45 === root_child2.getComputedLeft(), "45 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");127 console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");128 console.assert(23 === root_child2.getComputedWidth(), "23 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");129 console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");130 console.assert(23 === root_child3.getComputedLeft(), "23 === root_child3.getComputedLeft() (" + root_child3.getComputedLeft() + ")");131 console.assert(0 === root_child3.getComputedTop(), "0 === root_child3.getComputedTop() (" + root_child3.getComputedTop() + ")");132 console.assert(22 === root_child3.getComputedWidth(), "22 === root_child3.getComputedWidth() (" + root_child3.getComputedWidth() + ")");133 console.assert(100 === root_child3.getComputedHeight(), "100 === root_child3.getComputedHeight() (" + root_child3.getComputedHeight() + ")");134 console.assert(0 === root_child4.getComputedLeft(), "0 === root_child4.getComputedLeft() (" + root_child4.getComputedLeft() + ")");135 console.assert(0 === root_child4.getComputedTop(), "0 === root_child4.getComputedTop() (" + root_child4.getComputedTop() + ")");136 console.assert(23 === root_child4.getComputedWidth(), "23 === root_child4.getComputedWidth() (" + root_child4.getComputedWidth() + ")");137 console.assert(100 === root_child4.getComputedHeight(), "100 === root_child4.getComputedHeight() (" + root_child4.getComputedHeight() + ")");138 } finally {139 if (typeof root !== "undefined") {140 root.freeRecursive();141 }142 config.free();143 }144});145it("rounding_flex_basis_flex_shrink_row", function () {146 var config = Yoga.Config.create();147 try {148 var root = Yoga.Node.create(config);149 root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);150 root.setWidth(101);151 root.setHeight(100);152 var root_child0 = Yoga.Node.create(config);153 root_child0.setFlexShrink(1);154 root_child0.setFlexBasis(100);155 root.insertChild(root_child0, 0);156 var root_child1 = Yoga.Node.create(config);157 root_child1.setFlexBasis(25);158 root.insertChild(root_child1, 1);159 var root_child2 = Yoga.Node.create(config);160 root_child2.setFlexBasis(25);161 root.insertChild(root_child2, 2);162 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);163 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");164 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");165 console.assert(101 === root.getComputedWidth(), "101 === root.getComputedWidth() (" + root.getComputedWidth() + ")");166 console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");167 console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");168 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");169 console.assert(51 === root_child0.getComputedWidth(), "51 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");170 console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");171 console.assert(51 === root_child1.getComputedLeft(), "51 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");172 console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");173 console.assert(25 === root_child1.getComputedWidth(), "25 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");174 console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");175 console.assert(76 === root_child2.getComputedLeft(), "76 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");176 console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");177 console.assert(25 === root_child2.getComputedWidth(), "25 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");178 console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");179 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);180 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");181 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");182 console.assert(101 === root.getComputedWidth(), "101 === root.getComputedWidth() (" + root.getComputedWidth() + ")");183 console.assert(100 === root.getComputedHeight(), "100 === root.getComputedHeight() (" + root.getComputedHeight() + ")");184 console.assert(50 === root_child0.getComputedLeft(), "50 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");185 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");186 console.assert(51 === root_child0.getComputedWidth(), "51 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");187 console.assert(100 === root_child0.getComputedHeight(), "100 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");188 console.assert(25 === root_child1.getComputedLeft(), "25 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");189 console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");190 console.assert(25 === root_child1.getComputedWidth(), "25 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");191 console.assert(100 === root_child1.getComputedHeight(), "100 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");192 console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");193 console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");194 console.assert(25 === root_child2.getComputedWidth(), "25 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");195 console.assert(100 === root_child2.getComputedHeight(), "100 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");196 } finally {197 if (typeof root !== "undefined") {198 root.freeRecursive();199 }200 config.free();201 }202});203it("rounding_flex_basis_overrides_main_size", function () {204 var config = Yoga.Config.create();205 try {206 var root = Yoga.Node.create(config);207 root.setWidth(100);208 root.setHeight(113);209 var root_child0 = Yoga.Node.create(config);210 root_child0.setFlexGrow(1);211 root_child0.setFlexBasis(50);212 root_child0.setHeight(20);213 root.insertChild(root_child0, 0);214 var root_child1 = Yoga.Node.create(config);215 root_child1.setFlexGrow(1);216 root_child1.setHeight(10);217 root.insertChild(root_child1, 1);218 var root_child2 = Yoga.Node.create(config);219 root_child2.setFlexGrow(1);220 root_child2.setHeight(10);221 root.insertChild(root_child2, 2);222 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);223 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");224 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");225 console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");226 console.assert(113 === root.getComputedHeight(), "113 === root.getComputedHeight() (" + root.getComputedHeight() + ")");227 console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");228 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");229 console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");230 console.assert(64 === root_child0.getComputedHeight(), "64 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");231 console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");232 console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");233 console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");234 console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");235 console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");236 console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");237 console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");238 console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");239 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);240 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");241 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");242 console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");243 console.assert(113 === root.getComputedHeight(), "113 === root.getComputedHeight() (" + root.getComputedHeight() + ")");244 console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");245 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");246 console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");247 console.assert(64 === root_child0.getComputedHeight(), "64 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");248 console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");249 console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");250 console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");251 console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");252 console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");253 console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");254 console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");255 console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");256 } finally {257 if (typeof root !== "undefined") {258 root.freeRecursive();259 }260 config.free();261 }262});263it("rounding_total_fractial", function () {264 var config = Yoga.Config.create();265 try {266 var root = Yoga.Node.create(config);267 root.setWidth(87.4);268 root.setHeight(113.4);269 var root_child0 = Yoga.Node.create(config);270 root_child0.setFlexGrow(0.7);271 root_child0.setFlexBasis(50.3);272 root_child0.setHeight(20.3);273 root.insertChild(root_child0, 0);274 var root_child1 = Yoga.Node.create(config);275 root_child1.setFlexGrow(1.6);276 root_child1.setHeight(10);277 root.insertChild(root_child1, 1);278 var root_child2 = Yoga.Node.create(config);279 root_child2.setFlexGrow(1.1);280 root_child2.setHeight(10.7);281 root.insertChild(root_child2, 2);282 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);283 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");284 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");285 console.assert(87 === root.getComputedWidth(), "87 === root.getComputedWidth() (" + root.getComputedWidth() + ")");286 console.assert(113 === root.getComputedHeight(), "113 === root.getComputedHeight() (" + root.getComputedHeight() + ")");287 console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");288 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");289 console.assert(87 === root_child0.getComputedWidth(), "87 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");290 console.assert(59 === root_child0.getComputedHeight(), "59 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");291 console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");292 console.assert(59 === root_child1.getComputedTop(), "59 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");293 console.assert(87 === root_child1.getComputedWidth(), "87 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");294 console.assert(30 === root_child1.getComputedHeight(), "30 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");295 console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");296 console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");297 console.assert(87 === root_child2.getComputedWidth(), "87 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");298 console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");299 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);300 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");301 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");302 console.assert(87 === root.getComputedWidth(), "87 === root.getComputedWidth() (" + root.getComputedWidth() + ")");303 console.assert(113 === root.getComputedHeight(), "113 === root.getComputedHeight() (" + root.getComputedHeight() + ")");304 console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");305 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");306 console.assert(87 === root_child0.getComputedWidth(), "87 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");307 console.assert(59 === root_child0.getComputedHeight(), "59 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");308 console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");309 console.assert(59 === root_child1.getComputedTop(), "59 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");310 console.assert(87 === root_child1.getComputedWidth(), "87 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");311 console.assert(30 === root_child1.getComputedHeight(), "30 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");312 console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");313 console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");314 console.assert(87 === root_child2.getComputedWidth(), "87 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");315 console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");316 } finally {317 if (typeof root !== "undefined") {318 root.freeRecursive();319 }320 config.free();321 }322});323it("rounding_total_fractial_nested", function () {324 var config = Yoga.Config.create();325 try {326 var root = Yoga.Node.create(config);327 root.setWidth(87.4);328 root.setHeight(113.4);329 var root_child0 = Yoga.Node.create(config);330 root_child0.setFlexGrow(0.7);331 root_child0.setFlexBasis(50.3);332 root_child0.setHeight(20.3);333 root.insertChild(root_child0, 0);334 var root_child0_child0 = Yoga.Node.create(config);335 root_child0_child0.setFlexGrow(1);336 root_child0_child0.setFlexBasis(0.3);337 root_child0_child0.setPosition(Yoga.EDGE_BOTTOM, 13.3);338 root_child0_child0.setHeight(9.9);339 root_child0.insertChild(root_child0_child0, 0);340 var root_child0_child1 = Yoga.Node.create(config);341 root_child0_child1.setFlexGrow(4);342 root_child0_child1.setFlexBasis(0.3);343 root_child0_child1.setPosition(Yoga.EDGE_TOP, 13.3);344 root_child0_child1.setHeight(1.1);345 root_child0.insertChild(root_child0_child1, 1);346 var root_child1 = Yoga.Node.create(config);347 root_child1.setFlexGrow(1.6);348 root_child1.setHeight(10);349 root.insertChild(root_child1, 1);350 var root_child2 = Yoga.Node.create(config);351 root_child2.setFlexGrow(1.1);352 root_child2.setHeight(10.7);353 root.insertChild(root_child2, 2);354 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);355 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");356 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");357 console.assert(87 === root.getComputedWidth(), "87 === root.getComputedWidth() (" + root.getComputedWidth() + ")");358 console.assert(113 === root.getComputedHeight(), "113 === root.getComputedHeight() (" + root.getComputedHeight() + ")");359 console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");360 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");361 console.assert(87 === root_child0.getComputedWidth(), "87 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");362 console.assert(59 === root_child0.getComputedHeight(), "59 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");363 console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");364 console.assert(-13 === root_child0_child0.getComputedTop(), "-13 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");365 console.assert(87 === root_child0_child0.getComputedWidth(), "87 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");366 console.assert(12 === root_child0_child0.getComputedHeight(), "12 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");367 console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")");368 console.assert(25 === root_child0_child1.getComputedTop(), "25 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")");369 console.assert(87 === root_child0_child1.getComputedWidth(), "87 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")");370 console.assert(47 === root_child0_child1.getComputedHeight(), "47 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")");371 console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");372 console.assert(59 === root_child1.getComputedTop(), "59 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");373 console.assert(87 === root_child1.getComputedWidth(), "87 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");374 console.assert(30 === root_child1.getComputedHeight(), "30 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");375 console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");376 console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");377 console.assert(87 === root_child2.getComputedWidth(), "87 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");378 console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");379 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);380 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");381 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");382 console.assert(87 === root.getComputedWidth(), "87 === root.getComputedWidth() (" + root.getComputedWidth() + ")");383 console.assert(113 === root.getComputedHeight(), "113 === root.getComputedHeight() (" + root.getComputedHeight() + ")");384 console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");385 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");386 console.assert(87 === root_child0.getComputedWidth(), "87 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");387 console.assert(59 === root_child0.getComputedHeight(), "59 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");388 console.assert(0 === root_child0_child0.getComputedLeft(), "0 === root_child0_child0.getComputedLeft() (" + root_child0_child0.getComputedLeft() + ")");389 console.assert(-13 === root_child0_child0.getComputedTop(), "-13 === root_child0_child0.getComputedTop() (" + root_child0_child0.getComputedTop() + ")");390 console.assert(87 === root_child0_child0.getComputedWidth(), "87 === root_child0_child0.getComputedWidth() (" + root_child0_child0.getComputedWidth() + ")");391 console.assert(12 === root_child0_child0.getComputedHeight(), "12 === root_child0_child0.getComputedHeight() (" + root_child0_child0.getComputedHeight() + ")");392 console.assert(0 === root_child0_child1.getComputedLeft(), "0 === root_child0_child1.getComputedLeft() (" + root_child0_child1.getComputedLeft() + ")");393 console.assert(25 === root_child0_child1.getComputedTop(), "25 === root_child0_child1.getComputedTop() (" + root_child0_child1.getComputedTop() + ")");394 console.assert(87 === root_child0_child1.getComputedWidth(), "87 === root_child0_child1.getComputedWidth() (" + root_child0_child1.getComputedWidth() + ")");395 console.assert(47 === root_child0_child1.getComputedHeight(), "47 === root_child0_child1.getComputedHeight() (" + root_child0_child1.getComputedHeight() + ")");396 console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");397 console.assert(59 === root_child1.getComputedTop(), "59 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");398 console.assert(87 === root_child1.getComputedWidth(), "87 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");399 console.assert(30 === root_child1.getComputedHeight(), "30 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");400 console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");401 console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");402 console.assert(87 === root_child2.getComputedWidth(), "87 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");403 console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");404 } finally {405 if (typeof root !== "undefined") {406 root.freeRecursive();407 }408 config.free();409 }410});411it("rounding_fractial_input_1", function () {412 var config = Yoga.Config.create();413 try {414 var root = Yoga.Node.create(config);415 root.setWidth(100);416 root.setHeight(113.4);417 var root_child0 = Yoga.Node.create(config);418 root_child0.setFlexGrow(1);419 root_child0.setFlexBasis(50);420 root_child0.setHeight(20);421 root.insertChild(root_child0, 0);422 var root_child1 = Yoga.Node.create(config);423 root_child1.setFlexGrow(1);424 root_child1.setHeight(10);425 root.insertChild(root_child1, 1);426 var root_child2 = Yoga.Node.create(config);427 root_child2.setFlexGrow(1);428 root_child2.setHeight(10);429 root.insertChild(root_child2, 2);430 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);431 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");432 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");433 console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");434 console.assert(113 === root.getComputedHeight(), "113 === root.getComputedHeight() (" + root.getComputedHeight() + ")");435 console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");436 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");437 console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");438 console.assert(64 === root_child0.getComputedHeight(), "64 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");439 console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");440 console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");441 console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");442 console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");443 console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");444 console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");445 console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");446 console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");447 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);448 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");449 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");450 console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");451 console.assert(113 === root.getComputedHeight(), "113 === root.getComputedHeight() (" + root.getComputedHeight() + ")");452 console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");453 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");454 console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");455 console.assert(64 === root_child0.getComputedHeight(), "64 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");456 console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");457 console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");458 console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");459 console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");460 console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");461 console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");462 console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");463 console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");464 } finally {465 if (typeof root !== "undefined") {466 root.freeRecursive();467 }468 config.free();469 }470});471it("rounding_fractial_input_2", function () {472 var config = Yoga.Config.create();473 try {474 var root = Yoga.Node.create(config);475 root.setWidth(100);476 root.setHeight(113.6);477 var root_child0 = Yoga.Node.create(config);478 root_child0.setFlexGrow(1);479 root_child0.setFlexBasis(50);480 root_child0.setHeight(20);481 root.insertChild(root_child0, 0);482 var root_child1 = Yoga.Node.create(config);483 root_child1.setFlexGrow(1);484 root_child1.setHeight(10);485 root.insertChild(root_child1, 1);486 var root_child2 = Yoga.Node.create(config);487 root_child2.setFlexGrow(1);488 root_child2.setHeight(10);489 root.insertChild(root_child2, 2);490 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);491 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");492 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");493 console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");494 console.assert(114 === root.getComputedHeight(), "114 === root.getComputedHeight() (" + root.getComputedHeight() + ")");495 console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");496 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");497 console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");498 console.assert(65 === root_child0.getComputedHeight(), "65 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");499 console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");500 console.assert(65 === root_child1.getComputedTop(), "65 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");501 console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");502 console.assert(24 === root_child1.getComputedHeight(), "24 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");503 console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");504 console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");505 console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");506 console.assert(25 === root_child2.getComputedHeight(), "25 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");507 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);508 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");509 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");510 console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");511 console.assert(114 === root.getComputedHeight(), "114 === root.getComputedHeight() (" + root.getComputedHeight() + ")");512 console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");513 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");514 console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");515 console.assert(65 === root_child0.getComputedHeight(), "65 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");516 console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");517 console.assert(65 === root_child1.getComputedTop(), "65 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");518 console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");519 console.assert(24 === root_child1.getComputedHeight(), "24 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");520 console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");521 console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");522 console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");523 console.assert(25 === root_child2.getComputedHeight(), "25 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");524 } finally {525 if (typeof root !== "undefined") {526 root.freeRecursive();527 }528 config.free();529 }530});531it("rounding_fractial_input_3", function () {532 var config = Yoga.Config.create();533 try {534 var root = Yoga.Node.create(config);535 root.setPosition(Yoga.EDGE_TOP, 0.3);536 root.setWidth(100);537 root.setHeight(113.4);538 var root_child0 = Yoga.Node.create(config);539 root_child0.setFlexGrow(1);540 root_child0.setFlexBasis(50);541 root_child0.setHeight(20);542 root.insertChild(root_child0, 0);543 var root_child1 = Yoga.Node.create(config);544 root_child1.setFlexGrow(1);545 root_child1.setHeight(10);546 root.insertChild(root_child1, 1);547 var root_child2 = Yoga.Node.create(config);548 root_child2.setFlexGrow(1);549 root_child2.setHeight(10);550 root.insertChild(root_child2, 2);551 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);552 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");553 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");554 console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");555 console.assert(114 === root.getComputedHeight(), "114 === root.getComputedHeight() (" + root.getComputedHeight() + ")");556 console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");557 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");558 console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");559 console.assert(65 === root_child0.getComputedHeight(), "65 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");560 console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");561 console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");562 console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");563 console.assert(24 === root_child1.getComputedHeight(), "24 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");564 console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");565 console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");566 console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");567 console.assert(25 === root_child2.getComputedHeight(), "25 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");568 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);569 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");570 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");571 console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");572 console.assert(114 === root.getComputedHeight(), "114 === root.getComputedHeight() (" + root.getComputedHeight() + ")");573 console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");574 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");575 console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");576 console.assert(65 === root_child0.getComputedHeight(), "65 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");577 console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");578 console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");579 console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");580 console.assert(24 === root_child1.getComputedHeight(), "24 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");581 console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");582 console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");583 console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");584 console.assert(25 === root_child2.getComputedHeight(), "25 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");585 } finally {586 if (typeof root !== "undefined") {587 root.freeRecursive();588 }589 config.free();590 }591});592it("rounding_fractial_input_4", function () {593 var config = Yoga.Config.create();594 try {595 var root = Yoga.Node.create(config);596 root.setPosition(Yoga.EDGE_TOP, 0.7);597 root.setWidth(100);598 root.setHeight(113.4);599 var root_child0 = Yoga.Node.create(config);600 root_child0.setFlexGrow(1);601 root_child0.setFlexBasis(50);602 root_child0.setHeight(20);603 root.insertChild(root_child0, 0);604 var root_child1 = Yoga.Node.create(config);605 root_child1.setFlexGrow(1);606 root_child1.setHeight(10);607 root.insertChild(root_child1, 1);608 var root_child2 = Yoga.Node.create(config);609 root_child2.setFlexGrow(1);610 root_child2.setHeight(10);611 root.insertChild(root_child2, 2);612 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);613 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");614 console.assert(1 === root.getComputedTop(), "1 === root.getComputedTop() (" + root.getComputedTop() + ")");615 console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");616 console.assert(113 === root.getComputedHeight(), "113 === root.getComputedHeight() (" + root.getComputedHeight() + ")");617 console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");618 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");619 console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");620 console.assert(64 === root_child0.getComputedHeight(), "64 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");621 console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");622 console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");623 console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");624 console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");625 console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");626 console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");627 console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");628 console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");629 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);630 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");631 console.assert(1 === root.getComputedTop(), "1 === root.getComputedTop() (" + root.getComputedTop() + ")");632 console.assert(100 === root.getComputedWidth(), "100 === root.getComputedWidth() (" + root.getComputedWidth() + ")");633 console.assert(113 === root.getComputedHeight(), "113 === root.getComputedHeight() (" + root.getComputedHeight() + ")");634 console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");635 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");636 console.assert(100 === root_child0.getComputedWidth(), "100 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");637 console.assert(64 === root_child0.getComputedHeight(), "64 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");638 console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");639 console.assert(64 === root_child1.getComputedTop(), "64 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");640 console.assert(100 === root_child1.getComputedWidth(), "100 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");641 console.assert(25 === root_child1.getComputedHeight(), "25 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");642 console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");643 console.assert(89 === root_child2.getComputedTop(), "89 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");644 console.assert(100 === root_child2.getComputedWidth(), "100 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");645 console.assert(24 === root_child2.getComputedHeight(), "24 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");646 } finally {647 if (typeof root !== "undefined") {648 root.freeRecursive();649 }650 config.free();651 }652});653it("rounding_inner_node_controversy_horizontal", function () {654 var config = Yoga.Config.create();655 try {656 var root = Yoga.Node.create(config);657 root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);658 root.setWidth(320);659 var root_child0 = Yoga.Node.create(config);660 root_child0.setFlexGrow(1);661 root_child0.setHeight(10);662 root.insertChild(root_child0, 0);663 var root_child1 = Yoga.Node.create(config);664 root_child1.setFlexGrow(1);665 root_child1.setHeight(10);666 root.insertChild(root_child1, 1);667 var root_child1_child0 = Yoga.Node.create(config);668 root_child1_child0.setFlexGrow(1);669 root_child1_child0.setHeight(10);670 root_child1.insertChild(root_child1_child0, 0);671 var root_child2 = Yoga.Node.create(config);672 root_child2.setFlexGrow(1);673 root_child2.setHeight(10);674 root.insertChild(root_child2, 2);675 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);676 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");677 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");678 console.assert(320 === root.getComputedWidth(), "320 === root.getComputedWidth() (" + root.getComputedWidth() + ")");679 console.assert(10 === root.getComputedHeight(), "10 === root.getComputedHeight() (" + root.getComputedHeight() + ")");680 console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");681 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");682 console.assert(107 === root_child0.getComputedWidth(), "107 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");683 console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");684 console.assert(107 === root_child1.getComputedLeft(), "107 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");685 console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");686 console.assert(106 === root_child1.getComputedWidth(), "106 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");687 console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");688 console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");689 console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");690 console.assert(106 === root_child1_child0.getComputedWidth(), "106 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");691 console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");692 console.assert(213 === root_child2.getComputedLeft(), "213 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");693 console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");694 console.assert(107 === root_child2.getComputedWidth(), "107 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");695 console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");696 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);697 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");698 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");699 console.assert(320 === root.getComputedWidth(), "320 === root.getComputedWidth() (" + root.getComputedWidth() + ")");700 console.assert(10 === root.getComputedHeight(), "10 === root.getComputedHeight() (" + root.getComputedHeight() + ")");701 console.assert(213 === root_child0.getComputedLeft(), "213 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");702 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");703 console.assert(107 === root_child0.getComputedWidth(), "107 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");704 console.assert(10 === root_child0.getComputedHeight(), "10 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");705 console.assert(107 === root_child1.getComputedLeft(), "107 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");706 console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");707 console.assert(106 === root_child1.getComputedWidth(), "106 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");708 console.assert(10 === root_child1.getComputedHeight(), "10 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");709 console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");710 console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");711 console.assert(106 === root_child1_child0.getComputedWidth(), "106 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");712 console.assert(10 === root_child1_child0.getComputedHeight(), "10 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");713 console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");714 console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");715 console.assert(107 === root_child2.getComputedWidth(), "107 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");716 console.assert(10 === root_child2.getComputedHeight(), "10 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");717 } finally {718 if (typeof root !== "undefined") {719 root.freeRecursive();720 }721 config.free();722 }723});724it("rounding_inner_node_controversy_vertical", function () {725 var config = Yoga.Config.create();726 try {727 var root = Yoga.Node.create(config);728 root.setHeight(320);729 var root_child0 = Yoga.Node.create(config);730 root_child0.setFlexGrow(1);731 root_child0.setWidth(10);732 root.insertChild(root_child0, 0);733 var root_child1 = Yoga.Node.create(config);734 root_child1.setFlexGrow(1);735 root_child1.setWidth(10);736 root.insertChild(root_child1, 1);737 var root_child1_child0 = Yoga.Node.create(config);738 root_child1_child0.setFlexGrow(1);739 root_child1_child0.setWidth(10);740 root_child1.insertChild(root_child1_child0, 0);741 var root_child2 = Yoga.Node.create(config);742 root_child2.setFlexGrow(1);743 root_child2.setWidth(10);744 root.insertChild(root_child2, 2);745 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);746 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");747 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");748 console.assert(10 === root.getComputedWidth(), "10 === root.getComputedWidth() (" + root.getComputedWidth() + ")");749 console.assert(320 === root.getComputedHeight(), "320 === root.getComputedHeight() (" + root.getComputedHeight() + ")");750 console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");751 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");752 console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");753 console.assert(107 === root_child0.getComputedHeight(), "107 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");754 console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");755 console.assert(107 === root_child1.getComputedTop(), "107 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");756 console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");757 console.assert(106 === root_child1.getComputedHeight(), "106 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");758 console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");759 console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");760 console.assert(10 === root_child1_child0.getComputedWidth(), "10 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");761 console.assert(106 === root_child1_child0.getComputedHeight(), "106 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");762 console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");763 console.assert(213 === root_child2.getComputedTop(), "213 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");764 console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");765 console.assert(107 === root_child2.getComputedHeight(), "107 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");766 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);767 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");768 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");769 console.assert(10 === root.getComputedWidth(), "10 === root.getComputedWidth() (" + root.getComputedWidth() + ")");770 console.assert(320 === root.getComputedHeight(), "320 === root.getComputedHeight() (" + root.getComputedHeight() + ")");771 console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");772 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");773 console.assert(10 === root_child0.getComputedWidth(), "10 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");774 console.assert(107 === root_child0.getComputedHeight(), "107 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");775 console.assert(0 === root_child1.getComputedLeft(), "0 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");776 console.assert(107 === root_child1.getComputedTop(), "107 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");777 console.assert(10 === root_child1.getComputedWidth(), "10 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");778 console.assert(106 === root_child1.getComputedHeight(), "106 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");779 console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");780 console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");781 console.assert(10 === root_child1_child0.getComputedWidth(), "10 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");782 console.assert(106 === root_child1_child0.getComputedHeight(), "106 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");783 console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");784 console.assert(213 === root_child2.getComputedTop(), "213 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");785 console.assert(10 === root_child2.getComputedWidth(), "10 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");786 console.assert(107 === root_child2.getComputedHeight(), "107 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");787 } finally {788 if (typeof root !== "undefined") {789 root.freeRecursive();790 }791 config.free();792 }793});794it("rounding_inner_node_controversy_combined", function () {795 var config = Yoga.Config.create();796 try {797 var root = Yoga.Node.create(config);798 root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);799 root.setWidth(640);800 root.setHeight(320);801 var root_child0 = Yoga.Node.create(config);802 root_child0.setFlexGrow(1);803 root_child0.setHeight("100%");804 root.insertChild(root_child0, 0);805 var root_child1 = Yoga.Node.create(config);806 root_child1.setFlexGrow(1);807 root_child1.setHeight("100%");808 root.insertChild(root_child1, 1);809 var root_child1_child0 = Yoga.Node.create(config);810 root_child1_child0.setFlexGrow(1);811 root_child1_child0.setWidth("100%");812 root_child1.insertChild(root_child1_child0, 0);813 var root_child1_child1 = Yoga.Node.create(config);814 root_child1_child1.setFlexGrow(1);815 root_child1_child1.setWidth("100%");816 root_child1.insertChild(root_child1_child1, 1);817 var root_child1_child1_child0 = Yoga.Node.create(config);818 root_child1_child1_child0.setFlexGrow(1);819 root_child1_child1_child0.setWidth("100%");820 root_child1_child1.insertChild(root_child1_child1_child0, 0);821 var root_child1_child2 = Yoga.Node.create(config);822 root_child1_child2.setFlexGrow(1);823 root_child1_child2.setWidth("100%");824 root_child1.insertChild(root_child1_child2, 2);825 var root_child2 = Yoga.Node.create(config);826 root_child2.setFlexGrow(1);827 root_child2.setHeight("100%");828 root.insertChild(root_child2, 2);829 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);830 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");831 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");832 console.assert(640 === root.getComputedWidth(), "640 === root.getComputedWidth() (" + root.getComputedWidth() + ")");833 console.assert(320 === root.getComputedHeight(), "320 === root.getComputedHeight() (" + root.getComputedHeight() + ")");834 console.assert(0 === root_child0.getComputedLeft(), "0 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");835 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");836 console.assert(213 === root_child0.getComputedWidth(), "213 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");837 console.assert(320 === root_child0.getComputedHeight(), "320 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");838 console.assert(213 === root_child1.getComputedLeft(), "213 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");839 console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");840 console.assert(214 === root_child1.getComputedWidth(), "214 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");841 console.assert(320 === root_child1.getComputedHeight(), "320 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");842 console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");843 console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");844 console.assert(214 === root_child1_child0.getComputedWidth(), "214 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");845 console.assert(107 === root_child1_child0.getComputedHeight(), "107 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");846 console.assert(0 === root_child1_child1.getComputedLeft(), "0 === root_child1_child1.getComputedLeft() (" + root_child1_child1.getComputedLeft() + ")");847 console.assert(107 === root_child1_child1.getComputedTop(), "107 === root_child1_child1.getComputedTop() (" + root_child1_child1.getComputedTop() + ")");848 console.assert(214 === root_child1_child1.getComputedWidth(), "214 === root_child1_child1.getComputedWidth() (" + root_child1_child1.getComputedWidth() + ")");849 console.assert(106 === root_child1_child1.getComputedHeight(), "106 === root_child1_child1.getComputedHeight() (" + root_child1_child1.getComputedHeight() + ")");850 console.assert(0 === root_child1_child1_child0.getComputedLeft(), "0 === root_child1_child1_child0.getComputedLeft() (" + root_child1_child1_child0.getComputedLeft() + ")");851 console.assert(0 === root_child1_child1_child0.getComputedTop(), "0 === root_child1_child1_child0.getComputedTop() (" + root_child1_child1_child0.getComputedTop() + ")");852 console.assert(214 === root_child1_child1_child0.getComputedWidth(), "214 === root_child1_child1_child0.getComputedWidth() (" + root_child1_child1_child0.getComputedWidth() + ")");853 console.assert(106 === root_child1_child1_child0.getComputedHeight(), "106 === root_child1_child1_child0.getComputedHeight() (" + root_child1_child1_child0.getComputedHeight() + ")");854 console.assert(0 === root_child1_child2.getComputedLeft(), "0 === root_child1_child2.getComputedLeft() (" + root_child1_child2.getComputedLeft() + ")");855 console.assert(213 === root_child1_child2.getComputedTop(), "213 === root_child1_child2.getComputedTop() (" + root_child1_child2.getComputedTop() + ")");856 console.assert(214 === root_child1_child2.getComputedWidth(), "214 === root_child1_child2.getComputedWidth() (" + root_child1_child2.getComputedWidth() + ")");857 console.assert(107 === root_child1_child2.getComputedHeight(), "107 === root_child1_child2.getComputedHeight() (" + root_child1_child2.getComputedHeight() + ")");858 console.assert(427 === root_child2.getComputedLeft(), "427 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");859 console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");860 console.assert(213 === root_child2.getComputedWidth(), "213 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");861 console.assert(320 === root_child2.getComputedHeight(), "320 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");862 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_RTL);863 console.assert(0 === root.getComputedLeft(), "0 === root.getComputedLeft() (" + root.getComputedLeft() + ")");864 console.assert(0 === root.getComputedTop(), "0 === root.getComputedTop() (" + root.getComputedTop() + ")");865 console.assert(640 === root.getComputedWidth(), "640 === root.getComputedWidth() (" + root.getComputedWidth() + ")");866 console.assert(320 === root.getComputedHeight(), "320 === root.getComputedHeight() (" + root.getComputedHeight() + ")");867 console.assert(427 === root_child0.getComputedLeft(), "427 === root_child0.getComputedLeft() (" + root_child0.getComputedLeft() + ")");868 console.assert(0 === root_child0.getComputedTop(), "0 === root_child0.getComputedTop() (" + root_child0.getComputedTop() + ")");869 console.assert(213 === root_child0.getComputedWidth(), "213 === root_child0.getComputedWidth() (" + root_child0.getComputedWidth() + ")");870 console.assert(320 === root_child0.getComputedHeight(), "320 === root_child0.getComputedHeight() (" + root_child0.getComputedHeight() + ")");871 console.assert(213 === root_child1.getComputedLeft(), "213 === root_child1.getComputedLeft() (" + root_child1.getComputedLeft() + ")");872 console.assert(0 === root_child1.getComputedTop(), "0 === root_child1.getComputedTop() (" + root_child1.getComputedTop() + ")");873 console.assert(214 === root_child1.getComputedWidth(), "214 === root_child1.getComputedWidth() (" + root_child1.getComputedWidth() + ")");874 console.assert(320 === root_child1.getComputedHeight(), "320 === root_child1.getComputedHeight() (" + root_child1.getComputedHeight() + ")");875 console.assert(0 === root_child1_child0.getComputedLeft(), "0 === root_child1_child0.getComputedLeft() (" + root_child1_child0.getComputedLeft() + ")");876 console.assert(0 === root_child1_child0.getComputedTop(), "0 === root_child1_child0.getComputedTop() (" + root_child1_child0.getComputedTop() + ")");877 console.assert(214 === root_child1_child0.getComputedWidth(), "214 === root_child1_child0.getComputedWidth() (" + root_child1_child0.getComputedWidth() + ")");878 console.assert(107 === root_child1_child0.getComputedHeight(), "107 === root_child1_child0.getComputedHeight() (" + root_child1_child0.getComputedHeight() + ")");879 console.assert(0 === root_child1_child1.getComputedLeft(), "0 === root_child1_child1.getComputedLeft() (" + root_child1_child1.getComputedLeft() + ")");880 console.assert(107 === root_child1_child1.getComputedTop(), "107 === root_child1_child1.getComputedTop() (" + root_child1_child1.getComputedTop() + ")");881 console.assert(214 === root_child1_child1.getComputedWidth(), "214 === root_child1_child1.getComputedWidth() (" + root_child1_child1.getComputedWidth() + ")");882 console.assert(106 === root_child1_child1.getComputedHeight(), "106 === root_child1_child1.getComputedHeight() (" + root_child1_child1.getComputedHeight() + ")");883 console.assert(0 === root_child1_child1_child0.getComputedLeft(), "0 === root_child1_child1_child0.getComputedLeft() (" + root_child1_child1_child0.getComputedLeft() + ")");884 console.assert(0 === root_child1_child1_child0.getComputedTop(), "0 === root_child1_child1_child0.getComputedTop() (" + root_child1_child1_child0.getComputedTop() + ")");885 console.assert(214 === root_child1_child1_child0.getComputedWidth(), "214 === root_child1_child1_child0.getComputedWidth() (" + root_child1_child1_child0.getComputedWidth() + ")");886 console.assert(106 === root_child1_child1_child0.getComputedHeight(), "106 === root_child1_child1_child0.getComputedHeight() (" + root_child1_child1_child0.getComputedHeight() + ")");887 console.assert(0 === root_child1_child2.getComputedLeft(), "0 === root_child1_child2.getComputedLeft() (" + root_child1_child2.getComputedLeft() + ")");888 console.assert(213 === root_child1_child2.getComputedTop(), "213 === root_child1_child2.getComputedTop() (" + root_child1_child2.getComputedTop() + ")");889 console.assert(214 === root_child1_child2.getComputedWidth(), "214 === root_child1_child2.getComputedWidth() (" + root_child1_child2.getComputedWidth() + ")");890 console.assert(107 === root_child1_child2.getComputedHeight(), "107 === root_child1_child2.getComputedHeight() (" + root_child1_child2.getComputedHeight() + ")");891 console.assert(0 === root_child2.getComputedLeft(), "0 === root_child2.getComputedLeft() (" + root_child2.getComputedLeft() + ")");892 console.assert(0 === root_child2.getComputedTop(), "0 === root_child2.getComputedTop() (" + root_child2.getComputedTop() + ")");893 console.assert(213 === root_child2.getComputedWidth(), "213 === root_child2.getComputedWidth() (" + root_child2.getComputedWidth() + ")");894 console.assert(320 === root_child2.getComputedHeight(), "320 === root_child2.getComputedHeight() (" + root_child2.getComputedHeight() + ")");895 } finally {896 if (typeof root !== "undefined") {897 root.freeRecursive();898 }899 config.free();900 }...

Full Screen

Full Screen

YGAlignBaselineTest.js

Source:YGAlignBaselineTest.js Github

copy

Full Screen

1/**2 * Copyright (c) Facebook, Inc. and its affiliates.3 *4 * This source code is licensed under the MIT license found in the5 * LICENSE file in the root directory of this source tree.6 */7var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);8it("align_baseline_parent_using_child_in_column_as_reference", function () {9 var config = Yoga.Config.create();10 try {11 var root = Yoga.Node.create(config);12 root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);13 root.setWidth(1000);14 root.setHeight(1000);15 root.setAlignItems(Yoga.ALIGN_BASELINE);16 var root_child0 = Yoga.Node.create(config);17 root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);18 root_child0.setWidth(500);19 root_child0.setHeight(600);20 root.insertChild(root_child0, 0);21 var root_child1 = Yoga.Node.create(config);22 root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);23 root_child1.setWidth(500);24 root_child1.setHeight(800);25 root.insertChild(root_child1, 1);26 var root_child1_child0 = Yoga.Node.create(config);27 root_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);28 root_child1_child0.setWidth(500);29 root_child1_child0.setHeight(300);30 root_child1.insertChild(root_child1_child0, 0);31 var root_child1_child1 = Yoga.Node.create(config);32 root_child1_child1.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);33 root_child1_child1.setWidth(500);34 root_child1_child1.setHeight(400);35 root_child1_child1.setIsReferenceBaseline(true);36 root_child1.insertChild(root_child1_child1, 1);37 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);38 console.assert(0 === root_child0.getComputedLeft(),39 "0 === root_child0.getComputedLeft() (" +40 root_child0.getComputedLeft() + ")");41 console.assert(100 === root_child0.getComputedTop(),42 "100 === root_child0.getComputedTop() (" +43 root_child0.getComputedTop() + ")");44 console.assert(500 === root_child1.getComputedLeft(),45 "500 === root_child1.getComputedLeft() (" +46 root_child1.getComputedLeft() + ")");47 console.assert(0 === root_child1.getComputedTop(),48 "0 === root_child1.getComputedTop() (" +49 root_child1.getComputedTop() + ")");50 console.assert(0 === root_child1_child0.getComputedLeft(),51 "0 === root_child1_child0.getComputedLeft() (" +52 root_child1_child0.getComputedLeft() + ")");53 console.assert(0 === root_child1_child0.getComputedTop(),54 "0 === root_child1_child0.getComputedTop() (" +55 root_child1_child0.getComputedTop() + ")");56 console.assert(0 === root_child1_child1.getComputedLeft(),57 "0 === root_child1_child1.getComputedLeft() (" +58 root_child1_child1.getComputedLeft() + ")");59 console.assert(300 === root_child1_child1.getComputedTop(),60 "300 === root_child1_child1.getComputedTop() (" +61 root_child1_child1.getComputedTop() + ")");62 } finally {63 if (typeof root !== "undefined") {64 root.freeRecursive();65 }66 config.free();67 }68});69it("align_baseline_parent_using_child_in_row_as_reference", function () {70 var config = Yoga.Config.create();71 try {72 var root = Yoga.Node.create(config);73 root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);74 root.setWidth(1000);75 root.setHeight(1000);76 root.setAlignItems(Yoga.ALIGN_BASELINE);77 var root_child0 = Yoga.Node.create(config);78 root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);79 root_child0.setWidth(500);80 root_child0.setHeight(600);81 root.insertChild(root_child0, 0);82 var root_child1 = Yoga.Node.create(config);83 root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);84 root_child1.setWidth(500);85 root_child1.setHeight(800);86 root.insertChild(root_child1, 1);87 var root_child1_child0 = Yoga.Node.create(config);88 root_child1_child0.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);89 root_child1_child0.setWidth(500);90 root_child1_child0.setHeight(500);91 root_child1.insertChild(root_child1_child0, 0);92 var root_child1_child1 = Yoga.Node.create(config);93 root_child1_child1.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);94 root_child1_child1.setWidth(500);95 root_child1_child1.setHeight(400);96 root_child1_child1.setIsReferenceBaseline(true);97 root_child1.insertChild(root_child1_child1, 1);98 root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);99 console.assert(0 === root_child0.getComputedLeft(),100 "0 === root_child0.getComputedLeft() (" +101 root_child0.getComputedLeft() + ")");102 console.assert(0 === root_child0.getComputedTop(),103 "0 === root_child0.getComputedTop() (" +104 root_child0.getComputedTop() + ")");105 console.assert(500 === root_child1.getComputedLeft(),106 "500 === root_child1.getComputedLeft() (" +107 root_child1.getComputedLeft() + ")");108 console.assert(200 === root_child1.getComputedTop(),109 "200 === root_child1.getComputedTop() (" +110 root_child1.getComputedTop() + ")");111 console.assert(0 === root_child1_child0.getComputedLeft(),112 "0 === root_child1_child0.getComputedLeft() (" +113 root_child1_child0.getComputedLeft() + ")");114 console.assert(0 === root_child1_child0.getComputedTop(),115 "0 === root_child1_child0.getComputedTop() (" +116 root_child1_child0.getComputedTop() + ")");117 console.assert(500 === root_child1_child1.getComputedLeft(),118 "500 === root_child1_child1.getComputedLeft() (" +119 root_child1_child1.getComputedLeft() + ")");120 console.assert(0 === root_child1_child1.getComputedTop(),121 "0 === root_child1_child1.getComputedTop() (" +122 root_child1_child1.getComputedTop() + ")");123 } finally {124 if (typeof root !== "undefined") {125 root.freeRecursive();126 }127 config.free();128 }...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1import { child1 } from 'ng-mocks';2import { child2 } from 'ng-mocks';3import { child3 } from 'ng-mocks';4import { child4 } from 'ng-mocks';5import { child5 } from 'ng-mocks';6import { child6 } from 'ng-mocks';7import { child7 } from 'ng-mocks';8import { child8 } from 'ng-mocks';9import { child9 } from 'ng-mocks';10import { child10 } from 'ng-mocks';11import { child11 } from 'ng-mocks';12import { child12 } from 'ng-mocks';13import { child13 } from 'ng-mocks';14import { child14 } from 'ng-mocks';15import { child15 } from 'ng-mocks';16import { child16 } from 'ng-mocks';17import { child17 } from 'ng-mocks';18import { child18 } from 'ng-mocks';19import { child19 } from 'ng-mocks';20import { child20 } from 'ng-mocks';21import { child21 } from 'ng-mocks';22import { child22 } from 'ng-mocks';

Full Screen

Using AI Code Generation

copy

Full Screen

1import { MockBuilder, MockRender, ngMocks } from 'ng-mocks';2import { Child1Component } from './child1.component';3import { Child2Component } from './child2.component';4import { ParentComponent } from './parent.component';5describe('ParentComponent', () => {6 beforeEach(() => MockBuilder(ParentComponent));7 it('should create', () => {8 const fixture = MockRender(ParentComponent);9 const child1 = ngMocks.findInstance(Child1Component);10 child1.method();11 expect(child1.result).toEqual('child1');12 });13});14import { MockBuilder, MockRender, ngMocks } from 'ng-mocks';15import { Child1Component } from './child1.component';16import { Child2Component } from './child2.component';17import { ParentComponent } from './parent.component';18describe('ParentComponent', () => {19 beforeEach(() => MockBuilder(ParentComponent));20 it('should create', () => {21 const fixture = MockRender(ParentComponent);22 const child2 = ngMocks.findInstance(Child2Component);23 child2.method();24 expect(child2.result).toEqual('child2');25 });26});

Full Screen

Using AI Code Generation

copy

Full Screen

1const child1 = require('ng-mocks').child1;2const child2 = require('ng-mocks').child2;3const child3 = require('ng-mocks').child3;4const child4 = require('ng-mocks').child4;5const child5 = require('ng-mocks').child5;6const child6 = require('ng-mocks').child6;7const child7 = require('ng-mocks').child7;8const child8 = require('ng-mocks').child8;9const child9 = require('ng-mocks').child9;10const child10 = require('ng-mocks').child10;11const child11 = require('ng-mocks').child11;12const child12 = require('ng-mocks').child12;13const child13 = require('ng-mocks').child13;14const child14 = require('ng-mocks').child14;15const child15 = require('ng-mocks').child15;16const child16 = require('ng-mocks').child16;17const child17 = require('ng-mocks').child17;18const child18 = require('ng-mocks').child18;19const child19 = require('ng-mocks').child19;20const child20 = require('ng-mocks').child20;

Full Screen

Using AI Code Generation

copy

Full Screen

1import { Child1 } from 'ng-mocks';2import { Child2 } from 'ng-mocks';3import { Child3 } from 'ng-mocks';4import { Child4 } from 'ng-mocks';5import { Child5 } from 'ng-mocks';6import { Child6 } from 'ng-mocks';7import { Child7 } from 'ng-mocks';8import { Child8 } from 'ng-mocks';9import { Child9 } from 'ng-mocks';10import { Child10 } from 'ng-mocks';11import { Child11 } from 'ng-mocks';12import { Child12 } from 'ng-mocks';13import { Child13 } from 'ng-mocks';14import { Child14 } from 'ng-mocks';15import { Child15 } from 'ng-mocks';16import { Child16 } from 'ng-mocks';17import { Child17 } from 'ng-mocks';18import { Child18 } from 'ng-mocks';19import { Child19 } from 'ng-mocks';20import { Child20 } from 'ng-mocks';21import { Child21 } from 'ng-mocks';22import { Child22 } from 'ng-mocks';

Full Screen

Using AI Code Generation

copy

Full Screen

1import { Child1Component } from './child1.component';2import { MockBuilder, MockRender } from 'ng-mocks';3describe('Child1Component', () => {4 beforeEach(() => MockBuilder(Child1Component));5 it('should create', () => {6 const fixture = MockRender(Child1Component);7 expect(fixture.point.componentInstance).toBeTruthy();8 });9});10import { Component, OnInit } from '@angular/core';11@Component({12})13export class Child1Component implements OnInit {14 constructor() { }15 ngOnInit(): void {16 }17}18import { ComponentFixture, TestBed } from '@angular/core/testing';19import { Child1Component } from './child1.component';20describe('Child1Component', () => {21 let component: Child1Component;22 let fixture: ComponentFixture<Child1Component>;23 beforeEach(async () => {24 await TestBed.configureTestingModule({25 })26 .compileComponents();27 });28 beforeEach(() => {29 fixture = TestBed.createComponent(Child1Component);30 component = fixture.componentInstance;31 fixture.detectChanges();32 });33 it('should create', () => {34 expect(component).toBeTruthy();35 });36});

Full Screen

Using AI Code Generation

copy

Full Screen

1var child1 = ngMocks.get('child1');2expect(child1).toBeDefined();3var child2 = ngMocks.get('child2');4expect(child2).toBeDefined();5var child1 = ngMocks.get('child1');6expect(child1).toBeDefined();7var child2 = ngMocks.get('child2');8expect(child2).toBeDefined();9import { child1, child2 } from './test.js';10import { HttpClient } from '@angular/common/http';11jest.mock('@angular/common/http');12const mockHttpClient = {13 get: jest.fn(),14 post: jest.fn(),15 put: jest.fn(),16 delete: jest.fn()17};18const mockHttpClient = jest.fn(() => ({19 get: jest.fn(),20 post: jest.fn(),21 put: jest.fn(),22 delete: jest.fn()23}));24const mockHttpClient = jest.fn().mockImplementation(() => {25 return {26 get: jest.fn(),27 post: jest.fn(),28 put: jest.fn(),29 delete: jest.fn()30 };31});32import { HttpClientTestingModule } from '@angular/common/http/testing';33describe('

Full Screen

Using AI Code Generation

copy

Full Screen

1import { Child1 } from 'ng-mocks';2describe('TestComponent', () => {3 it('should create', () => {4 expect(Child1).toBeDefined();5 });6});

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run ng-mocks automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful