From 45b2bd37037c605727ad5783f2f2a438dc19cac4 Mon Sep 17 00:00:00 2001 From: Diego Muracciole Date: Sun, 14 Jan 2024 20:56:25 +0100 Subject: [PATCH] fix: linting (#2479) * fix: linting * chore: add changeset --- .changeset/gorgeous-dragons-brake.md | 10 + .eslintignore | 1 + .eslintrc.js | 3 +- packages/examples/src/fractals/Fractal.js | 1 - packages/examples/src/fractals/index.js | 1 - packages/examples/src/goTo/index.js | 4 - packages/examples/src/index.js | 4 +- packages/examples/src/knobs/index.js | 1 - packages/examples/src/mediaQueries/index.js | 1 - packages/examples/src/pageWrap/index.js | 1 - packages/examples/src/resume/Education.js | 1 - packages/examples/src/resume/Experience.js | 7 +- packages/examples/src/resume/Header.js | 2 - packages/examples/src/resume/List.js | 1 - packages/examples/src/resume/Skills.js | 7 +- packages/examples/src/resume/Title.js | 1 - packages/examples/src/resume/index.js | 1 - packages/examples/src/svg/Heart.js | 2 - packages/examples/src/svg/Svg1.js | 1 - packages/examples/src/svg/Svg2.js | 1 - packages/examples/src/svg/Svg4.js | 1 - packages/examples/src/svg/svg.js | 1 - packages/examples/src/text/index.js | 1 - packages/image/src/png.js | 2 +- .../layout/src/steps/resolvePagination.js | 1 + packages/pdfkit/src/font/afm.js | 3 + packages/pdfkit/src/font/embedded.js | 6 +- packages/textkit/src/attributedString/copy.js | 14 - packages/yoga/tests/minMaxDimension.test.js | 998 ++++++------- packages/yoga/tests/percentage.test.js | 1142 +++++++-------- packages/yoga/tests/rounding.test.js | 1286 ++++++++--------- packages/yoga/tests/sizeOverflow.test.js | 138 +- 32 files changed, 1809 insertions(+), 1835 deletions(-) create mode 100644 .changeset/gorgeous-dragons-brake.md delete mode 100644 packages/textkit/src/attributedString/copy.js diff --git a/.changeset/gorgeous-dragons-brake.md b/.changeset/gorgeous-dragons-brake.md new file mode 100644 index 000000000..05db1545e --- /dev/null +++ b/.changeset/gorgeous-dragons-brake.md @@ -0,0 +1,10 @@ +--- +'@react-pdf/examples': patch +'@react-pdf/textkit': patch +'@react-pdf/layout': patch +'@react-pdf/pdfkit': patch +'@react-pdf/image': patch +'@react-pdf/yoga': patch +--- + +fix linting diff --git a/.eslintignore b/.eslintignore index 36d1f5a39..6e2d7a582 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,3 +2,4 @@ node_modules lib rollup.config.js +packages/yoga/dist diff --git a/.eslintrc.js b/.eslintrc.js index ba5c358e3..409dc1a06 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -27,6 +27,7 @@ module.exports = { }, plugins: ['react', 'jest'], rules: { + 'func-names': 0, 'no-continue': 1, 'no-cond-assign': 1, 'react/prop-types': 0, @@ -37,7 +38,7 @@ module.exports = { 'import/no-named-as-default': 0, 'react/state-in-constructor': 0, 'react/jsx-filename-extension': 0, - 'react/jsx-props-no-spreading': 1, + 'react/jsx-props-no-spreading': 0, 'react/destructuring-assignment': 0, }, }; diff --git a/packages/examples/src/fractals/Fractal.js b/packages/examples/src/fractals/Fractal.js index f18b56942..8f27151a2 100644 --- a/packages/examples/src/fractals/Fractal.js +++ b/packages/examples/src/fractals/Fractal.js @@ -1,4 +1,3 @@ -import React from 'react'; import { Text, View, StyleSheet } from '@react-pdf/renderer'; const palette = [ diff --git a/packages/examples/src/fractals/index.js b/packages/examples/src/fractals/index.js index 3aabcdbad..700c8dea4 100644 --- a/packages/examples/src/fractals/index.js +++ b/packages/examples/src/fractals/index.js @@ -1,4 +1,3 @@ -import React from 'react'; import { Page, Document } from '@react-pdf/renderer'; import Fractal from './Fractal'; diff --git a/packages/examples/src/goTo/index.js b/packages/examples/src/goTo/index.js index 095f85905..3aa8688a3 100644 --- a/packages/examples/src/goTo/index.js +++ b/packages/examples/src/goTo/index.js @@ -1,7 +1,3 @@ -/* eslint react/prop-types: 0, react/jsx-sort-props: 0 */ - -import React from 'react'; - import { Page, Document, Link, View, Image } from '@react-pdf/renderer'; export default () => ( diff --git a/packages/examples/src/index.js b/packages/examples/src/index.js index b7a1b97d1..ceeb408d3 100644 --- a/packages/examples/src/index.js +++ b/packages/examples/src/index.js @@ -1,6 +1,4 @@ -import './index.css'; - -import React, { useState } from 'react'; +import { useState } from 'react'; import ReactDOM from 'react-dom'; import { PDFViewer } from '@react-pdf/renderer'; diff --git a/packages/examples/src/knobs/index.js b/packages/examples/src/knobs/index.js index 75b211105..541f20f71 100644 --- a/packages/examples/src/knobs/index.js +++ b/packages/examples/src/knobs/index.js @@ -1,4 +1,3 @@ -import React from 'react'; import { Document, Page, View, Text, StyleSheet } from '@react-pdf/renderer'; const styles = StyleSheet.create({ diff --git a/packages/examples/src/mediaQueries/index.js b/packages/examples/src/mediaQueries/index.js index faeae617b..a1b035281 100644 --- a/packages/examples/src/mediaQueries/index.js +++ b/packages/examples/src/mediaQueries/index.js @@ -1,4 +1,3 @@ -import React from 'react'; import { Document, Page, View, StyleSheet } from '@react-pdf/renderer'; const styles = StyleSheet.create({ diff --git a/packages/examples/src/pageWrap/index.js b/packages/examples/src/pageWrap/index.js index ea75690fd..b120349c0 100644 --- a/packages/examples/src/pageWrap/index.js +++ b/packages/examples/src/pageWrap/index.js @@ -1,4 +1,3 @@ -import React from 'react'; import { Document, Font, diff --git a/packages/examples/src/resume/Education.js b/packages/examples/src/resume/Education.js index 08bffe3f9..96f512ceb 100644 --- a/packages/examples/src/resume/Education.js +++ b/packages/examples/src/resume/Education.js @@ -1,4 +1,3 @@ -import React from 'react'; import { Text, View, StyleSheet } from '@react-pdf/renderer'; import Title from './Title'; diff --git a/packages/examples/src/resume/Experience.js b/packages/examples/src/resume/Experience.js index f77649d78..41cb9f64e 100644 --- a/packages/examples/src/resume/Experience.js +++ b/packages/examples/src/resume/Experience.js @@ -1,6 +1,3 @@ -/* eslint-disable react/no-array-index-key */ - -import React from 'react'; import { Text, View, StyleSheet } from '@react-pdf/renderer'; import Title from './Title'; @@ -77,8 +74,8 @@ const ExperienceEntry = ({ company, details, position, date }) => { - {details.map((detail, i) => ( - + {details.map(detail => ( + {detail} ))} diff --git a/packages/examples/src/resume/Header.js b/packages/examples/src/resume/Header.js index 195e5c615..1cd252ffc 100644 --- a/packages/examples/src/resume/Header.js +++ b/packages/examples/src/resume/Header.js @@ -1,5 +1,3 @@ -import React from 'react'; - import { Link, Text, View, StyleSheet } from '@react-pdf/renderer'; const styles = StyleSheet.create({ diff --git a/packages/examples/src/resume/List.js b/packages/examples/src/resume/List.js index 65cdb5015..791978fb6 100644 --- a/packages/examples/src/resume/List.js +++ b/packages/examples/src/resume/List.js @@ -1,4 +1,3 @@ -import React from 'react'; import { Text, View, StyleSheet } from '@react-pdf/renderer'; const styles = StyleSheet.create({ diff --git a/packages/examples/src/resume/Skills.js b/packages/examples/src/resume/Skills.js index 896d9fcc7..e5869755f 100644 --- a/packages/examples/src/resume/Skills.js +++ b/packages/examples/src/resume/Skills.js @@ -1,6 +1,3 @@ -/* eslint-disable react/no-array-index-key */ - -import React from 'react'; import { Text, View, StyleSheet } from '@react-pdf/renderer'; import Title from './Title'; @@ -23,8 +20,8 @@ const SkillEntry = ({ name, skills }) => ( {name} - {skills.map((skill, i) => ( - {skill} + {skills.map(skill => ( + {skill} ))} diff --git a/packages/examples/src/resume/Title.js b/packages/examples/src/resume/Title.js index a3c71e500..8b451571e 100644 --- a/packages/examples/src/resume/Title.js +++ b/packages/examples/src/resume/Title.js @@ -1,4 +1,3 @@ -import React from 'react'; import { Text, StyleSheet } from '@react-pdf/renderer'; const styles = StyleSheet.create({ diff --git a/packages/examples/src/resume/index.js b/packages/examples/src/resume/index.js index 9173840f3..c327b48ee 100644 --- a/packages/examples/src/resume/index.js +++ b/packages/examples/src/resume/index.js @@ -1,4 +1,3 @@ -import React from 'react'; import { Text, Font, diff --git a/packages/examples/src/svg/Heart.js b/packages/examples/src/svg/Heart.js index e0bddde35..76b9eec2f 100644 --- a/packages/examples/src/svg/Heart.js +++ b/packages/examples/src/svg/Heart.js @@ -1,5 +1,3 @@ -import React from 'react'; - import { Svg, G, Path } from '@react-pdf/renderer'; const Heart = () => ( diff --git a/packages/examples/src/svg/Svg1.js b/packages/examples/src/svg/Svg1.js index 1bd9ad10d..971f43604 100644 --- a/packages/examples/src/svg/Svg1.js +++ b/packages/examples/src/svg/Svg1.js @@ -1,4 +1,3 @@ -import React from 'react'; import { Rect, Svg, G, Path, Text, Tspan } from '@react-pdf/renderer'; const Svg1 = () => ( diff --git a/packages/examples/src/svg/Svg2.js b/packages/examples/src/svg/Svg2.js index 25e48022f..36acaeef1 100644 --- a/packages/examples/src/svg/Svg2.js +++ b/packages/examples/src/svg/Svg2.js @@ -1,4 +1,3 @@ -import React from 'react'; import { Rect, Svg, diff --git a/packages/examples/src/svg/Svg4.js b/packages/examples/src/svg/Svg4.js index 8a33ba7e1..9ac55ac9c 100644 --- a/packages/examples/src/svg/Svg4.js +++ b/packages/examples/src/svg/Svg4.js @@ -1,4 +1,3 @@ -import React from 'react'; import { Svg, Stop, diff --git a/packages/examples/src/svg/svg.js b/packages/examples/src/svg/svg.js index aa753db6f..d185b018c 100644 --- a/packages/examples/src/svg/svg.js +++ b/packages/examples/src/svg/svg.js @@ -1,4 +1,3 @@ -import React from 'react'; import { Svg, G, Polygon } from '@react-pdf/renderer'; const Tiger = () => ( diff --git a/packages/examples/src/text/index.js b/packages/examples/src/text/index.js index 9663d2e18..55e10ca4a 100644 --- a/packages/examples/src/text/index.js +++ b/packages/examples/src/text/index.js @@ -1,6 +1,5 @@ /* eslint-disable jsx-a11y/anchor-is-valid */ -import React from 'react'; import { Document, Page, diff --git a/packages/image/src/png.js b/packages/image/src/png.js index b37bf6d8d..367d88c4c 100644 --- a/packages/image/src/png.js +++ b/packages/image/src/png.js @@ -1,6 +1,6 @@ import PNG from '@react-pdf/png-js'; -PNG.isValid = function(data) { +PNG.isValid = function isValid(data) { try { return !!new PNG(data); } catch (e) { diff --git a/packages/layout/src/steps/resolvePagination.js b/packages/layout/src/steps/resolvePagination.js index c4a84903e..aa3a3f601 100644 --- a/packages/layout/src/steps/resolvePagination.js +++ b/packages/layout/src/steps/resolvePagination.js @@ -1,3 +1,4 @@ +/* eslint-disable no-use-before-define */ /* eslint-disable no-continue */ /* eslint-disable prefer-destructuring */ diff --git a/packages/pdfkit/src/font/afm.js b/packages/pdfkit/src/font/afm.js index 25b3a4bf2..7fcbe86ea 100644 --- a/packages/pdfkit/src/font/afm.js +++ b/packages/pdfkit/src/font/afm.js @@ -1,3 +1,6 @@ +/* eslint-disable no-var */ +/* eslint-disable no-cond-assign */ + import fs from 'fs'; import range from '../utils/range'; diff --git a/packages/pdfkit/src/font/embedded.js b/packages/pdfkit/src/font/embedded.js index e1355bfbd..ee2f6f4d1 100644 --- a/packages/pdfkit/src/font/embedded.js +++ b/packages/pdfkit/src/font/embedded.js @@ -1,3 +1,5 @@ +/* eslint-disable no-cond-assign */ +// eslint-disable-next-line no-unused-vars import PDFObject from '../object'; const toHex = function(...codePoints) { @@ -77,7 +79,7 @@ const createEmbeddedFont = PDFFont => let last = 0; let index = 0; while (index <= text.length) { - var needle; + let needle; if ( (index === text.length && last < index) || ((needle = text.charAt(index)), [' ', '\t'].includes(needle)) @@ -177,7 +179,7 @@ const createEmbeddedFont = PDFFont => // generate a random tag (6 uppercase letters. 65 is the char code for 'A') const tag = [0, 1, 2, 3, 4, 5] - .map(i => String.fromCharCode(Math.random() * 26 + 65)) + .map(() => String.fromCharCode(Math.random() * 26 + 65)) .join(''); const name = tag + '+' + this.font.postscriptName; diff --git a/packages/textkit/src/attributedString/copy.js b/packages/textkit/src/attributedString/copy.js deleted file mode 100644 index d2c587eb6..000000000 --- a/packages/textkit/src/attributedString/copy.js +++ /dev/null @@ -1,14 +0,0 @@ -import copyRun from '../run/copy'; - -/** - * Deep clone attributed string - * - * @param {Object} attributed string - * @return {Object} cloned attributed string - */ -const copy = attributeString => { - const runs = attributeString.runs.map(copyRun); - return Object.assign({}, attributeString, { runs }); -}; - -export default copy; diff --git a/packages/yoga/tests/minMaxDimension.test.js b/packages/yoga/tests/minMaxDimension.test.js index e02c9eba9..3fd862844 100644 --- a/packages/yoga/tests/minMaxDimension.test.js +++ b/packages/yoga/tests/minMaxDimension.test.js @@ -1,15 +1,15 @@ const Yoga = require('..'); -describe("Min max dimensions", () => { +describe('Min max dimensions', () => { test('max_width', () => { const root = Yoga.Node.create(); root.setWidth(100); root.setHeight(100); - const root_child0 = Yoga.Node.create(); - root_child0.setMaxWidth(50); - root_child0.setHeight(10); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setMaxWidth(50); + rootChild0.setHeight(10); + root.insertChild(rootChild0, 0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -17,10 +17,10 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(50); - expect(root_child0.getComputedLayout().height).toBe(10); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(50); + expect(rootChild0.getComputedLayout().height).toBe(10); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -29,10 +29,10 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(50); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(50); - expect(root_child0.getComputedLayout().height).toBe(10); + expect(rootChild0.getComputedLayout().left).toBe(50); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(50); + expect(rootChild0.getComputedLayout().height).toBe(10); }); test('max_height', () => { @@ -41,10 +41,10 @@ describe("Min max dimensions", () => { root.setWidth(100); root.setHeight(100); - const root_child0 = Yoga.Node.create(); - root_child0.setWidth(10); - root_child0.setMaxHeight(50); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setWidth(10); + rootChild0.setMaxHeight(50); + root.insertChild(rootChild0, 0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -52,10 +52,10 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(10); - expect(root_child0.getComputedLayout().height).toBe(50); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(10); + expect(rootChild0.getComputedLayout().height).toBe(50); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -64,10 +64,10 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(90); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(10); - expect(root_child0.getComputedLayout().height).toBe(50); + expect(rootChild0.getComputedLayout().left).toBe(90); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(10); + expect(rootChild0.getComputedLayout().height).toBe(50); }); test('min_height', () => { @@ -75,14 +75,14 @@ describe("Min max dimensions", () => { root.setWidth(100); root.setHeight(100); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setMinHeight(60); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setMinHeight(60); + root.insertChild(rootChild0, 0); - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(1); - root.insertChild(root_child1, 1); + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(1); + root.insertChild(rootChild1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -90,15 +90,15 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(100); - expect(root_child0.getComputedLayout().height).toBe(80); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(100); + expect(rootChild0.getComputedLayout().height).toBe(80); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(80); - expect(root_child1.getComputedLayout().width).toBe(100); - expect(root_child1.getComputedLayout().height).toBe(20); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(80); + expect(rootChild1.getComputedLayout().width).toBe(100); + expect(rootChild1.getComputedLayout().height).toBe(20); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -107,15 +107,15 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(100); - expect(root_child0.getComputedLayout().height).toBe(80); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(100); + expect(rootChild0.getComputedLayout().height).toBe(80); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(80); - expect(root_child1.getComputedLayout().width).toBe(100); - expect(root_child1.getComputedLayout().height).toBe(20); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(80); + expect(rootChild1.getComputedLayout().width).toBe(100); + expect(rootChild1.getComputedLayout().height).toBe(20); }); test('min_width', () => { @@ -124,14 +124,14 @@ describe("Min max dimensions", () => { root.setWidth(100); root.setHeight(100); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setMinWidth(60); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setMinWidth(60); + root.insertChild(rootChild0, 0); - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(1); - root.insertChild(root_child1, 1); + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(1); + root.insertChild(rootChild1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -139,15 +139,15 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(80); - expect(root_child0.getComputedLayout().height).toBe(100); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(80); + expect(rootChild0.getComputedLayout().height).toBe(100); - expect(root_child1.getComputedLayout().left).toBe(80); - expect(root_child1.getComputedLayout().top).toBe(0); - expect(root_child1.getComputedLayout().width).toBe(20); - expect(root_child1.getComputedLayout().height).toBe(100); + expect(rootChild1.getComputedLayout().left).toBe(80); + expect(rootChild1.getComputedLayout().top).toBe(0); + expect(rootChild1.getComputedLayout().width).toBe(20); + expect(rootChild1.getComputedLayout().height).toBe(100); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -156,15 +156,15 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(20); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(80); - expect(root_child0.getComputedLayout().height).toBe(100); + expect(rootChild0.getComputedLayout().left).toBe(20); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(80); + expect(rootChild0.getComputedLayout().height).toBe(100); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(0); - expect(root_child1.getComputedLayout().width).toBe(20); - expect(root_child1.getComputedLayout().height).toBe(100); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(0); + expect(rootChild1.getComputedLayout().width).toBe(20); + expect(rootChild1.getComputedLayout().height).toBe(100); }); test('justify_content_min_max', () => { @@ -174,10 +174,10 @@ describe("Min max dimensions", () => { root.setMinHeight(100); root.setMaxHeight(200); - const root_child0 = Yoga.Node.create(); - root_child0.setWidth(60); - root_child0.setHeight(60); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setWidth(60); + rootChild0.setHeight(60); + root.insertChild(rootChild0, 0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -185,10 +185,10 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(20); - expect(root_child0.getComputedLayout().width).toBe(60); - expect(root_child0.getComputedLayout().height).toBe(60); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(20); + expect(rootChild0.getComputedLayout().width).toBe(60); + expect(rootChild0.getComputedLayout().height).toBe(60); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -197,10 +197,10 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(40); - expect(root_child0.getComputedLayout().top).toBe(20); - expect(root_child0.getComputedLayout().width).toBe(60); - expect(root_child0.getComputedLayout().height).toBe(60); + expect(rootChild0.getComputedLayout().left).toBe(40); + expect(rootChild0.getComputedLayout().top).toBe(20); + expect(rootChild0.getComputedLayout().width).toBe(60); + expect(rootChild0.getComputedLayout().height).toBe(60); }); test('align_items_min_max', () => { @@ -210,10 +210,10 @@ describe("Min max dimensions", () => { root.setMaxWidth(200); root.setHeight(100); - const root_child0 = Yoga.Node.create(); - root_child0.setWidth(60); - root_child0.setHeight(60); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setWidth(60); + rootChild0.setHeight(60); + root.insertChild(rootChild0, 0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -221,10 +221,10 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(20); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(60); - expect(root_child0.getComputedLayout().height).toBe(60); + expect(rootChild0.getComputedLayout().left).toBe(20); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(60); + expect(rootChild0.getComputedLayout().height).toBe(60); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -233,10 +233,10 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(20); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(60); - expect(root_child0.getComputedLayout().height).toBe(60); + expect(rootChild0.getComputedLayout().left).toBe(20); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(60); + expect(rootChild0.getComputedLayout().height).toBe(60); }); test('justify_content_overflow_min_max', () => { @@ -245,20 +245,20 @@ describe("Min max dimensions", () => { root.setMinHeight(100); root.setMaxHeight(110); - const root_child0 = Yoga.Node.create(); - root_child0.setWidth(50); - root_child0.setHeight(50); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setWidth(50); + rootChild0.setHeight(50); + root.insertChild(rootChild0, 0); - const root_child1 = Yoga.Node.create(); - root_child1.setWidth(50); - root_child1.setHeight(50); - root.insertChild(root_child1, 1); + const rootChild1 = Yoga.Node.create(); + rootChild1.setWidth(50); + rootChild1.setHeight(50); + root.insertChild(rootChild1, 1); - const root_child2 = Yoga.Node.create(); - root_child2.setWidth(50); - root_child2.setHeight(50); - root.insertChild(root_child2, 2); + const rootChild2 = Yoga.Node.create(); + rootChild2.setWidth(50); + rootChild2.setHeight(50); + root.insertChild(rootChild2, 2); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -266,20 +266,20 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(50); expect(root.getComputedLayout().height).toBe(110); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(-20); - expect(root_child0.getComputedLayout().width).toBe(50); - expect(root_child0.getComputedLayout().height).toBe(50); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(-20); + expect(rootChild0.getComputedLayout().width).toBe(50); + expect(rootChild0.getComputedLayout().height).toBe(50); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(30); - expect(root_child1.getComputedLayout().width).toBe(50); - expect(root_child1.getComputedLayout().height).toBe(50); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(30); + expect(rootChild1.getComputedLayout().width).toBe(50); + expect(rootChild1.getComputedLayout().height).toBe(50); - expect(root_child2.getComputedLayout().left).toBe(0); - expect(root_child2.getComputedLayout().top).toBe(80); - expect(root_child2.getComputedLayout().width).toBe(50); - expect(root_child2.getComputedLayout().height).toBe(50); + expect(rootChild2.getComputedLayout().left).toBe(0); + expect(rootChild2.getComputedLayout().top).toBe(80); + expect(rootChild2.getComputedLayout().width).toBe(50); + expect(rootChild2.getComputedLayout().height).toBe(50); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -288,20 +288,20 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(50); expect(root.getComputedLayout().height).toBe(110); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(-20); - expect(root_child0.getComputedLayout().width).toBe(50); - expect(root_child0.getComputedLayout().height).toBe(50); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(-20); + expect(rootChild0.getComputedLayout().width).toBe(50); + expect(rootChild0.getComputedLayout().height).toBe(50); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(30); - expect(root_child1.getComputedLayout().width).toBe(50); - expect(root_child1.getComputedLayout().height).toBe(50); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(30); + expect(rootChild1.getComputedLayout().width).toBe(50); + expect(rootChild1.getComputedLayout().height).toBe(50); - expect(root_child2.getComputedLayout().left).toBe(0); - expect(root_child2.getComputedLayout().top).toBe(80); - expect(root_child2.getComputedLayout().width).toBe(50); - expect(root_child2.getComputedLayout().height).toBe(50); + expect(rootChild2.getComputedLayout().left).toBe(0); + expect(rootChild2.getComputedLayout().top).toBe(80); + expect(rootChild2.getComputedLayout().width).toBe(50); + expect(rootChild2.getComputedLayout().height).toBe(50); }); test('flex_grow_to_min', () => { @@ -310,14 +310,14 @@ describe("Min max dimensions", () => { root.setMinHeight(100); root.setMaxHeight(500); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setFlexShrink(1); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setFlexShrink(1); + root.insertChild(rootChild0, 0); - const root_child1 = Yoga.Node.create(); - root_child1.setHeight(50); - root.insertChild(root_child1, 1); + const rootChild1 = Yoga.Node.create(); + rootChild1.setHeight(50); + root.insertChild(rootChild1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -325,15 +325,15 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(100); - expect(root_child0.getComputedLayout().height).toBe(50); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(100); + expect(rootChild0.getComputedLayout().height).toBe(50); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(50); - expect(root_child1.getComputedLayout().width).toBe(100); - expect(root_child1.getComputedLayout().height).toBe(50); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(50); + expect(rootChild1.getComputedLayout().width).toBe(100); + expect(rootChild1.getComputedLayout().height).toBe(50); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -342,15 +342,15 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(100); - expect(root_child0.getComputedLayout().height).toBe(50); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(100); + expect(rootChild0.getComputedLayout().height).toBe(50); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(50); - expect(root_child1.getComputedLayout().width).toBe(100); - expect(root_child1.getComputedLayout().height).toBe(50); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(50); + expect(rootChild1.getComputedLayout().width).toBe(100); + expect(rootChild1.getComputedLayout().height).toBe(50); }); test('flex_grow_in_at_most_container', () => { @@ -360,14 +360,14 @@ describe("Min max dimensions", () => { root.setWidth(100); root.setHeight(100); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + root.insertChild(rootChild0, 0); - const root_child0_child0 = Yoga.Node.create(); - root_child0_child0.setFlexGrow(1); - root_child0_child0.setFlexBasis(0); - root_child0.insertChild(root_child0_child0, 0); + const rootChild0Child0 = Yoga.Node.create(); + rootChild0Child0.setFlexGrow(1); + rootChild0Child0.setFlexBasis(0); + rootChild0.insertChild(rootChild0Child0, 0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -375,15 +375,15 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(0); - expect(root_child0.getComputedLayout().height).toBe(0); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(0); + expect(rootChild0.getComputedLayout().height).toBe(0); - expect(root_child0_child0.getComputedLayout().left).toBe(0); - expect(root_child0_child0.getComputedLayout().top).toBe(0); - expect(root_child0_child0.getComputedLayout().width).toBe(0); - expect(root_child0_child0.getComputedLayout().height).toBe(0); + expect(rootChild0Child0.getComputedLayout().left).toBe(0); + expect(rootChild0Child0.getComputedLayout().top).toBe(0); + expect(rootChild0Child0.getComputedLayout().width).toBe(0); + expect(rootChild0Child0.getComputedLayout().height).toBe(0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -392,26 +392,26 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(100); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(0); - expect(root_child0.getComputedLayout().height).toBe(0); + expect(rootChild0.getComputedLayout().left).toBe(100); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(0); + expect(rootChild0.getComputedLayout().height).toBe(0); - expect(root_child0_child0.getComputedLayout().left).toBe(0); - expect(root_child0_child0.getComputedLayout().top).toBe(0); - expect(root_child0_child0.getComputedLayout().width).toBe(0); - expect(root_child0_child0.getComputedLayout().height).toBe(0); + expect(rootChild0Child0.getComputedLayout().left).toBe(0); + expect(rootChild0Child0.getComputedLayout().top).toBe(0); + expect(rootChild0Child0.getComputedLayout().width).toBe(0); + expect(rootChild0Child0.getComputedLayout().height).toBe(0); }); test('flex_grow_child', () => { const root = Yoga.Node.create(); root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setFlexBasis(0); - root_child0.setHeight(100); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setFlexBasis(0); + rootChild0.setHeight(100); + root.insertChild(rootChild0, 0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -419,10 +419,10 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(0); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(0); - expect(root_child0.getComputedLayout().height).toBe(100); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(0); + expect(rootChild0.getComputedLayout().height).toBe(100); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -431,10 +431,10 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(0); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(0); - expect(root_child0.getComputedLayout().height).toBe(100); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(0); + expect(rootChild0.getComputedLayout().height).toBe(100); }); test('flex_grow_within_constrained_min_max_column', () => { @@ -442,13 +442,13 @@ describe("Min max dimensions", () => { root.setMinHeight(100); root.setMaxHeight(200); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + root.insertChild(rootChild0, 0); - const root_child1 = Yoga.Node.create(); - root_child1.setHeight(50); - root.insertChild(root_child1, 1); + const rootChild1 = Yoga.Node.create(); + rootChild1.setHeight(50); + root.insertChild(rootChild1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -456,15 +456,15 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(0); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(0); - expect(root_child0.getComputedLayout().height).toBe(50); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(0); + expect(rootChild0.getComputedLayout().height).toBe(50); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(50); - expect(root_child1.getComputedLayout().width).toBe(0); - expect(root_child1.getComputedLayout().height).toBe(50); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(50); + expect(rootChild1.getComputedLayout().width).toBe(0); + expect(rootChild1.getComputedLayout().height).toBe(50); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -473,15 +473,15 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(0); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(0); - expect(root_child0.getComputedLayout().height).toBe(50); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(0); + expect(rootChild0.getComputedLayout().height).toBe(50); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(50); - expect(root_child1.getComputedLayout().width).toBe(0); - expect(root_child1.getComputedLayout().height).toBe(50); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(50); + expect(rootChild1.getComputedLayout().width).toBe(0); + expect(rootChild1.getComputedLayout().height).toBe(50); }); test('flex_grow_within_max_width', () => { @@ -489,15 +489,15 @@ describe("Min max dimensions", () => { root.setWidth(200); root.setHeight(100); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0.setMaxWidth(100); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + rootChild0.setMaxWidth(100); + root.insertChild(rootChild0, 0); - const root_child0_child0 = Yoga.Node.create(); - root_child0_child0.setFlexGrow(1); - root_child0_child0.setHeight(20); - root_child0.insertChild(root_child0_child0, 0); + const rootChild0Child0 = Yoga.Node.create(); + rootChild0Child0.setFlexGrow(1); + rootChild0Child0.setHeight(20); + rootChild0.insertChild(rootChild0Child0, 0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -505,15 +505,15 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(100); - expect(root_child0.getComputedLayout().height).toBe(20); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(100); + expect(rootChild0.getComputedLayout().height).toBe(20); - expect(root_child0_child0.getComputedLayout().left).toBe(0); - expect(root_child0_child0.getComputedLayout().top).toBe(0); - expect(root_child0_child0.getComputedLayout().width).toBe(100); - expect(root_child0_child0.getComputedLayout().height).toBe(20); + expect(rootChild0Child0.getComputedLayout().left).toBe(0); + expect(rootChild0Child0.getComputedLayout().top).toBe(0); + expect(rootChild0Child0.getComputedLayout().width).toBe(100); + expect(rootChild0Child0.getComputedLayout().height).toBe(20); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -522,15 +522,15 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(100); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(100); - expect(root_child0.getComputedLayout().height).toBe(20); + expect(rootChild0.getComputedLayout().left).toBe(100); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(100); + expect(rootChild0.getComputedLayout().height).toBe(20); - expect(root_child0_child0.getComputedLayout().left).toBe(0); - expect(root_child0_child0.getComputedLayout().top).toBe(0); - expect(root_child0_child0.getComputedLayout().width).toBe(100); - expect(root_child0_child0.getComputedLayout().height).toBe(20); + expect(rootChild0Child0.getComputedLayout().left).toBe(0); + expect(rootChild0Child0.getComputedLayout().top).toBe(0); + expect(rootChild0Child0.getComputedLayout().width).toBe(100); + expect(rootChild0Child0.getComputedLayout().height).toBe(20); }); test('flex_grow_within_constrained_max_width', () => { @@ -538,15 +538,15 @@ describe("Min max dimensions", () => { root.setWidth(200); root.setHeight(100); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0.setMaxWidth(300); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + rootChild0.setMaxWidth(300); + root.insertChild(rootChild0, 0); - const root_child0_child0 = Yoga.Node.create(); - root_child0_child0.setFlexGrow(1); - root_child0_child0.setHeight(20); - root_child0.insertChild(root_child0_child0, 0); + const rootChild0Child0 = Yoga.Node.create(); + rootChild0Child0.setFlexGrow(1); + rootChild0Child0.setHeight(20); + rootChild0.insertChild(rootChild0Child0, 0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -554,15 +554,15 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(200); - expect(root_child0.getComputedLayout().height).toBe(20); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(200); + expect(rootChild0.getComputedLayout().height).toBe(20); - expect(root_child0_child0.getComputedLayout().left).toBe(0); - expect(root_child0_child0.getComputedLayout().top).toBe(0); - expect(root_child0_child0.getComputedLayout().width).toBe(200); - expect(root_child0_child0.getComputedLayout().height).toBe(20); + expect(rootChild0Child0.getComputedLayout().left).toBe(0); + expect(rootChild0Child0.getComputedLayout().top).toBe(0); + expect(rootChild0Child0.getComputedLayout().width).toBe(200); + expect(rootChild0Child0.getComputedLayout().height).toBe(20); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -571,15 +571,15 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(200); - expect(root_child0.getComputedLayout().height).toBe(20); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(200); + expect(rootChild0.getComputedLayout().height).toBe(20); - expect(root_child0_child0.getComputedLayout().left).toBe(0); - expect(root_child0_child0.getComputedLayout().top).toBe(0); - expect(root_child0_child0.getComputedLayout().width).toBe(200); - expect(root_child0_child0.getComputedLayout().height).toBe(20); + expect(rootChild0Child0.getComputedLayout().left).toBe(0); + expect(rootChild0Child0.getComputedLayout().top).toBe(0); + expect(rootChild0Child0.getComputedLayout().width).toBe(200); + expect(rootChild0Child0.getComputedLayout().height).toBe(20); }); test('flex_root_ignored', () => { @@ -589,14 +589,14 @@ describe("Min max dimensions", () => { root.setMinHeight(100); root.setMaxHeight(500); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setFlexBasis(200); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setFlexBasis(200); + root.insertChild(rootChild0, 0); - const root_child1 = Yoga.Node.create(); - root_child1.setHeight(100); - root.insertChild(root_child1, 1); + const rootChild1 = Yoga.Node.create(); + rootChild1.setHeight(100); + root.insertChild(rootChild1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -604,15 +604,15 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(300); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(100); - expect(root_child0.getComputedLayout().height).toBe(200); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(100); + expect(rootChild0.getComputedLayout().height).toBe(200); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(200); - expect(root_child1.getComputedLayout().width).toBe(100); - expect(root_child1.getComputedLayout().height).toBe(100); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(200); + expect(rootChild1.getComputedLayout().width).toBe(100); + expect(rootChild1.getComputedLayout().height).toBe(100); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -621,15 +621,15 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(300); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(100); - expect(root_child0.getComputedLayout().height).toBe(200); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(100); + expect(rootChild0.getComputedLayout().height).toBe(200); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(200); - expect(root_child1.getComputedLayout().width).toBe(100); - expect(root_child1.getComputedLayout().height).toBe(100); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(200); + expect(rootChild1.getComputedLayout().width).toBe(100); + expect(rootChild1.getComputedLayout().height).toBe(100); }); test('flex_grow_root_minimized', () => { @@ -638,20 +638,20 @@ describe("Min max dimensions", () => { root.setMinHeight(100); root.setMaxHeight(500); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setMinHeight(100); - root_child0.setMaxHeight(500); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setMinHeight(100); + rootChild0.setMaxHeight(500); + root.insertChild(rootChild0, 0); - const root_child0_child0 = Yoga.Node.create(); - root_child0_child0.setFlexGrow(1); - root_child0_child0.setFlexBasis(200); - root_child0.insertChild(root_child0_child0, 0); + const rootChild0Child0 = Yoga.Node.create(); + rootChild0Child0.setFlexGrow(1); + rootChild0Child0.setFlexBasis(200); + rootChild0.insertChild(rootChild0Child0, 0); - const root_child0_child1 = Yoga.Node.create(); - root_child0_child1.setHeight(100); - root_child0.insertChild(root_child0_child1, 1); + const rootChild0Child1 = Yoga.Node.create(); + rootChild0Child1.setHeight(100); + rootChild0.insertChild(rootChild0Child1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -659,20 +659,20 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(300); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(100); - expect(root_child0.getComputedLayout().height).toBe(300); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(100); + expect(rootChild0.getComputedLayout().height).toBe(300); - expect(root_child0_child0.getComputedLayout().left).toBe(0); - expect(root_child0_child0.getComputedLayout().top).toBe(0); - expect(root_child0_child0.getComputedLayout().width).toBe(100); - expect(root_child0_child0.getComputedLayout().height).toBe(200); + expect(rootChild0Child0.getComputedLayout().left).toBe(0); + expect(rootChild0Child0.getComputedLayout().top).toBe(0); + expect(rootChild0Child0.getComputedLayout().width).toBe(100); + expect(rootChild0Child0.getComputedLayout().height).toBe(200); - expect(root_child0_child1.getComputedLayout().left).toBe(0); - expect(root_child0_child1.getComputedLayout().top).toBe(200); - expect(root_child0_child1.getComputedLayout().width).toBe(100); - expect(root_child0_child1.getComputedLayout().height).toBe(100); + expect(rootChild0Child1.getComputedLayout().left).toBe(0); + expect(rootChild0Child1.getComputedLayout().top).toBe(200); + expect(rootChild0Child1.getComputedLayout().width).toBe(100); + expect(rootChild0Child1.getComputedLayout().height).toBe(100); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -681,20 +681,20 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(300); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(100); - expect(root_child0.getComputedLayout().height).toBe(300); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(100); + expect(rootChild0.getComputedLayout().height).toBe(300); - expect(root_child0_child0.getComputedLayout().left).toBe(0); - expect(root_child0_child0.getComputedLayout().top).toBe(0); - expect(root_child0_child0.getComputedLayout().width).toBe(100); - expect(root_child0_child0.getComputedLayout().height).toBe(200); + expect(rootChild0Child0.getComputedLayout().left).toBe(0); + expect(rootChild0Child0.getComputedLayout().top).toBe(0); + expect(rootChild0Child0.getComputedLayout().width).toBe(100); + expect(rootChild0Child0.getComputedLayout().height).toBe(200); - expect(root_child0_child1.getComputedLayout().left).toBe(0); - expect(root_child0_child1.getComputedLayout().top).toBe(200); - expect(root_child0_child1.getComputedLayout().width).toBe(100); - expect(root_child0_child1.getComputedLayout().height).toBe(100); + expect(rootChild0Child1.getComputedLayout().left).toBe(0); + expect(rootChild0Child1.getComputedLayout().top).toBe(200); + expect(rootChild0Child1.getComputedLayout().width).toBe(100); + expect(rootChild0Child1.getComputedLayout().height).toBe(100); }); test('flex_grow_height_maximized', () => { @@ -702,20 +702,20 @@ describe("Min max dimensions", () => { root.setWidth(100); root.setHeight(500); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setMinHeight(100); - root_child0.setMaxHeight(500); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setMinHeight(100); + rootChild0.setMaxHeight(500); + root.insertChild(rootChild0, 0); - const root_child0_child0 = Yoga.Node.create(); - root_child0_child0.setFlexGrow(1); - root_child0_child0.setFlexBasis(200); - root_child0.insertChild(root_child0_child0, 0); + const rootChild0Child0 = Yoga.Node.create(); + rootChild0Child0.setFlexGrow(1); + rootChild0Child0.setFlexBasis(200); + rootChild0.insertChild(rootChild0Child0, 0); - const root_child0_child1 = Yoga.Node.create(); - root_child0_child1.setHeight(100); - root_child0.insertChild(root_child0_child1, 1); + const rootChild0Child1 = Yoga.Node.create(); + rootChild0Child1.setHeight(100); + rootChild0.insertChild(rootChild0Child1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -723,20 +723,20 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(500); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(100); - expect(root_child0.getComputedLayout().height).toBe(500); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(100); + expect(rootChild0.getComputedLayout().height).toBe(500); - expect(root_child0_child0.getComputedLayout().left).toBe(0); - expect(root_child0_child0.getComputedLayout().top).toBe(0); - expect(root_child0_child0.getComputedLayout().width).toBe(100); - expect(root_child0_child0.getComputedLayout().height).toBe(400); + expect(rootChild0Child0.getComputedLayout().left).toBe(0); + expect(rootChild0Child0.getComputedLayout().top).toBe(0); + expect(rootChild0Child0.getComputedLayout().width).toBe(100); + expect(rootChild0Child0.getComputedLayout().height).toBe(400); - expect(root_child0_child1.getComputedLayout().left).toBe(0); - expect(root_child0_child1.getComputedLayout().top).toBe(400); - expect(root_child0_child1.getComputedLayout().width).toBe(100); - expect(root_child0_child1.getComputedLayout().height).toBe(100); + expect(rootChild0Child1.getComputedLayout().left).toBe(0); + expect(rootChild0Child1.getComputedLayout().top).toBe(400); + expect(rootChild0Child1.getComputedLayout().width).toBe(100); + expect(rootChild0Child1.getComputedLayout().height).toBe(100); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -745,20 +745,20 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(500); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(100); - expect(root_child0.getComputedLayout().height).toBe(500); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(100); + expect(rootChild0.getComputedLayout().height).toBe(500); - expect(root_child0_child0.getComputedLayout().left).toBe(0); - expect(root_child0_child0.getComputedLayout().top).toBe(0); - expect(root_child0_child0.getComputedLayout().width).toBe(100); - expect(root_child0_child0.getComputedLayout().height).toBe(400); + expect(rootChild0Child0.getComputedLayout().left).toBe(0); + expect(rootChild0Child0.getComputedLayout().top).toBe(0); + expect(rootChild0Child0.getComputedLayout().width).toBe(100); + expect(rootChild0Child0.getComputedLayout().height).toBe(400); - expect(root_child0_child1.getComputedLayout().left).toBe(0); - expect(root_child0_child1.getComputedLayout().top).toBe(400); - expect(root_child0_child1.getComputedLayout().width).toBe(100); - expect(root_child0_child1.getComputedLayout().height).toBe(100); + expect(rootChild0Child1.getComputedLayout().left).toBe(0); + expect(rootChild0Child1.getComputedLayout().top).toBe(400); + expect(rootChild0Child1.getComputedLayout().width).toBe(100); + expect(rootChild0Child1.getComputedLayout().height).toBe(100); }); test('flex_grow_within_constrained_min_row', () => { @@ -767,13 +767,13 @@ describe("Min max dimensions", () => { root.setMinWidth(100); root.setHeight(100); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + root.insertChild(rootChild0, 0); - const root_child1 = Yoga.Node.create(); - root_child1.setWidth(50); - root.insertChild(root_child1, 1); + const rootChild1 = Yoga.Node.create(); + rootChild1.setWidth(50); + root.insertChild(rootChild1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -781,15 +781,15 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(50); - expect(root_child0.getComputedLayout().height).toBe(100); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(50); + expect(rootChild0.getComputedLayout().height).toBe(100); - expect(root_child1.getComputedLayout().left).toBe(50); - expect(root_child1.getComputedLayout().top).toBe(0); - expect(root_child1.getComputedLayout().width).toBe(50); - expect(root_child1.getComputedLayout().height).toBe(100); + expect(rootChild1.getComputedLayout().left).toBe(50); + expect(rootChild1.getComputedLayout().top).toBe(0); + expect(rootChild1.getComputedLayout().width).toBe(50); + expect(rootChild1.getComputedLayout().height).toBe(100); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -798,28 +798,28 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(50); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(50); - expect(root_child0.getComputedLayout().height).toBe(100); + expect(rootChild0.getComputedLayout().left).toBe(50); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(50); + expect(rootChild0.getComputedLayout().height).toBe(100); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(0); - expect(root_child1.getComputedLayout().width).toBe(50); - expect(root_child1.getComputedLayout().height).toBe(100); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(0); + expect(rootChild1.getComputedLayout().width).toBe(50); + expect(rootChild1.getComputedLayout().height).toBe(100); }); test('flex_grow_within_constrained_min_column', () => { const root = Yoga.Node.create(); root.setMinHeight(100); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + root.insertChild(rootChild0, 0); - const root_child1 = Yoga.Node.create(); - root_child1.setHeight(50); - root.insertChild(root_child1, 1); + const rootChild1 = Yoga.Node.create(); + rootChild1.setHeight(50); + root.insertChild(rootChild1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -827,15 +827,15 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(0); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(0); - expect(root_child0.getComputedLayout().height).toBe(50); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(0); + expect(rootChild0.getComputedLayout().height).toBe(50); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(50); - expect(root_child1.getComputedLayout().width).toBe(0); - expect(root_child1.getComputedLayout().height).toBe(50); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(50); + expect(rootChild1.getComputedLayout().width).toBe(0); + expect(rootChild1.getComputedLayout().height).toBe(50); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -844,35 +844,35 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(0); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(0); - expect(root_child0.getComputedLayout().height).toBe(50); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(0); + expect(rootChild0.getComputedLayout().height).toBe(50); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(50); - expect(root_child1.getComputedLayout().width).toBe(0); - expect(root_child1.getComputedLayout().height).toBe(50); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(50); + expect(rootChild1.getComputedLayout().width).toBe(0); + expect(rootChild1.getComputedLayout().height).toBe(50); }); test('flex_grow_within_constrained_max_row', () => { const root = Yoga.Node.create(); root.setWidth(200); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0.setMaxWidth(100); - root_child0.setHeight(100); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + rootChild0.setMaxWidth(100); + rootChild0.setHeight(100); + root.insertChild(rootChild0, 0); - const root_child0_child0 = Yoga.Node.create(); - root_child0_child0.setFlexShrink(1); - root_child0_child0.setFlexBasis(100); - root_child0.insertChild(root_child0_child0, 0); + const rootChild0Child0 = Yoga.Node.create(); + rootChild0Child0.setFlexShrink(1); + rootChild0Child0.setFlexBasis(100); + rootChild0.insertChild(rootChild0Child0, 0); - const root_child0_child1 = Yoga.Node.create(); - root_child0_child1.setWidth(50); - root_child0.insertChild(root_child0_child1, 1); + const rootChild0Child1 = Yoga.Node.create(); + rootChild0Child1.setWidth(50); + rootChild0.insertChild(rootChild0Child1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -880,20 +880,20 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(100); - expect(root_child0.getComputedLayout().height).toBe(100); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(100); + expect(rootChild0.getComputedLayout().height).toBe(100); - expect(root_child0_child0.getComputedLayout().left).toBe(0); - expect(root_child0_child0.getComputedLayout().top).toBe(0); - expect(root_child0_child0.getComputedLayout().width).toBe(50); - expect(root_child0_child0.getComputedLayout().height).toBe(100); + expect(rootChild0Child0.getComputedLayout().left).toBe(0); + expect(rootChild0Child0.getComputedLayout().top).toBe(0); + expect(rootChild0Child0.getComputedLayout().width).toBe(50); + expect(rootChild0Child0.getComputedLayout().height).toBe(100); - expect(root_child0_child1.getComputedLayout().left).toBe(50); - expect(root_child0_child1.getComputedLayout().top).toBe(0); - expect(root_child0_child1.getComputedLayout().width).toBe(50); - expect(root_child0_child1.getComputedLayout().height).toBe(100); + expect(rootChild0Child1.getComputedLayout().left).toBe(50); + expect(rootChild0Child1.getComputedLayout().top).toBe(0); + expect(rootChild0Child1.getComputedLayout().width).toBe(50); + expect(rootChild0Child1.getComputedLayout().height).toBe(100); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -902,20 +902,20 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(100); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(100); - expect(root_child0.getComputedLayout().height).toBe(100); + expect(rootChild0.getComputedLayout().left).toBe(100); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(100); + expect(rootChild0.getComputedLayout().height).toBe(100); - expect(root_child0_child0.getComputedLayout().left).toBe(50); - expect(root_child0_child0.getComputedLayout().top).toBe(0); - expect(root_child0_child0.getComputedLayout().width).toBe(50); - expect(root_child0_child0.getComputedLayout().height).toBe(100); + expect(rootChild0Child0.getComputedLayout().left).toBe(50); + expect(rootChild0Child0.getComputedLayout().top).toBe(0); + expect(rootChild0Child0.getComputedLayout().width).toBe(50); + expect(rootChild0Child0.getComputedLayout().height).toBe(100); - expect(root_child0_child1.getComputedLayout().left).toBe(0); - expect(root_child0_child1.getComputedLayout().top).toBe(0); - expect(root_child0_child1.getComputedLayout().width).toBe(50); - expect(root_child0_child1.getComputedLayout().height).toBe(100); + expect(rootChild0Child1.getComputedLayout().left).toBe(0); + expect(rootChild0Child1.getComputedLayout().top).toBe(0); + expect(rootChild0Child1.getComputedLayout().width).toBe(50); + expect(rootChild0Child1.getComputedLayout().height).toBe(100); }); test('flex_grow_within_constrained_max_column', () => { @@ -923,14 +923,14 @@ describe("Min max dimensions", () => { root.setWidth(100); root.setMaxHeight(100); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexShrink(1); - root_child0.setFlexBasis(100); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexShrink(1); + rootChild0.setFlexBasis(100); + root.insertChild(rootChild0, 0); - const root_child1 = Yoga.Node.create(); - root_child1.setHeight(50); - root.insertChild(root_child1, 1); + const rootChild1 = Yoga.Node.create(); + rootChild1.setHeight(50); + root.insertChild(rootChild1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -938,15 +938,15 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(100); - expect(root_child0.getComputedLayout().height).toBe(50); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(100); + expect(rootChild0.getComputedLayout().height).toBe(50); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(50); - expect(root_child1.getComputedLayout().width).toBe(100); - expect(root_child1.getComputedLayout().height).toBe(50); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(50); + expect(rootChild1.getComputedLayout().width).toBe(100); + expect(rootChild1.getComputedLayout().height).toBe(50); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -955,15 +955,15 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(100); - expect(root_child0.getComputedLayout().height).toBe(50); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(100); + expect(rootChild0.getComputedLayout().height).toBe(50); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(50); - expect(root_child1.getComputedLayout().width).toBe(100); - expect(root_child1.getComputedLayout().height).toBe(50); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(50); + expect(rootChild1.getComputedLayout().width).toBe(100); + expect(rootChild1.getComputedLayout().height).toBe(50); }); test('child_min_max_width_flexing', () => { @@ -972,17 +972,17 @@ describe("Min max dimensions", () => { root.setWidth(120); root.setHeight(50); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setFlexBasis(0); - root_child0.setMinWidth(60); - root.insertChild(root_child0, 0); - - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(1); - root_child1.setFlexBasisPercent(50); - root_child1.setMaxWidth(20); - root.insertChild(root_child1, 1); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setFlexBasis(0); + rootChild0.setMinWidth(60); + root.insertChild(rootChild0, 0); + + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(1); + rootChild1.setFlexBasisPercent(50); + rootChild1.setMaxWidth(20); + root.insertChild(rootChild1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -990,15 +990,15 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(120); expect(root.getComputedLayout().height).toBe(50); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(100); - expect(root_child0.getComputedLayout().height).toBe(50); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(100); + expect(rootChild0.getComputedLayout().height).toBe(50); - expect(root_child1.getComputedLayout().left).toBe(100); - expect(root_child1.getComputedLayout().top).toBe(0); - expect(root_child1.getComputedLayout().width).toBe(20); - expect(root_child1.getComputedLayout().height).toBe(50); + expect(rootChild1.getComputedLayout().left).toBe(100); + expect(rootChild1.getComputedLayout().top).toBe(0); + expect(rootChild1.getComputedLayout().width).toBe(20); + expect(rootChild1.getComputedLayout().height).toBe(50); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -1007,15 +1007,15 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(120); expect(root.getComputedLayout().height).toBe(50); - expect(root_child0.getComputedLayout().left).toBe(20); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(100); - expect(root_child0.getComputedLayout().height).toBe(50); + expect(rootChild0.getComputedLayout().left).toBe(20); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(100); + expect(rootChild0.getComputedLayout().height).toBe(50); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(0); - expect(root_child1.getComputedLayout().width).toBe(20); - expect(root_child1.getComputedLayout().height).toBe(50); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(0); + expect(rootChild1.getComputedLayout().width).toBe(20); + expect(rootChild1.getComputedLayout().height).toBe(50); }); test('min_width_overrides_width', () => { @@ -1100,12 +1100,12 @@ describe("Min max dimensions", () => { root.setWidth(100); root.setHeight(100); - const root_child0 = Yoga.Node.create(); - root_child0.setMinWidthPercent(10); - root_child0.setMaxWidthPercent(10); - root_child0.setMinHeightPercent(10); - root_child0.setMaxHeightPercent(10); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setMinWidthPercent(10); + rootChild0.setMaxWidthPercent(10); + rootChild0.setMinHeightPercent(10); + rootChild0.setMaxHeightPercent(10); + root.insertChild(rootChild0, 0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -1113,10 +1113,10 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(10); - expect(root_child0.getComputedLayout().height).toBe(10); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(10); + expect(rootChild0.getComputedLayout().height).toBe(10); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -1125,9 +1125,9 @@ describe("Min max dimensions", () => { expect(root.getComputedLayout().width).toBe(100); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(90); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(10); - expect(root_child0.getComputedLayout().height).toBe(10); + expect(rootChild0.getComputedLayout().left).toBe(90); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(10); + expect(rootChild0.getComputedLayout().height).toBe(10); }); }); diff --git a/packages/yoga/tests/percentage.test.js b/packages/yoga/tests/percentage.test.js index 9acd42bdf..9fea066ba 100644 --- a/packages/yoga/tests/percentage.test.js +++ b/packages/yoga/tests/percentage.test.js @@ -7,10 +7,10 @@ describe('Percentage', () => { root.setWidth(200); root.setHeight(200); - const root_child0 = Yoga.Node.create(); - root_child0.setWidthPercent(30); - root_child0.setHeightPercent(30); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setWidthPercent(30); + rootChild0.setHeightPercent(30); + root.insertChild(rootChild0, 0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -18,10 +18,10 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(60); - expect(root_child0.getComputedLayout().height).toBe(60); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(60); + expect(rootChild0.getComputedLayout().height).toBe(60); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -30,10 +30,10 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(140); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(60); - expect(root_child0.getComputedLayout().height).toBe(60); + expect(rootChild0.getComputedLayout().left).toBe(140); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(60); + expect(rootChild0.getComputedLayout().height).toBe(60); }); test('percentage_position_left_top', () => { @@ -42,12 +42,12 @@ describe('Percentage', () => { root.setWidth(400); root.setHeight(400); - const root_child0 = Yoga.Node.create(); - root_child0.setPositionPercent(Yoga.EDGE_LEFT, 10); - root_child0.setPositionPercent(Yoga.EDGE_TOP, 20); - root_child0.setWidthPercent(45); - root_child0.setHeightPercent(55); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setPositionPercent(Yoga.EDGE_LEFT, 10); + rootChild0.setPositionPercent(Yoga.EDGE_TOP, 20); + rootChild0.setWidthPercent(45); + rootChild0.setHeightPercent(55); + root.insertChild(rootChild0, 0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -55,10 +55,10 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(400); expect(root.getComputedLayout().height).toBe(400); - expect(root_child0.getComputedLayout().left).toBe(40); - expect(root_child0.getComputedLayout().top).toBe(80); - expect(root_child0.getComputedLayout().width).toBe(180); - expect(root_child0.getComputedLayout().height).toBe(220); + expect(rootChild0.getComputedLayout().left).toBe(40); + expect(rootChild0.getComputedLayout().top).toBe(80); + expect(rootChild0.getComputedLayout().width).toBe(180); + expect(rootChild0.getComputedLayout().height).toBe(220); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -67,10 +67,10 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(400); expect(root.getComputedLayout().height).toBe(400); - expect(root_child0.getComputedLayout().left).toBe(260); - expect(root_child0.getComputedLayout().top).toBe(80); - expect(root_child0.getComputedLayout().width).toBe(180); - expect(root_child0.getComputedLayout().height).toBe(220); + expect(rootChild0.getComputedLayout().left).toBe(260); + expect(rootChild0.getComputedLayout().top).toBe(80); + expect(rootChild0.getComputedLayout().width).toBe(180); + expect(rootChild0.getComputedLayout().height).toBe(220); }); test('percentage_position_bottom_right', () => { @@ -79,12 +79,12 @@ describe('Percentage', () => { root.setWidth(500); root.setHeight(500); - const root_child0 = Yoga.Node.create(); - root_child0.setPositionPercent(Yoga.EDGE_RIGHT, 20); - root_child0.setPositionPercent(Yoga.EDGE_BOTTOM, 10); - root_child0.setWidthPercent(55); - root_child0.setHeightPercent(15); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setPositionPercent(Yoga.EDGE_RIGHT, 20); + rootChild0.setPositionPercent(Yoga.EDGE_BOTTOM, 10); + rootChild0.setWidthPercent(55); + rootChild0.setHeightPercent(15); + root.insertChild(rootChild0, 0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -92,10 +92,10 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(500); expect(root.getComputedLayout().height).toBe(500); - expect( root_child0.getComputedLayout().left).toBe(-100); - expect( root_child0.getComputedLayout().top).toBe(-50); - expect(root_child0.getComputedLayout().width).toBe(275); - expect(root_child0.getComputedLayout().height).toBe(75); + expect(rootChild0.getComputedLayout().left).toBe(-100); + expect(rootChild0.getComputedLayout().top).toBe(-50); + expect(rootChild0.getComputedLayout().width).toBe(275); + expect(rootChild0.getComputedLayout().height).toBe(75); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -104,10 +104,10 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(500); expect(root.getComputedLayout().height).toBe(500); - expect(root_child0.getComputedLayout().left).toBe(125); - expect( root_child0.getComputedLayout().top).toBe(-50); - expect(root_child0.getComputedLayout().width).toBe(275); - expect(root_child0.getComputedLayout().height).toBe(75); + expect(rootChild0.getComputedLayout().left).toBe(125); + expect(rootChild0.getComputedLayout().top).toBe(-50); + expect(rootChild0.getComputedLayout().width).toBe(275); + expect(rootChild0.getComputedLayout().height).toBe(75); }); test('percentage_flex_basis', () => { @@ -116,15 +116,15 @@ describe('Percentage', () => { root.setWidth(200); root.setHeight(200); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setFlexBasisPercent(50); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setFlexBasisPercent(50); + root.insertChild(rootChild0, 0); - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(1); - root_child1.setFlexBasisPercent(25); - root.insertChild(root_child1, 1); + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(1); + rootChild1.setFlexBasisPercent(25); + root.insertChild(rootChild1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -132,15 +132,15 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(125); - expect(root_child0.getComputedLayout().height).toBe(200); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(125); + expect(rootChild0.getComputedLayout().height).toBe(200); - expect(root_child1.getComputedLayout().left).toBe(125); - expect(root_child1.getComputedLayout().top).toBe(0); - expect(root_child1.getComputedLayout().width).toBe(75); - expect(root_child1.getComputedLayout().height).toBe(200); + expect(rootChild1.getComputedLayout().left).toBe(125); + expect(rootChild1.getComputedLayout().top).toBe(0); + expect(rootChild1.getComputedLayout().width).toBe(75); + expect(rootChild1.getComputedLayout().height).toBe(200); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -149,15 +149,15 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(75); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(125); - expect(root_child0.getComputedLayout().height).toBe(200); + expect(rootChild0.getComputedLayout().left).toBe(75); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(125); + expect(rootChild0.getComputedLayout().height).toBe(200); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(0); - expect(root_child1.getComputedLayout().width).toBe(75); - expect(root_child1.getComputedLayout().height).toBe(200); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(0); + expect(rootChild1.getComputedLayout().width).toBe(75); + expect(rootChild1.getComputedLayout().height).toBe(200); }); test('percentage_flex_basis_cross', () => { @@ -165,15 +165,15 @@ describe('Percentage', () => { root.setWidth(200); root.setHeight(200); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setFlexBasisPercent(50); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setFlexBasisPercent(50); + root.insertChild(rootChild0, 0); - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(1); - root_child1.setFlexBasisPercent(25); - root.insertChild(root_child1, 1); + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(1); + rootChild1.setFlexBasisPercent(25); + root.insertChild(rootChild1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -181,15 +181,15 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(200); - expect(root_child0.getComputedLayout().height).toBe(125); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(200); + expect(rootChild0.getComputedLayout().height).toBe(125); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(125); - expect(root_child1.getComputedLayout().width).toBe(200); - expect(root_child1.getComputedLayout().height).toBe(75); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(125); + expect(rootChild1.getComputedLayout().width).toBe(200); + expect(rootChild1.getComputedLayout().height).toBe(75); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -198,15 +198,15 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(200); - expect(root_child0.getComputedLayout().height).toBe(125); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(200); + expect(rootChild0.getComputedLayout().height).toBe(125); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(125); - expect(root_child1.getComputedLayout().width).toBe(200); - expect(root_child1.getComputedLayout().height).toBe(75); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(125); + expect(rootChild1.getComputedLayout().width).toBe(200); + expect(rootChild1.getComputedLayout().height).toBe(75); }); test('percentage_flex_basis_cross_min_height', () => { @@ -214,15 +214,15 @@ describe('Percentage', () => { root.setWidth(200); root.setHeight(200); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setMinHeightPercent(60); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setMinHeightPercent(60); + root.insertChild(rootChild0, 0); - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(2); - root_child1.setMinHeightPercent(10); - root.insertChild(root_child1, 1); + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(2); + rootChild1.setMinHeightPercent(10); + root.insertChild(rootChild1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -230,15 +230,15 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(200); - expect(root_child0.getComputedLayout().height).toBe(140); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(200); + expect(rootChild0.getComputedLayout().height).toBe(140); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(140); - expect(root_child1.getComputedLayout().width).toBe(200); - expect(root_child1.getComputedLayout().height).toBe(60); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(140); + expect(rootChild1.getComputedLayout().width).toBe(200); + expect(rootChild1.getComputedLayout().height).toBe(60); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -247,15 +247,15 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(200); - expect(root_child0.getComputedLayout().height).toBe(140); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(200); + expect(rootChild0.getComputedLayout().height).toBe(140); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(140); - expect(root_child1.getComputedLayout().width).toBe(200); - expect(root_child1.getComputedLayout().height).toBe(60); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(140); + expect(rootChild1.getComputedLayout().width).toBe(200); + expect(rootChild1.getComputedLayout().height).toBe(60); }); test('percentage_flex_basis_main_max_height', () => { @@ -264,17 +264,17 @@ describe('Percentage', () => { root.setWidth(200); root.setHeight(200); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setFlexBasisPercent(10); - root_child0.setMaxHeightPercent(60); - root.insertChild(root_child0, 0); - - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(4); - root_child1.setFlexBasisPercent(10); - root_child1.setMaxHeightPercent(20); - root.insertChild(root_child1, 1); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setFlexBasisPercent(10); + rootChild0.setMaxHeightPercent(60); + root.insertChild(rootChild0, 0); + + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(4); + rootChild1.setFlexBasisPercent(10); + rootChild1.setMaxHeightPercent(20); + root.insertChild(rootChild1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -282,15 +282,15 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(52); - expect(root_child0.getComputedLayout().height).toBe(120); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(52); + expect(rootChild0.getComputedLayout().height).toBe(120); - expect(root_child1.getComputedLayout().left).toBe(52); - expect(root_child1.getComputedLayout().top).toBe(0); - expect(root_child1.getComputedLayout().width).toBe(148); - expect(root_child1.getComputedLayout().height).toBe(40); + expect(rootChild1.getComputedLayout().left).toBe(52); + expect(rootChild1.getComputedLayout().top).toBe(0); + expect(rootChild1.getComputedLayout().width).toBe(148); + expect(rootChild1.getComputedLayout().height).toBe(40); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -299,15 +299,15 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(148); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(52); - expect(root_child0.getComputedLayout().height).toBe(120); + expect(rootChild0.getComputedLayout().left).toBe(148); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(52); + expect(rootChild0.getComputedLayout().height).toBe(120); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(0); - expect(root_child1.getComputedLayout().width).toBe(148); - expect(root_child1.getComputedLayout().height).toBe(40); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(0); + expect(rootChild1.getComputedLayout().width).toBe(148); + expect(rootChild1.getComputedLayout().height).toBe(40); }); test('percentage_flex_basis_cross_max_height', () => { @@ -315,17 +315,17 @@ describe('Percentage', () => { root.setWidth(200); root.setHeight(200); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setFlexBasisPercent(10); - root_child0.setMaxHeightPercent(60); - root.insertChild(root_child0, 0); - - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(4); - root_child1.setFlexBasisPercent(10); - root_child1.setMaxHeightPercent(20); - root.insertChild(root_child1, 1); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setFlexBasisPercent(10); + rootChild0.setMaxHeightPercent(60); + root.insertChild(rootChild0, 0); + + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(4); + rootChild1.setFlexBasisPercent(10); + rootChild1.setMaxHeightPercent(20); + root.insertChild(rootChild1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -333,15 +333,15 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(200); - expect(root_child0.getComputedLayout().height).toBe(120); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(200); + expect(rootChild0.getComputedLayout().height).toBe(120); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(120); - expect(root_child1.getComputedLayout().width).toBe(200); - expect(root_child1.getComputedLayout().height).toBe(40); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(120); + expect(rootChild1.getComputedLayout().width).toBe(200); + expect(rootChild1.getComputedLayout().height).toBe(40); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -350,15 +350,15 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(200); - expect(root_child0.getComputedLayout().height).toBe(120); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(200); + expect(rootChild0.getComputedLayout().height).toBe(120); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(120); - expect(root_child1.getComputedLayout().width).toBe(200); - expect(root_child1.getComputedLayout().height).toBe(40); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(120); + expect(rootChild1.getComputedLayout().width).toBe(200); + expect(rootChild1.getComputedLayout().height).toBe(40); }); test('percentage_flex_basis_main_max_width', () => { @@ -367,17 +367,17 @@ describe('Percentage', () => { root.setWidth(200); root.setHeight(200); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setFlexBasisPercent(15); - root_child0.setMaxWidthPercent(60); - root.insertChild(root_child0, 0); - - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(4); - root_child1.setFlexBasisPercent(10); - root_child1.setMaxWidthPercent(20); - root.insertChild(root_child1, 1); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setFlexBasisPercent(15); + rootChild0.setMaxWidthPercent(60); + root.insertChild(rootChild0, 0); + + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(4); + rootChild1.setFlexBasisPercent(10); + rootChild1.setMaxWidthPercent(20); + root.insertChild(rootChild1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -385,15 +385,15 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(120); - expect(root_child0.getComputedLayout().height).toBe(200); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(120); + expect(rootChild0.getComputedLayout().height).toBe(200); - expect(root_child1.getComputedLayout().left).toBe(120); - expect(root_child1.getComputedLayout().top).toBe(0); - expect(root_child1.getComputedLayout().width).toBe(40); - expect(root_child1.getComputedLayout().height).toBe(200); + expect(rootChild1.getComputedLayout().left).toBe(120); + expect(rootChild1.getComputedLayout().top).toBe(0); + expect(rootChild1.getComputedLayout().width).toBe(40); + expect(rootChild1.getComputedLayout().height).toBe(200); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -402,15 +402,15 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(80); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(120); - expect(root_child0.getComputedLayout().height).toBe(200); + expect(rootChild0.getComputedLayout().left).toBe(80); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(120); + expect(rootChild0.getComputedLayout().height).toBe(200); - expect(root_child1.getComputedLayout().left).toBe(40); - expect(root_child1.getComputedLayout().top).toBe(0); - expect(root_child1.getComputedLayout().width).toBe(40); - expect(root_child1.getComputedLayout().height).toBe(200); + expect(rootChild1.getComputedLayout().left).toBe(40); + expect(rootChild1.getComputedLayout().top).toBe(0); + expect(rootChild1.getComputedLayout().width).toBe(40); + expect(rootChild1.getComputedLayout().height).toBe(200); }); test('percentage_flex_basis_cross_max_width', () => { @@ -418,17 +418,17 @@ describe('Percentage', () => { root.setWidth(200); root.setHeight(200); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setFlexBasisPercent(10); - root_child0.setMaxWidthPercent(60); - root.insertChild(root_child0, 0); - - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(4); - root_child1.setFlexBasisPercent(15); - root_child1.setMaxWidthPercent(20); - root.insertChild(root_child1, 1); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setFlexBasisPercent(10); + rootChild0.setMaxWidthPercent(60); + root.insertChild(rootChild0, 0); + + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(4); + rootChild1.setFlexBasisPercent(15); + rootChild1.setMaxWidthPercent(20); + root.insertChild(rootChild1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -436,15 +436,15 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(120); - expect(root_child0.getComputedLayout().height).toBe(50); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(120); + expect(rootChild0.getComputedLayout().height).toBe(50); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(50); - expect(root_child1.getComputedLayout().width).toBe(40); - expect(root_child1.getComputedLayout().height).toBe(150); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(50); + expect(rootChild1.getComputedLayout().width).toBe(40); + expect(rootChild1.getComputedLayout().height).toBe(150); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -453,15 +453,15 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(80); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(120); - expect(root_child0.getComputedLayout().height).toBe(50); + expect(rootChild0.getComputedLayout().left).toBe(80); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(120); + expect(rootChild0.getComputedLayout().height).toBe(50); - expect(root_child1.getComputedLayout().left).toBe(160); - expect(root_child1.getComputedLayout().top).toBe(50); - expect(root_child1.getComputedLayout().width).toBe(40); - expect(root_child1.getComputedLayout().height).toBe(150); + expect(rootChild1.getComputedLayout().left).toBe(160); + expect(rootChild1.getComputedLayout().top).toBe(50); + expect(rootChild1.getComputedLayout().width).toBe(40); + expect(rootChild1.getComputedLayout().height).toBe(150); }); test('percentage_flex_basis_main_min_width', () => { @@ -470,17 +470,17 @@ describe('Percentage', () => { root.setWidth(200); root.setHeight(200); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setFlexBasisPercent(15); - root_child0.setMinWidthPercent(60); - root.insertChild(root_child0, 0); - - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(4); - root_child1.setFlexBasisPercent(10); - root_child1.setMinWidthPercent(20); - root.insertChild(root_child1, 1); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setFlexBasisPercent(15); + rootChild0.setMinWidthPercent(60); + root.insertChild(rootChild0, 0); + + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(4); + rootChild1.setFlexBasisPercent(10); + rootChild1.setMinWidthPercent(20); + root.insertChild(rootChild1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -488,15 +488,15 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(120); - expect(root_child0.getComputedLayout().height).toBe(200); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(120); + expect(rootChild0.getComputedLayout().height).toBe(200); - expect(root_child1.getComputedLayout().left).toBe(120); - expect(root_child1.getComputedLayout().top).toBe(0); - expect(root_child1.getComputedLayout().width).toBe(80); - expect(root_child1.getComputedLayout().height).toBe(200); + expect(rootChild1.getComputedLayout().left).toBe(120); + expect(rootChild1.getComputedLayout().top).toBe(0); + expect(rootChild1.getComputedLayout().width).toBe(80); + expect(rootChild1.getComputedLayout().height).toBe(200); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -505,15 +505,15 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(80); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(120); - expect(root_child0.getComputedLayout().height).toBe(200); + expect(rootChild0.getComputedLayout().left).toBe(80); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(120); + expect(rootChild0.getComputedLayout().height).toBe(200); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(0); - expect(root_child1.getComputedLayout().width).toBe(80); - expect(root_child1.getComputedLayout().height).toBe(200); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(0); + expect(rootChild1.getComputedLayout().width).toBe(80); + expect(rootChild1.getComputedLayout().height).toBe(200); }); test('percentage_flex_basis_cross_min_width', () => { @@ -521,17 +521,17 @@ describe('Percentage', () => { root.setWidth(200); root.setHeight(200); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setFlexBasisPercent(10); - root_child0.setMinWidthPercent(60); - root.insertChild(root_child0, 0); - - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(4); - root_child1.setFlexBasisPercent(15); - root_child1.setMinWidthPercent(20); - root.insertChild(root_child1, 1); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setFlexBasisPercent(10); + rootChild0.setMinWidthPercent(60); + root.insertChild(rootChild0, 0); + + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(4); + rootChild1.setFlexBasisPercent(15); + rootChild1.setMinWidthPercent(20); + root.insertChild(rootChild1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -539,15 +539,15 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(200); - expect(root_child0.getComputedLayout().height).toBe(50); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(200); + expect(rootChild0.getComputedLayout().height).toBe(50); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(50); - expect(root_child1.getComputedLayout().width).toBe(200); - expect(root_child1.getComputedLayout().height).toBe(150); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(50); + expect(rootChild1.getComputedLayout().width).toBe(200); + expect(rootChild1.getComputedLayout().height).toBe(150); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -556,15 +556,15 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(200); - expect(root_child0.getComputedLayout().height).toBe(50); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(200); + expect(rootChild0.getComputedLayout().height).toBe(50); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(50); - expect(root_child1.getComputedLayout().width).toBe(200); - expect(root_child1.getComputedLayout().height).toBe(150); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(50); + expect(rootChild1.getComputedLayout().width).toBe(200); + expect(rootChild1.getComputedLayout().height).toBe(150); }); test('percentage_multiple_nested_with_padding_margin_and_percentage_values', () => { @@ -572,49 +572,49 @@ describe('Percentage', () => { root.setWidth(200); root.setHeight(200); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setFlexBasisPercent(10); - root_child0.setMargin(Yoga.EDGE_LEFT, 5); - root_child0.setMargin(Yoga.EDGE_TOP, 5); - root_child0.setMargin(Yoga.EDGE_RIGHT, 5); - root_child0.setMargin(Yoga.EDGE_BOTTOM, 5); - root_child0.setPadding(Yoga.EDGE_LEFT, 3); - root_child0.setPadding(Yoga.EDGE_TOP, 3); - root_child0.setPadding(Yoga.EDGE_RIGHT, 3); - root_child0.setPadding(Yoga.EDGE_BOTTOM, 3); - root_child0.setMinWidthPercent(60); - root.insertChild(root_child0, 0); - - const root_child0_child0 = Yoga.Node.create(); - root_child0_child0.setMargin(Yoga.EDGE_LEFT, 5); - root_child0_child0.setMargin(Yoga.EDGE_TOP, 5); - root_child0_child0.setMargin(Yoga.EDGE_RIGHT, 5); - root_child0_child0.setMargin(Yoga.EDGE_BOTTOM, 5); - root_child0_child0.setPaddingPercent(Yoga.EDGE_LEFT, 3); - root_child0_child0.setPaddingPercent(Yoga.EDGE_TOP, 3); - root_child0_child0.setPaddingPercent(Yoga.EDGE_RIGHT, 3); - root_child0_child0.setPaddingPercent(Yoga.EDGE_BOTTOM, 3); - root_child0_child0.setWidthPercent(50); - root_child0.insertChild(root_child0_child0, 0); - - const root_child0_child0_child0 = Yoga.Node.create(); - root_child0_child0_child0.setMarginPercent(Yoga.EDGE_LEFT, 5); - root_child0_child0_child0.setMarginPercent(Yoga.EDGE_TOP, 5); - root_child0_child0_child0.setMarginPercent(Yoga.EDGE_RIGHT, 5); - root_child0_child0_child0.setMarginPercent(Yoga.EDGE_BOTTOM, 5); - root_child0_child0_child0.setPadding(Yoga.EDGE_LEFT, 3); - root_child0_child0_child0.setPadding(Yoga.EDGE_TOP, 3); - root_child0_child0_child0.setPadding(Yoga.EDGE_RIGHT, 3); - root_child0_child0_child0.setPadding(Yoga.EDGE_BOTTOM, 3); - root_child0_child0_child0.setWidthPercent(45); - root_child0_child0.insertChild(root_child0_child0_child0, 0); - - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(4); - root_child1.setFlexBasisPercent(15); - root_child1.setMinWidthPercent(20); - root.insertChild(root_child1, 1); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setFlexBasisPercent(10); + rootChild0.setMargin(Yoga.EDGE_LEFT, 5); + rootChild0.setMargin(Yoga.EDGE_TOP, 5); + rootChild0.setMargin(Yoga.EDGE_RIGHT, 5); + rootChild0.setMargin(Yoga.EDGE_BOTTOM, 5); + rootChild0.setPadding(Yoga.EDGE_LEFT, 3); + rootChild0.setPadding(Yoga.EDGE_TOP, 3); + rootChild0.setPadding(Yoga.EDGE_RIGHT, 3); + rootChild0.setPadding(Yoga.EDGE_BOTTOM, 3); + rootChild0.setMinWidthPercent(60); + root.insertChild(rootChild0, 0); + + const rootChild0Child0 = Yoga.Node.create(); + rootChild0Child0.setMargin(Yoga.EDGE_LEFT, 5); + rootChild0Child0.setMargin(Yoga.EDGE_TOP, 5); + rootChild0Child0.setMargin(Yoga.EDGE_RIGHT, 5); + rootChild0Child0.setMargin(Yoga.EDGE_BOTTOM, 5); + rootChild0Child0.setPaddingPercent(Yoga.EDGE_LEFT, 3); + rootChild0Child0.setPaddingPercent(Yoga.EDGE_TOP, 3); + rootChild0Child0.setPaddingPercent(Yoga.EDGE_RIGHT, 3); + rootChild0Child0.setPaddingPercent(Yoga.EDGE_BOTTOM, 3); + rootChild0Child0.setWidthPercent(50); + rootChild0.insertChild(rootChild0Child0, 0); + + const rootChild0Child0Child0 = Yoga.Node.create(); + rootChild0Child0Child0.setMarginPercent(Yoga.EDGE_LEFT, 5); + rootChild0Child0Child0.setMarginPercent(Yoga.EDGE_TOP, 5); + rootChild0Child0Child0.setMarginPercent(Yoga.EDGE_RIGHT, 5); + rootChild0Child0Child0.setMarginPercent(Yoga.EDGE_BOTTOM, 5); + rootChild0Child0Child0.setPadding(Yoga.EDGE_LEFT, 3); + rootChild0Child0Child0.setPadding(Yoga.EDGE_TOP, 3); + rootChild0Child0Child0.setPadding(Yoga.EDGE_RIGHT, 3); + rootChild0Child0Child0.setPadding(Yoga.EDGE_BOTTOM, 3); + rootChild0Child0Child0.setWidthPercent(45); + rootChild0Child0.insertChild(rootChild0Child0Child0, 0); + + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(4); + rootChild1.setFlexBasisPercent(15); + rootChild1.setMinWidthPercent(20); + root.insertChild(rootChild1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -622,25 +622,25 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(5); - expect(root_child0.getComputedLayout().top).toBe(5); - expect(root_child0.getComputedLayout().width).toBe(190); - expect(root_child0.getComputedLayout().height).toBe(48); + expect(rootChild0.getComputedLayout().left).toBe(5); + expect(rootChild0.getComputedLayout().top).toBe(5); + expect(rootChild0.getComputedLayout().width).toBe(190); + expect(rootChild0.getComputedLayout().height).toBe(48); - expect(root_child0_child0.getComputedLayout().left).toBe(8); - expect(root_child0_child0.getComputedLayout().top).toBe(8); - expect(root_child0_child0.getComputedLayout().width).toBe(92); - expect(root_child0_child0.getComputedLayout().height).toBe(25); + expect(rootChild0Child0.getComputedLayout().left).toBe(8); + expect(rootChild0Child0.getComputedLayout().top).toBe(8); + expect(rootChild0Child0.getComputedLayout().width).toBe(92); + expect(rootChild0Child0.getComputedLayout().height).toBe(25); - expect(root_child0_child0_child0.getComputedLayout().left).toBe(10); - expect(root_child0_child0_child0.getComputedLayout().top).toBe(10); - expect(root_child0_child0_child0.getComputedLayout().width).toBe(36); - expect(root_child0_child0_child0.getComputedLayout().height).toBe(6); + expect(rootChild0Child0Child0.getComputedLayout().left).toBe(10); + expect(rootChild0Child0Child0.getComputedLayout().top).toBe(10); + expect(rootChild0Child0Child0.getComputedLayout().width).toBe(36); + expect(rootChild0Child0Child0.getComputedLayout().height).toBe(6); - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(58); - expect(root_child1.getComputedLayout().width).toBe(200); - expect(root_child1.getComputedLayout().height).toBe(142); + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(58); + expect(rootChild1.getComputedLayout().width).toBe(200); + expect(rootChild1.getComputedLayout().height).toBe(142); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -649,25 +649,25 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(5); - expect(root_child0.getComputedLayout().top).toBe(5); - expect(root_child0.getComputedLayout().width).toBe(190); - expect(root_child0.getComputedLayout().height).toBe(48); - - expect(root_child0_child0.getComputedLayout().left).toBe(90); - expect(root_child0_child0.getComputedLayout().top).toBe(8); - expect(root_child0_child0.getComputedLayout().width).toBe(92); - expect(root_child0_child0.getComputedLayout().height).toBe(25); - - expect(root_child0_child0_child0.getComputedLayout().left).toBe(46); - expect(root_child0_child0_child0.getComputedLayout().top).toBe(10); - expect(root_child0_child0_child0.getComputedLayout().width).toBe(36); - expect(root_child0_child0_child0.getComputedLayout().height).toBe(6); - - expect(root_child1.getComputedLayout().left).toBe(0); - expect(root_child1.getComputedLayout().top).toBe(58); - expect(root_child1.getComputedLayout().width).toBe(200); - expect(root_child1.getComputedLayout().height).toBe(142); + expect(rootChild0.getComputedLayout().left).toBe(5); + expect(rootChild0.getComputedLayout().top).toBe(5); + expect(rootChild0.getComputedLayout().width).toBe(190); + expect(rootChild0.getComputedLayout().height).toBe(48); + + expect(rootChild0Child0.getComputedLayout().left).toBe(90); + expect(rootChild0Child0.getComputedLayout().top).toBe(8); + expect(rootChild0Child0.getComputedLayout().width).toBe(92); + expect(rootChild0Child0.getComputedLayout().height).toBe(25); + + expect(rootChild0Child0Child0.getComputedLayout().left).toBe(46); + expect(rootChild0Child0Child0.getComputedLayout().top).toBe(10); + expect(rootChild0Child0Child0.getComputedLayout().width).toBe(36); + expect(rootChild0Child0Child0.getComputedLayout().height).toBe(6); + + expect(rootChild1.getComputedLayout().left).toBe(0); + expect(rootChild1.getComputedLayout().top).toBe(58); + expect(rootChild1.getComputedLayout().width).toBe(200); + expect(rootChild1.getComputedLayout().height).toBe(142); }); test('percentage_margin_should_calculate_based_only_on_width', () => { @@ -675,18 +675,18 @@ describe('Percentage', () => { root.setWidth(200); root.setHeight(100); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setMarginPercent(Yoga.EDGE_LEFT, 10); - root_child0.setMarginPercent(Yoga.EDGE_TOP, 10); - root_child0.setMarginPercent(Yoga.EDGE_RIGHT, 10); - root_child0.setMarginPercent(Yoga.EDGE_BOTTOM, 10); - root.insertChild(root_child0, 0); - - const root_child0_child0 = Yoga.Node.create(); - root_child0_child0.setWidth(10); - root_child0_child0.setHeight(10); - root_child0.insertChild(root_child0_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setMarginPercent(Yoga.EDGE_LEFT, 10); + rootChild0.setMarginPercent(Yoga.EDGE_TOP, 10); + rootChild0.setMarginPercent(Yoga.EDGE_RIGHT, 10); + rootChild0.setMarginPercent(Yoga.EDGE_BOTTOM, 10); + root.insertChild(rootChild0, 0); + + const rootChild0Child0 = Yoga.Node.create(); + rootChild0Child0.setWidth(10); + rootChild0Child0.setHeight(10); + rootChild0.insertChild(rootChild0Child0, 0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -694,15 +694,15 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(20); - expect(root_child0.getComputedLayout().top).toBe(20); - expect(root_child0.getComputedLayout().width).toBe(160); - expect(root_child0.getComputedLayout().height).toBe(60); + expect(rootChild0.getComputedLayout().left).toBe(20); + expect(rootChild0.getComputedLayout().top).toBe(20); + expect(rootChild0.getComputedLayout().width).toBe(160); + expect(rootChild0.getComputedLayout().height).toBe(60); - expect(root_child0_child0.getComputedLayout().left).toBe(0); - expect(root_child0_child0.getComputedLayout().top).toBe(0); - expect(root_child0_child0.getComputedLayout().width).toBe(10); - expect(root_child0_child0.getComputedLayout().height).toBe(10); + expect(rootChild0Child0.getComputedLayout().left).toBe(0); + expect(rootChild0Child0.getComputedLayout().top).toBe(0); + expect(rootChild0Child0.getComputedLayout().width).toBe(10); + expect(rootChild0Child0.getComputedLayout().height).toBe(10); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -711,15 +711,15 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(20); - expect(root_child0.getComputedLayout().top).toBe(20); - expect(root_child0.getComputedLayout().width).toBe(160); - expect(root_child0.getComputedLayout().height).toBe(60); + expect(rootChild0.getComputedLayout().left).toBe(20); + expect(rootChild0.getComputedLayout().top).toBe(20); + expect(rootChild0.getComputedLayout().width).toBe(160); + expect(rootChild0.getComputedLayout().height).toBe(60); - expect(root_child0_child0.getComputedLayout().left).toBe(150); - expect(root_child0_child0.getComputedLayout().top).toBe(0); - expect(root_child0_child0.getComputedLayout().width).toBe(10); - expect(root_child0_child0.getComputedLayout().height).toBe(10); + expect(rootChild0Child0.getComputedLayout().left).toBe(150); + expect(rootChild0Child0.getComputedLayout().top).toBe(0); + expect(rootChild0Child0.getComputedLayout().width).toBe(10); + expect(rootChild0Child0.getComputedLayout().height).toBe(10); }); test('percentage_padding_should_calculate_based_only_on_width', () => { @@ -727,18 +727,18 @@ describe('Percentage', () => { root.setWidth(200); root.setHeight(100); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setPaddingPercent(Yoga.EDGE_LEFT, 10); - root_child0.setPaddingPercent(Yoga.EDGE_TOP, 10); - root_child0.setPaddingPercent(Yoga.EDGE_RIGHT, 10); - root_child0.setPaddingPercent(Yoga.EDGE_BOTTOM, 10); - root.insertChild(root_child0, 0); - - const root_child0_child0 = Yoga.Node.create(); - root_child0_child0.setWidth(10); - root_child0_child0.setHeight(10); - root_child0.insertChild(root_child0_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setPaddingPercent(Yoga.EDGE_LEFT, 10); + rootChild0.setPaddingPercent(Yoga.EDGE_TOP, 10); + rootChild0.setPaddingPercent(Yoga.EDGE_RIGHT, 10); + rootChild0.setPaddingPercent(Yoga.EDGE_BOTTOM, 10); + root.insertChild(rootChild0, 0); + + const rootChild0Child0 = Yoga.Node.create(); + rootChild0Child0.setWidth(10); + rootChild0Child0.setHeight(10); + rootChild0.insertChild(rootChild0Child0, 0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -746,15 +746,15 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(200); - expect(root_child0.getComputedLayout().height).toBe(100); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(200); + expect(rootChild0.getComputedLayout().height).toBe(100); - expect(root_child0_child0.getComputedLayout().left).toBe(20); - expect(root_child0_child0.getComputedLayout().top).toBe(20); - expect(root_child0_child0.getComputedLayout().width).toBe(10); - expect(root_child0_child0.getComputedLayout().height).toBe(10); + expect(rootChild0Child0.getComputedLayout().left).toBe(20); + expect(rootChild0Child0.getComputedLayout().top).toBe(20); + expect(rootChild0Child0.getComputedLayout().width).toBe(10); + expect(rootChild0Child0.getComputedLayout().height).toBe(10); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -763,15 +763,15 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(200); - expect(root_child0.getComputedLayout().height).toBe(100); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(200); + expect(rootChild0.getComputedLayout().height).toBe(100); - expect(root_child0_child0.getComputedLayout().left).toBe(170); - expect(root_child0_child0.getComputedLayout().top).toBe(20); - expect(root_child0_child0.getComputedLayout().width).toBe(10); - expect(root_child0_child0.getComputedLayout().height).toBe(10); + expect(rootChild0Child0.getComputedLayout().left).toBe(170); + expect(rootChild0Child0.getComputedLayout().top).toBe(20); + expect(rootChild0Child0.getComputedLayout().width).toBe(10); + expect(rootChild0Child0.getComputedLayout().height).toBe(10); }); test('percentage_absolute_position', () => { @@ -779,13 +779,13 @@ describe('Percentage', () => { root.setWidth(200); root.setHeight(100); - const root_child0 = Yoga.Node.create(); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); - root_child0.setPositionPercent(Yoga.EDGE_LEFT, 30); - root_child0.setPositionPercent(Yoga.EDGE_TOP, 10); - root_child0.setWidth(10); - root_child0.setHeight(10); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); + rootChild0.setPositionPercent(Yoga.EDGE_LEFT, 30); + rootChild0.setPositionPercent(Yoga.EDGE_TOP, 10); + rootChild0.setWidth(10); + rootChild0.setHeight(10); + root.insertChild(rootChild0, 0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -793,10 +793,10 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(60); - expect(root_child0.getComputedLayout().top).toBe(10); - expect(root_child0.getComputedLayout().width).toBe(10); - expect(root_child0.getComputedLayout().height).toBe(10); + expect(rootChild0.getComputedLayout().left).toBe(60); + expect(rootChild0.getComputedLayout().top).toBe(10); + expect(rootChild0.getComputedLayout().width).toBe(10); + expect(rootChild0.getComputedLayout().height).toBe(10); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -805,19 +805,19 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(60); - expect(root_child0.getComputedLayout().top).toBe(10); - expect(root_child0.getComputedLayout().width).toBe(10); - expect(root_child0.getComputedLayout().height).toBe(10); + expect(rootChild0.getComputedLayout().left).toBe(60); + expect(rootChild0.getComputedLayout().top).toBe(10); + expect(rootChild0.getComputedLayout().width).toBe(10); + expect(rootChild0.getComputedLayout().height).toBe(10); }); test('percentage_width_height_undefined_parent_size', () => { const root = Yoga.Node.create(); - const root_child0 = Yoga.Node.create(); - root_child0.setWidthPercent(50); - root_child0.setHeightPercent(50); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setWidthPercent(50); + rootChild0.setHeightPercent(50); + root.insertChild(rootChild0, 0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -825,10 +825,10 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(0); expect(root.getComputedLayout().height).toBe(0); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(0); - expect(root_child0.getComputedLayout().height).toBe(0); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(0); + expect(rootChild0.getComputedLayout().height).toBe(0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -837,10 +837,10 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(0); expect(root.getComputedLayout().height).toBe(0); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(0); - expect(root_child0.getComputedLayout().height).toBe(0); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(0); + expect(rootChild0.getComputedLayout().height).toBe(0); }); test('percent_within_flex_grow', () => { @@ -849,21 +849,21 @@ describe('Percentage', () => { root.setWidth(350); root.setHeight(100); - const root_child0 = Yoga.Node.create(); - root_child0.setWidth(100); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setWidth(100); + root.insertChild(rootChild0, 0); - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(1); - root.insertChild(root_child1, 1); + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(1); + root.insertChild(rootChild1, 1); - const root_child1_child0 = Yoga.Node.create(); - root_child1_child0.setWidthPercent(100); - root_child1.insertChild(root_child1_child0, 0); + const rootChild1Child0 = Yoga.Node.create(); + rootChild1Child0.setWidthPercent(100); + rootChild1.insertChild(rootChild1Child0, 0); - const root_child2 = Yoga.Node.create(); - root_child2.setWidth(100); - root.insertChild(root_child2, 2); + const rootChild2 = Yoga.Node.create(); + rootChild2.setWidth(100); + root.insertChild(rootChild2, 2); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -871,25 +871,25 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(350); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(0); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(100); - expect(root_child0.getComputedLayout().height).toBe(100); + expect(rootChild0.getComputedLayout().left).toBe(0); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(100); + expect(rootChild0.getComputedLayout().height).toBe(100); - expect(root_child1.getComputedLayout().left).toBe(100); - expect(root_child1.getComputedLayout().top).toBe(0); - expect(root_child1.getComputedLayout().width).toBe(150); - expect(root_child1.getComputedLayout().height).toBe(100); + expect(rootChild1.getComputedLayout().left).toBe(100); + expect(rootChild1.getComputedLayout().top).toBe(0); + expect(rootChild1.getComputedLayout().width).toBe(150); + expect(rootChild1.getComputedLayout().height).toBe(100); - expect(root_child1_child0.getComputedLayout().left).toBe(0); - expect(root_child1_child0.getComputedLayout().top).toBe(0); - expect(root_child1_child0.getComputedLayout().width).toBe(150); - expect(root_child1_child0.getComputedLayout().height).toBe(0); + expect(rootChild1Child0.getComputedLayout().left).toBe(0); + expect(rootChild1Child0.getComputedLayout().top).toBe(0); + expect(rootChild1Child0.getComputedLayout().width).toBe(150); + expect(rootChild1Child0.getComputedLayout().height).toBe(0); - expect(root_child2.getComputedLayout().left).toBe(250); - expect(root_child2.getComputedLayout().top).toBe(0); - expect(root_child2.getComputedLayout().width).toBe(100); - expect(root_child2.getComputedLayout().height).toBe(100); + expect(rootChild2.getComputedLayout().left).toBe(250); + expect(rootChild2.getComputedLayout().top).toBe(0); + expect(rootChild2.getComputedLayout().width).toBe(100); + expect(rootChild2.getComputedLayout().height).toBe(100); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -898,25 +898,25 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(350); expect(root.getComputedLayout().height).toBe(100); - expect(root_child0.getComputedLayout().left).toBe(250); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(100); - expect(root_child0.getComputedLayout().height).toBe(100); - - expect(root_child1.getComputedLayout().left).toBe(100); - expect(root_child1.getComputedLayout().top).toBe(0); - expect(root_child1.getComputedLayout().width).toBe(150); - expect(root_child1.getComputedLayout().height).toBe(100); - - expect(root_child1_child0.getComputedLayout().left).toBe(0); - expect(root_child1_child0.getComputedLayout().top).toBe(0); - expect(root_child1_child0.getComputedLayout().width).toBe(150); - expect(root_child1_child0.getComputedLayout().height).toBe(0); - - expect(root_child2.getComputedLayout().left).toBe(0); - expect(root_child2.getComputedLayout().top).toBe(0); - expect(root_child2.getComputedLayout().width).toBe(100); - expect(root_child2.getComputedLayout().height).toBe(100); + expect(rootChild0.getComputedLayout().left).toBe(250); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(100); + expect(rootChild0.getComputedLayout().height).toBe(100); + + expect(rootChild1.getComputedLayout().left).toBe(100); + expect(rootChild1.getComputedLayout().top).toBe(0); + expect(rootChild1.getComputedLayout().width).toBe(150); + expect(rootChild1.getComputedLayout().height).toBe(100); + + expect(rootChild1Child0.getComputedLayout().left).toBe(0); + expect(rootChild1Child0.getComputedLayout().top).toBe(0); + expect(rootChild1Child0.getComputedLayout().width).toBe(150); + expect(rootChild1Child0.getComputedLayout().height).toBe(0); + + expect(rootChild2.getComputedLayout().left).toBe(0); + expect(rootChild2.getComputedLayout().top).toBe(0); + expect(rootChild2.getComputedLayout().width).toBe(100); + expect(rootChild2.getComputedLayout().height).toBe(100); }); test('percentage_container_in_wrapping_container', () => { @@ -926,24 +926,24 @@ describe('Percentage', () => { root.setWidth(200); root.setHeight(200); - const root_child0 = Yoga.Node.create(); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + root.insertChild(rootChild0, 0); - const root_child0_child0 = Yoga.Node.create(); - root_child0_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0_child0.setJustifyContent(Yoga.JUSTIFY_CENTER); - root_child0_child0.setWidthPercent(100); - root_child0.insertChild(root_child0_child0, 0); + const rootChild0Child0 = Yoga.Node.create(); + rootChild0Child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + rootChild0Child0.setJustifyContent(Yoga.JUSTIFY_CENTER); + rootChild0Child0.setWidthPercent(100); + rootChild0.insertChild(rootChild0Child0, 0); - const root_child0_child0_child0 = Yoga.Node.create(); - root_child0_child0_child0.setWidth(50); - root_child0_child0_child0.setHeight(50); - root_child0_child0.insertChild(root_child0_child0_child0, 0); + const rootChild0Child0Child0 = Yoga.Node.create(); + rootChild0Child0Child0.setWidth(50); + rootChild0Child0Child0.setHeight(50); + rootChild0Child0.insertChild(rootChild0Child0Child0, 0); - const root_child0_child0_child1 = Yoga.Node.create(); - root_child0_child0_child1.setWidth(50); - root_child0_child0_child1.setHeight(50); - root_child0_child0.insertChild(root_child0_child0_child1, 1); + const rootChild0Child0Child1 = Yoga.Node.create(); + rootChild0Child0Child1.setWidth(50); + rootChild0Child0Child1.setHeight(50); + rootChild0Child0.insertChild(rootChild0Child0Child1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -951,25 +951,25 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(50); - expect(root_child0.getComputedLayout().top).toBe(75); - expect(root_child0.getComputedLayout().width).toBe(100); - expect(root_child0.getComputedLayout().height).toBe(50); + expect(rootChild0.getComputedLayout().left).toBe(50); + expect(rootChild0.getComputedLayout().top).toBe(75); + expect(rootChild0.getComputedLayout().width).toBe(100); + expect(rootChild0.getComputedLayout().height).toBe(50); - expect(root_child0_child0.getComputedLayout().left).toBe(0); - expect(root_child0_child0.getComputedLayout().top).toBe(0); - expect(root_child0_child0.getComputedLayout().width).toBe(100); - expect(root_child0_child0.getComputedLayout().height).toBe(50); + expect(rootChild0Child0.getComputedLayout().left).toBe(0); + expect(rootChild0Child0.getComputedLayout().top).toBe(0); + expect(rootChild0Child0.getComputedLayout().width).toBe(100); + expect(rootChild0Child0.getComputedLayout().height).toBe(50); - expect(root_child0_child0_child0.getComputedLayout().left).toBe(0); - expect(root_child0_child0_child0.getComputedLayout().top).toBe(0); - expect(root_child0_child0_child0.getComputedLayout().width).toBe(50); - expect(root_child0_child0_child0.getComputedLayout().height).toBe(50); + expect(rootChild0Child0Child0.getComputedLayout().left).toBe(0); + expect(rootChild0Child0Child0.getComputedLayout().top).toBe(0); + expect(rootChild0Child0Child0.getComputedLayout().width).toBe(50); + expect(rootChild0Child0Child0.getComputedLayout().height).toBe(50); - expect(root_child0_child0_child1.getComputedLayout().left).toBe(50); - expect(root_child0_child0_child1.getComputedLayout().top).toBe(0); - expect(root_child0_child0_child1.getComputedLayout().width).toBe(50); - expect(root_child0_child0_child1.getComputedLayout().height).toBe(50); + expect(rootChild0Child0Child1.getComputedLayout().left).toBe(50); + expect(rootChild0Child0Child1.getComputedLayout().top).toBe(0); + expect(rootChild0Child0Child1.getComputedLayout().width).toBe(50); + expect(rootChild0Child0Child1.getComputedLayout().height).toBe(50); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -978,25 +978,25 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(200); expect(root.getComputedLayout().height).toBe(200); - expect(root_child0.getComputedLayout().left).toBe(50); - expect(root_child0.getComputedLayout().top).toBe(75); - expect(root_child0.getComputedLayout().width).toBe(100); - expect(root_child0.getComputedLayout().height).toBe(50); - - expect(root_child0_child0.getComputedLayout().left).toBe(0); - expect(root_child0_child0.getComputedLayout().top).toBe(0); - expect(root_child0_child0.getComputedLayout().width).toBe(100); - expect(root_child0_child0.getComputedLayout().height).toBe(50); - - expect(root_child0_child0_child0.getComputedLayout().left).toBe(50); - expect(root_child0_child0_child0.getComputedLayout().top).toBe(0); - expect(root_child0_child0_child0.getComputedLayout().width).toBe(50); - expect(root_child0_child0_child0.getComputedLayout().height).toBe(50); - - expect(root_child0_child0_child1.getComputedLayout().left).toBe(0); - expect(root_child0_child0_child1.getComputedLayout().top).toBe(0); - expect(root_child0_child0_child1.getComputedLayout().width).toBe(50); - expect(root_child0_child0_child1.getComputedLayout().height).toBe(50); + expect(rootChild0.getComputedLayout().left).toBe(50); + expect(rootChild0.getComputedLayout().top).toBe(75); + expect(rootChild0.getComputedLayout().width).toBe(100); + expect(rootChild0.getComputedLayout().height).toBe(50); + + expect(rootChild0Child0.getComputedLayout().left).toBe(0); + expect(rootChild0Child0.getComputedLayout().top).toBe(0); + expect(rootChild0Child0.getComputedLayout().width).toBe(100); + expect(rootChild0Child0.getComputedLayout().height).toBe(50); + + expect(rootChild0Child0Child0.getComputedLayout().left).toBe(50); + expect(rootChild0Child0Child0.getComputedLayout().top).toBe(0); + expect(rootChild0Child0Child0.getComputedLayout().width).toBe(50); + expect(rootChild0Child0Child0.getComputedLayout().height).toBe(50); + + expect(rootChild0Child0Child1.getComputedLayout().left).toBe(0); + expect(rootChild0Child0Child1.getComputedLayout().top).toBe(0); + expect(rootChild0Child0Child1.getComputedLayout().width).toBe(50); + expect(rootChild0Child0Child1.getComputedLayout().height).toBe(50); }); test('percent_absolute_position', () => { @@ -1004,21 +1004,21 @@ describe('Percentage', () => { root.setWidth(60); root.setHeight(50); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); - root_child0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); - root_child0.setPositionPercent(Yoga.EDGE_LEFT, 50); - root_child0.setWidthPercent(100); - root_child0.setHeight(50); - root.insertChild(root_child0, 0); - - const root_child0_child0 = Yoga.Node.create(); - root_child0_child0.setWidthPercent(100); - root_child0.insertChild(root_child0_child0, 0); - - const root_child0_child1 = Yoga.Node.create(); - root_child0_child1.setWidthPercent(100); - root_child0.insertChild(root_child0_child1, 1); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); + rootChild0.setPositionType(Yoga.POSITION_TYPE_ABSOLUTE); + rootChild0.setPositionPercent(Yoga.EDGE_LEFT, 50); + rootChild0.setWidthPercent(100); + rootChild0.setHeight(50); + root.insertChild(rootChild0, 0); + + const rootChild0Child0 = Yoga.Node.create(); + rootChild0Child0.setWidthPercent(100); + rootChild0.insertChild(rootChild0Child0, 0); + + const rootChild0Child1 = Yoga.Node.create(); + rootChild0Child1.setWidthPercent(100); + rootChild0.insertChild(rootChild0Child1, 1); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLayout().left).toBe(0); @@ -1026,20 +1026,20 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(60); expect(root.getComputedLayout().height).toBe(50); - expect(root_child0.getComputedLayout().left).toBe(30); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(60); - expect(root_child0.getComputedLayout().height).toBe(50); + expect(rootChild0.getComputedLayout().left).toBe(30); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(60); + expect(rootChild0.getComputedLayout().height).toBe(50); - expect(root_child0_child0.getComputedLayout().left).toBe(0); - expect(root_child0_child0.getComputedLayout().top).toBe(0); - expect(root_child0_child0.getComputedLayout().width).toBe(60); - expect(root_child0_child0.getComputedLayout().height).toBe(50); + expect(rootChild0Child0.getComputedLayout().left).toBe(0); + expect(rootChild0Child0.getComputedLayout().top).toBe(0); + expect(rootChild0Child0.getComputedLayout().width).toBe(60); + expect(rootChild0Child0.getComputedLayout().height).toBe(50); - expect(root_child0_child1.getComputedLayout().left).toBe(60); - expect(root_child0_child1.getComputedLayout().top).toBe(0); - expect(root_child0_child1.getComputedLayout().width).toBe(60); - expect(root_child0_child1.getComputedLayout().height).toBe(50); + expect(rootChild0Child1.getComputedLayout().left).toBe(60); + expect(rootChild0Child1.getComputedLayout().top).toBe(0); + expect(rootChild0Child1.getComputedLayout().width).toBe(60); + expect(rootChild0Child1.getComputedLayout().height).toBe(50); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -1048,19 +1048,19 @@ describe('Percentage', () => { expect(root.getComputedLayout().width).toBe(60); expect(root.getComputedLayout().height).toBe(50); - expect(root_child0.getComputedLayout().left).toBe(30); - expect(root_child0.getComputedLayout().top).toBe(0); - expect(root_child0.getComputedLayout().width).toBe(60); - expect(root_child0.getComputedLayout().height).toBe(50); + expect(rootChild0.getComputedLayout().left).toBe(30); + expect(rootChild0.getComputedLayout().top).toBe(0); + expect(rootChild0.getComputedLayout().width).toBe(60); + expect(rootChild0.getComputedLayout().height).toBe(50); - expect(root_child0_child0.getComputedLayout().left).toBe(0); - expect(root_child0_child0.getComputedLayout().top).toBe(0); - expect(root_child0_child0.getComputedLayout().width).toBe(60); - expect(root_child0_child0.getComputedLayout().height).toBe(50); + expect(rootChild0Child0.getComputedLayout().left).toBe(0); + expect(rootChild0Child0.getComputedLayout().top).toBe(0); + expect(rootChild0Child0.getComputedLayout().width).toBe(60); + expect(rootChild0Child0.getComputedLayout().height).toBe(50); - expect(root_child0_child1.getComputedLayout().left).toBe(-60); - expect(root_child0_child1.getComputedLayout().top).toBe(0); - expect(root_child0_child1.getComputedLayout().width).toBe(60); - expect(root_child0_child1.getComputedLayout().height).toBe(50); + expect(rootChild0Child1.getComputedLayout().left).toBe(-60); + expect(rootChild0Child1.getComputedLayout().top).toBe(0); + expect(rootChild0Child1.getComputedLayout().width).toBe(60); + expect(rootChild0Child1.getComputedLayout().height).toBe(50); }); }); diff --git a/packages/yoga/tests/rounding.test.js b/packages/yoga/tests/rounding.test.js index 3cb74e074..cfec297ea 100644 --- a/packages/yoga/tests/rounding.test.js +++ b/packages/yoga/tests/rounding.test.js @@ -7,17 +7,17 @@ describe('Rounding', () => { root.setWidth(100); root.setHeight(100); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + root.insertChild(rootChild0, 0); - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(1); - root.insertChild(root_child1, 1); + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(1); + root.insertChild(rootChild1, 1); - const root_child2 = Yoga.Node.create(); - root_child2.setFlexGrow(1); - root.insertChild(root_child2, 2); + const rootChild2 = Yoga.Node.create(); + rootChild2.setFlexGrow(1); + root.insertChild(rootChild2, 2); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); @@ -25,20 +25,20 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(100); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(33); - expect(root_child0.getComputedHeight()).toBe(100); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(33); + expect(rootChild0.getComputedHeight()).toBe(100); - expect(root_child1.getComputedLeft()).toBe(33); - expect(root_child1.getComputedTop()).toBe(0); - expect(root_child1.getComputedWidth()).toBe(34); - expect(root_child1.getComputedHeight()).toBe(100); + expect(rootChild1.getComputedLeft()).toBe(33); + expect(rootChild1.getComputedTop()).toBe(0); + expect(rootChild1.getComputedWidth()).toBe(34); + expect(rootChild1.getComputedHeight()).toBe(100); - expect(root_child2.getComputedLeft()).toBe(67); - expect(root_child2.getComputedTop()).toBe(0); - expect(root_child2.getComputedWidth()).toBe(33); - expect(root_child2.getComputedHeight()).toBe(100); + expect(rootChild2.getComputedLeft()).toBe(67); + expect(rootChild2.getComputedTop()).toBe(0); + expect(rootChild2.getComputedWidth()).toBe(33); + expect(rootChild2.getComputedHeight()).toBe(100); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -47,20 +47,20 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(100); - expect(root_child0.getComputedLeft()).toBe(67); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(33); - expect(root_child0.getComputedHeight()).toBe(100); + expect(rootChild0.getComputedLeft()).toBe(67); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(33); + expect(rootChild0.getComputedHeight()).toBe(100); - expect(root_child1.getComputedLeft()).toBe(33); - expect(root_child1.getComputedTop()).toBe(0); - expect(root_child1.getComputedWidth()).toBe(34); - expect(root_child1.getComputedHeight()).toBe(100); + expect(rootChild1.getComputedLeft()).toBe(33); + expect(rootChild1.getComputedTop()).toBe(0); + expect(rootChild1.getComputedWidth()).toBe(34); + expect(rootChild1.getComputedHeight()).toBe(100); - expect(root_child2.getComputedLeft()).toBe(0); - expect(root_child2.getComputedTop()).toBe(0); - expect(root_child2.getComputedWidth()).toBe(33); - expect(root_child2.getComputedHeight()).toBe(100); + expect(rootChild2.getComputedLeft()).toBe(0); + expect(rootChild2.getComputedTop()).toBe(0); + expect(rootChild2.getComputedWidth()).toBe(33); + expect(rootChild2.getComputedHeight()).toBe(100); }); test('rounding_flex_basis_flex_grow_row_prime_number_width', () => { @@ -69,25 +69,25 @@ describe('Rounding', () => { root.setWidth(113); root.setHeight(100); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + root.insertChild(rootChild0, 0); - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(1); - root.insertChild(root_child1, 1); + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(1); + root.insertChild(rootChild1, 1); - const root_child2 = Yoga.Node.create(); - root_child2.setFlexGrow(1); - root.insertChild(root_child2, 2); + const rootChild2 = Yoga.Node.create(); + rootChild2.setFlexGrow(1); + root.insertChild(rootChild2, 2); - const root_child3 = Yoga.Node.create(); - root_child3.setFlexGrow(1); - root.insertChild(root_child3, 3); + const rootChild3 = Yoga.Node.create(); + rootChild3.setFlexGrow(1); + root.insertChild(rootChild3, 3); - const root_child4 = Yoga.Node.create(); - root_child4.setFlexGrow(1); - root.insertChild(root_child4, 4); + const rootChild4 = Yoga.Node.create(); + rootChild4.setFlexGrow(1); + root.insertChild(rootChild4, 4); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); @@ -95,30 +95,30 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(113); expect(root.getComputedHeight()).toBe(100); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(23); - expect(root_child0.getComputedHeight()).toBe(100); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(23); + expect(rootChild0.getComputedHeight()).toBe(100); - expect(root_child1.getComputedLeft()).toBe(23); - expect(root_child1.getComputedTop()).toBe(0); - expect(root_child1.getComputedWidth()).toBe(22); - expect(root_child1.getComputedHeight()).toBe(100); + expect(rootChild1.getComputedLeft()).toBe(23); + expect(rootChild1.getComputedTop()).toBe(0); + expect(rootChild1.getComputedWidth()).toBe(22); + expect(rootChild1.getComputedHeight()).toBe(100); - expect(root_child2.getComputedLeft()).toBe(45); - expect(root_child2.getComputedTop()).toBe(0); - expect(root_child2.getComputedWidth()).toBe(23); - expect(root_child2.getComputedHeight()).toBe(100); + expect(rootChild2.getComputedLeft()).toBe(45); + expect(rootChild2.getComputedTop()).toBe(0); + expect(rootChild2.getComputedWidth()).toBe(23); + expect(rootChild2.getComputedHeight()).toBe(100); - expect(root_child3.getComputedLeft()).toBe(68); - expect(root_child3.getComputedTop()).toBe(0); - expect(root_child3.getComputedWidth()).toBe(22); - expect(root_child3.getComputedHeight()).toBe(100); + expect(rootChild3.getComputedLeft()).toBe(68); + expect(rootChild3.getComputedTop()).toBe(0); + expect(rootChild3.getComputedWidth()).toBe(22); + expect(rootChild3.getComputedHeight()).toBe(100); - expect(root_child4.getComputedLeft()).toBe(90); - expect(root_child4.getComputedTop()).toBe(0); - expect(root_child4.getComputedWidth()).toBe(23); - expect(root_child4.getComputedHeight()).toBe(100); + expect(rootChild4.getComputedLeft()).toBe(90); + expect(rootChild4.getComputedTop()).toBe(0); + expect(rootChild4.getComputedWidth()).toBe(23); + expect(rootChild4.getComputedHeight()).toBe(100); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -127,30 +127,30 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(113); expect(root.getComputedHeight()).toBe(100); - expect(root_child0.getComputedLeft()).toBe(90); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(23); - expect(root_child0.getComputedHeight()).toBe(100); - - expect(root_child1.getComputedLeft()).toBe(68); - expect(root_child1.getComputedTop()).toBe(0); - expect(root_child1.getComputedWidth()).toBe(22); - expect(root_child1.getComputedHeight()).toBe(100); - - expect(root_child2.getComputedLeft()).toBe(45); - expect(root_child2.getComputedTop()).toBe(0); - expect(root_child2.getComputedWidth()).toBe(23); - expect(root_child2.getComputedHeight()).toBe(100); - - expect(root_child3.getComputedLeft()).toBe(23); - expect(root_child3.getComputedTop()).toBe(0); - expect(root_child3.getComputedWidth()).toBe(22); - expect(root_child3.getComputedHeight()).toBe(100); - - expect(root_child4.getComputedLeft()).toBe(0); - expect(root_child4.getComputedTop()).toBe(0); - expect(root_child4.getComputedWidth()).toBe(23); - expect(root_child4.getComputedHeight()).toBe(100); + expect(rootChild0.getComputedLeft()).toBe(90); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(23); + expect(rootChild0.getComputedHeight()).toBe(100); + + expect(rootChild1.getComputedLeft()).toBe(68); + expect(rootChild1.getComputedTop()).toBe(0); + expect(rootChild1.getComputedWidth()).toBe(22); + expect(rootChild1.getComputedHeight()).toBe(100); + + expect(rootChild2.getComputedLeft()).toBe(45); + expect(rootChild2.getComputedTop()).toBe(0); + expect(rootChild2.getComputedWidth()).toBe(23); + expect(rootChild2.getComputedHeight()).toBe(100); + + expect(rootChild3.getComputedLeft()).toBe(23); + expect(rootChild3.getComputedTop()).toBe(0); + expect(rootChild3.getComputedWidth()).toBe(22); + expect(rootChild3.getComputedHeight()).toBe(100); + + expect(rootChild4.getComputedLeft()).toBe(0); + expect(rootChild4.getComputedTop()).toBe(0); + expect(rootChild4.getComputedWidth()).toBe(23); + expect(rootChild4.getComputedHeight()).toBe(100); }); test('rounding_flex_basis_flex_shrink_row', () => { @@ -159,18 +159,18 @@ describe('Rounding', () => { root.setWidth(101); root.setHeight(100); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexShrink(1); - root_child0.setFlexBasis(100); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexShrink(1); + rootChild0.setFlexBasis(100); + root.insertChild(rootChild0, 0); - const root_child1 = Yoga.Node.create(); - root_child1.setFlexBasis(25); - root.insertChild(root_child1, 1); + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexBasis(25); + root.insertChild(rootChild1, 1); - const root_child2 = Yoga.Node.create(); - root_child2.setFlexBasis(25); - root.insertChild(root_child2, 2); + const rootChild2 = Yoga.Node.create(); + rootChild2.setFlexBasis(25); + root.insertChild(rootChild2, 2); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); @@ -178,20 +178,20 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(101); expect(root.getComputedHeight()).toBe(100); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(51); - expect(root_child0.getComputedHeight()).toBe(100); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(51); + expect(rootChild0.getComputedHeight()).toBe(100); - expect(root_child1.getComputedLeft()).toBe(51); - expect(root_child1.getComputedTop()).toBe(0); - expect(root_child1.getComputedWidth()).toBe(25); - expect(root_child1.getComputedHeight()).toBe(100); + expect(rootChild1.getComputedLeft()).toBe(51); + expect(rootChild1.getComputedTop()).toBe(0); + expect(rootChild1.getComputedWidth()).toBe(25); + expect(rootChild1.getComputedHeight()).toBe(100); - expect(root_child2.getComputedLeft()).toBe(76); - expect(root_child2.getComputedTop()).toBe(0); - expect(root_child2.getComputedWidth()).toBe(25); - expect(root_child2.getComputedHeight()).toBe(100); + expect(rootChild2.getComputedLeft()).toBe(76); + expect(rootChild2.getComputedTop()).toBe(0); + expect(rootChild2.getComputedWidth()).toBe(25); + expect(rootChild2.getComputedHeight()).toBe(100); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -200,20 +200,20 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(101); expect(root.getComputedHeight()).toBe(100); - expect(root_child0.getComputedLeft()).toBe(50); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(51); - expect(root_child0.getComputedHeight()).toBe(100); + expect(rootChild0.getComputedLeft()).toBe(50); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(51); + expect(rootChild0.getComputedHeight()).toBe(100); - expect(root_child1.getComputedLeft()).toBe(25); - expect(root_child1.getComputedTop()).toBe(0); - expect(root_child1.getComputedWidth()).toBe(25); - expect(root_child1.getComputedHeight()).toBe(100); + expect(rootChild1.getComputedLeft()).toBe(25); + expect(rootChild1.getComputedTop()).toBe(0); + expect(rootChild1.getComputedWidth()).toBe(25); + expect(rootChild1.getComputedHeight()).toBe(100); - expect(root_child2.getComputedLeft()).toBe(0); - expect(root_child2.getComputedTop()).toBe(0); - expect(root_child2.getComputedWidth()).toBe(25); - expect(root_child2.getComputedHeight()).toBe(100); + expect(rootChild2.getComputedLeft()).toBe(0); + expect(rootChild2.getComputedTop()).toBe(0); + expect(rootChild2.getComputedWidth()).toBe(25); + expect(rootChild2.getComputedHeight()).toBe(100); }); test('rounding_flex_basis_overrides_main_size', () => { @@ -221,21 +221,21 @@ describe('Rounding', () => { root.setWidth(100); root.setHeight(113); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setFlexBasis(50); - root_child0.setHeight(20); - root.insertChild(root_child0, 0); - - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(1); - root_child1.setHeight(10); - root.insertChild(root_child1, 1); - - const root_child2 = Yoga.Node.create(); - root_child2.setFlexGrow(1); - root_child2.setHeight(10); - root.insertChild(root_child2, 2); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setFlexBasis(50); + rootChild0.setHeight(20); + root.insertChild(rootChild0, 0); + + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(1); + rootChild1.setHeight(10); + root.insertChild(rootChild1, 1); + + const rootChild2 = Yoga.Node.create(); + rootChild2.setFlexGrow(1); + rootChild2.setHeight(10); + root.insertChild(rootChild2, 2); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); @@ -243,20 +243,20 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(113); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(100); - expect(root_child0.getComputedHeight()).toBe(64); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(100); + expect(rootChild0.getComputedHeight()).toBe(64); - expect(root_child1.getComputedLeft()).toBe(0); - expect(root_child1.getComputedTop()).toBe(64); - expect(root_child1.getComputedWidth()).toBe(100); - expect(root_child1.getComputedHeight()).toBe(25); + expect(rootChild1.getComputedLeft()).toBe(0); + expect(rootChild1.getComputedTop()).toBe(64); + expect(rootChild1.getComputedWidth()).toBe(100); + expect(rootChild1.getComputedHeight()).toBe(25); - expect(root_child2.getComputedLeft()).toBe(0); - expect(root_child2.getComputedTop()).toBe(89); - expect(root_child2.getComputedWidth()).toBe(100); - expect(root_child2.getComputedHeight()).toBe(24); + expect(rootChild2.getComputedLeft()).toBe(0); + expect(rootChild2.getComputedTop()).toBe(89); + expect(rootChild2.getComputedWidth()).toBe(100); + expect(rootChild2.getComputedHeight()).toBe(24); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -265,20 +265,20 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(113); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(100); - expect(root_child0.getComputedHeight()).toBe(64); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(100); + expect(rootChild0.getComputedHeight()).toBe(64); - expect(root_child1.getComputedLeft()).toBe(0); - expect(root_child1.getComputedTop()).toBe(64); - expect(root_child1.getComputedWidth()).toBe(100); - expect(root_child1.getComputedHeight()).toBe(25); + expect(rootChild1.getComputedLeft()).toBe(0); + expect(rootChild1.getComputedTop()).toBe(64); + expect(rootChild1.getComputedWidth()).toBe(100); + expect(rootChild1.getComputedHeight()).toBe(25); - expect(root_child2.getComputedLeft()).toBe(0); - expect(root_child2.getComputedTop()).toBe(89); - expect(root_child2.getComputedWidth()).toBe(100); - expect(root_child2.getComputedHeight()).toBe(24); + expect(rootChild2.getComputedLeft()).toBe(0); + expect(rootChild2.getComputedTop()).toBe(89); + expect(rootChild2.getComputedWidth()).toBe(100); + expect(rootChild2.getComputedHeight()).toBe(24); }); test('rounding_total_fractial', () => { @@ -286,21 +286,21 @@ describe('Rounding', () => { root.setWidth(87.4); root.setHeight(113.4); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(0.7); - root_child0.setFlexBasis(50.3); - root_child0.setHeight(20.3); - root.insertChild(root_child0, 0); - - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(1.6); - root_child1.setHeight(10); - root.insertChild(root_child1, 1); - - const root_child2 = Yoga.Node.create(); - root_child2.setFlexGrow(1.1); - root_child2.setHeight(10.7); - root.insertChild(root_child2, 2); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(0.7); + rootChild0.setFlexBasis(50.3); + rootChild0.setHeight(20.3); + root.insertChild(rootChild0, 0); + + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(1.6); + rootChild1.setHeight(10); + root.insertChild(rootChild1, 1); + + const rootChild2 = Yoga.Node.create(); + rootChild2.setFlexGrow(1.1); + rootChild2.setHeight(10.7); + root.insertChild(rootChild2, 2); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); @@ -308,20 +308,20 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(87); expect(root.getComputedHeight()).toBe(113); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(87); - expect(root_child0.getComputedHeight()).toBe(59); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(87); + expect(rootChild0.getComputedHeight()).toBe(59); - expect(root_child1.getComputedLeft()).toBe(0); - expect(root_child1.getComputedTop()).toBe(59); - expect(root_child1.getComputedWidth()).toBe(87); - expect(root_child1.getComputedHeight()).toBe(30); + expect(rootChild1.getComputedLeft()).toBe(0); + expect(rootChild1.getComputedTop()).toBe(59); + expect(rootChild1.getComputedWidth()).toBe(87); + expect(rootChild1.getComputedHeight()).toBe(30); - expect(root_child2.getComputedLeft()).toBe(0); - expect(root_child2.getComputedTop()).toBe(89); - expect(root_child2.getComputedWidth()).toBe(87); - expect(root_child2.getComputedHeight()).toBe(24); + expect(rootChild2.getComputedLeft()).toBe(0); + expect(rootChild2.getComputedTop()).toBe(89); + expect(rootChild2.getComputedWidth()).toBe(87); + expect(rootChild2.getComputedHeight()).toBe(24); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -330,20 +330,20 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(87); expect(root.getComputedHeight()).toBe(113); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(87); - expect(root_child0.getComputedHeight()).toBe(59); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(87); + expect(rootChild0.getComputedHeight()).toBe(59); - expect(root_child1.getComputedLeft()).toBe(0); - expect(root_child1.getComputedTop()).toBe(59); - expect(root_child1.getComputedWidth()).toBe(87); - expect(root_child1.getComputedHeight()).toBe(30); + expect(rootChild1.getComputedLeft()).toBe(0); + expect(rootChild1.getComputedTop()).toBe(59); + expect(rootChild1.getComputedWidth()).toBe(87); + expect(rootChild1.getComputedHeight()).toBe(30); - expect(root_child2.getComputedLeft()).toBe(0); - expect(root_child2.getComputedTop()).toBe(89); - expect(root_child2.getComputedWidth()).toBe(87); - expect(root_child2.getComputedHeight()).toBe(24); + expect(rootChild2.getComputedLeft()).toBe(0); + expect(rootChild2.getComputedTop()).toBe(89); + expect(rootChild2.getComputedWidth()).toBe(87); + expect(rootChild2.getComputedHeight()).toBe(24); }); test('rounding_total_fractial_nested', () => { @@ -351,35 +351,35 @@ describe('Rounding', () => { root.setWidth(87.4); root.setHeight(113.4); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(0.7); - root_child0.setFlexBasis(50.3); - root_child0.setHeight(20.3); - root.insertChild(root_child0, 0); - - const root_child0_child0 = Yoga.Node.create(); - root_child0_child0.setFlexGrow(1); - root_child0_child0.setFlexBasis(0.3); - root_child0_child0.setPosition(Yoga.EDGE_BOTTOM, 13.3); - root_child0_child0.setHeight(9.9); - root_child0.insertChild(root_child0_child0, 0); - - const root_child0_child1 = Yoga.Node.create(); - root_child0_child1.setFlexGrow(4); - root_child0_child1.setFlexBasis(0.3); - root_child0_child1.setPosition(Yoga.EDGE_TOP, 13.3); - root_child0_child1.setHeight(1.1); - root_child0.insertChild(root_child0_child1, 1); - - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(1.6); - root_child1.setHeight(10); - root.insertChild(root_child1, 1); - - const root_child2 = Yoga.Node.create(); - root_child2.setFlexGrow(1.1); - root_child2.setHeight(10.7); - root.insertChild(root_child2, 2); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(0.7); + rootChild0.setFlexBasis(50.3); + rootChild0.setHeight(20.3); + root.insertChild(rootChild0, 0); + + const rootChild0Child0 = Yoga.Node.create(); + rootChild0Child0.setFlexGrow(1); + rootChild0Child0.setFlexBasis(0.3); + rootChild0Child0.setPosition(Yoga.EDGE_BOTTOM, 13.3); + rootChild0Child0.setHeight(9.9); + rootChild0.insertChild(rootChild0Child0, 0); + + const rootChild0Child1 = Yoga.Node.create(); + rootChild0Child1.setFlexGrow(4); + rootChild0Child1.setFlexBasis(0.3); + rootChild0Child1.setPosition(Yoga.EDGE_TOP, 13.3); + rootChild0Child1.setHeight(1.1); + rootChild0.insertChild(rootChild0Child1, 1); + + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(1.6); + rootChild1.setHeight(10); + root.insertChild(rootChild1, 1); + + const rootChild2 = Yoga.Node.create(); + rootChild2.setFlexGrow(1.1); + rootChild2.setHeight(10.7); + root.insertChild(rootChild2, 2); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); @@ -387,30 +387,30 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(87); expect(root.getComputedHeight()).toBe(113); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(87); - expect(root_child0.getComputedHeight()).toBe(59); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(87); + expect(rootChild0.getComputedHeight()).toBe(59); - expect(root_child0_child0.getComputedLeft()).toBe(0); - expect(root_child0_child0.getComputedTop()).toBe(-13); - expect(root_child0_child0.getComputedWidth()).toBe(87); - expect(root_child0_child0.getComputedHeight()).toBe(12); + expect(rootChild0Child0.getComputedLeft()).toBe(0); + expect(rootChild0Child0.getComputedTop()).toBe(-13); + expect(rootChild0Child0.getComputedWidth()).toBe(87); + expect(rootChild0Child0.getComputedHeight()).toBe(12); - expect(root_child0_child1.getComputedLeft()).toBe(0); - expect(root_child0_child1.getComputedTop()).toBe(25); - expect(root_child0_child1.getComputedWidth()).toBe(87); - expect(root_child0_child1.getComputedHeight()).toBe(47); + expect(rootChild0Child1.getComputedLeft()).toBe(0); + expect(rootChild0Child1.getComputedTop()).toBe(25); + expect(rootChild0Child1.getComputedWidth()).toBe(87); + expect(rootChild0Child1.getComputedHeight()).toBe(47); - expect(root_child1.getComputedLeft()).toBe(0); - expect(root_child1.getComputedTop()).toBe(59); - expect(root_child1.getComputedWidth()).toBe(87); - expect(root_child1.getComputedHeight()).toBe(30); + expect(rootChild1.getComputedLeft()).toBe(0); + expect(rootChild1.getComputedTop()).toBe(59); + expect(rootChild1.getComputedWidth()).toBe(87); + expect(rootChild1.getComputedHeight()).toBe(30); - expect(root_child2.getComputedLeft()).toBe(0); - expect(root_child2.getComputedTop()).toBe(89); - expect(root_child2.getComputedWidth()).toBe(87); - expect(root_child2.getComputedHeight()).toBe(24); + expect(rootChild2.getComputedLeft()).toBe(0); + expect(rootChild2.getComputedTop()).toBe(89); + expect(rootChild2.getComputedWidth()).toBe(87); + expect(rootChild2.getComputedHeight()).toBe(24); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -419,30 +419,30 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(87); expect(root.getComputedHeight()).toBe(113); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(87); - expect(root_child0.getComputedHeight()).toBe(59); - - expect(root_child0_child0.getComputedLeft()).toBe(0); - expect(root_child0_child0.getComputedTop()).toBe(-13); - expect(root_child0_child0.getComputedWidth()).toBe(87); - expect(root_child0_child0.getComputedHeight()).toBe(12); - - expect(root_child0_child1.getComputedLeft()).toBe(0); - expect(root_child0_child1.getComputedTop()).toBe(25); - expect(root_child0_child1.getComputedWidth()).toBe(87); - expect(root_child0_child1.getComputedHeight()).toBe(47); - - expect(root_child1.getComputedLeft()).toBe(0); - expect(root_child1.getComputedTop()).toBe(59); - expect(root_child1.getComputedWidth()).toBe(87); - expect(root_child1.getComputedHeight()).toBe(30); - - expect(root_child2.getComputedLeft()).toBe(0); - expect(root_child2.getComputedTop()).toBe(89); - expect(root_child2.getComputedWidth()).toBe(87); - expect(root_child2.getComputedHeight()).toBe(24); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(87); + expect(rootChild0.getComputedHeight()).toBe(59); + + expect(rootChild0Child0.getComputedLeft()).toBe(0); + expect(rootChild0Child0.getComputedTop()).toBe(-13); + expect(rootChild0Child0.getComputedWidth()).toBe(87); + expect(rootChild0Child0.getComputedHeight()).toBe(12); + + expect(rootChild0Child1.getComputedLeft()).toBe(0); + expect(rootChild0Child1.getComputedTop()).toBe(25); + expect(rootChild0Child1.getComputedWidth()).toBe(87); + expect(rootChild0Child1.getComputedHeight()).toBe(47); + + expect(rootChild1.getComputedLeft()).toBe(0); + expect(rootChild1.getComputedTop()).toBe(59); + expect(rootChild1.getComputedWidth()).toBe(87); + expect(rootChild1.getComputedHeight()).toBe(30); + + expect(rootChild2.getComputedLeft()).toBe(0); + expect(rootChild2.getComputedTop()).toBe(89); + expect(rootChild2.getComputedWidth()).toBe(87); + expect(rootChild2.getComputedHeight()).toBe(24); }); test('rounding_fractial_input_1', () => { @@ -450,21 +450,21 @@ describe('Rounding', () => { root.setWidth(100); root.setHeight(113.4); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setFlexBasis(50); - root_child0.setHeight(20); - root.insertChild(root_child0, 0); - - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(1); - root_child1.setHeight(10); - root.insertChild(root_child1, 1); - - const root_child2 = Yoga.Node.create(); - root_child2.setFlexGrow(1); - root_child2.setHeight(10); - root.insertChild(root_child2, 2); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setFlexBasis(50); + rootChild0.setHeight(20); + root.insertChild(rootChild0, 0); + + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(1); + rootChild1.setHeight(10); + root.insertChild(rootChild1, 1); + + const rootChild2 = Yoga.Node.create(); + rootChild2.setFlexGrow(1); + rootChild2.setHeight(10); + root.insertChild(rootChild2, 2); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); @@ -472,20 +472,20 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(113); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(100); - expect(root_child0.getComputedHeight()).toBe(64); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(100); + expect(rootChild0.getComputedHeight()).toBe(64); - expect(root_child1.getComputedLeft()).toBe(0); - expect(root_child1.getComputedTop()).toBe(64); - expect(root_child1.getComputedWidth()).toBe(100); - expect(root_child1.getComputedHeight()).toBe(25); + expect(rootChild1.getComputedLeft()).toBe(0); + expect(rootChild1.getComputedTop()).toBe(64); + expect(rootChild1.getComputedWidth()).toBe(100); + expect(rootChild1.getComputedHeight()).toBe(25); - expect(root_child2.getComputedLeft()).toBe(0); - expect(root_child2.getComputedTop()).toBe(89); - expect(root_child2.getComputedWidth()).toBe(100); - expect(root_child2.getComputedHeight()).toBe(24); + expect(rootChild2.getComputedLeft()).toBe(0); + expect(rootChild2.getComputedTop()).toBe(89); + expect(rootChild2.getComputedWidth()).toBe(100); + expect(rootChild2.getComputedHeight()).toBe(24); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -494,20 +494,20 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(113); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(100); - expect(root_child0.getComputedHeight()).toBe(64); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(100); + expect(rootChild0.getComputedHeight()).toBe(64); - expect(root_child1.getComputedLeft()).toBe(0); - expect(root_child1.getComputedTop()).toBe(64); - expect(root_child1.getComputedWidth()).toBe(100); - expect(root_child1.getComputedHeight()).toBe(25); + expect(rootChild1.getComputedLeft()).toBe(0); + expect(rootChild1.getComputedTop()).toBe(64); + expect(rootChild1.getComputedWidth()).toBe(100); + expect(rootChild1.getComputedHeight()).toBe(25); - expect(root_child2.getComputedLeft()).toBe(0); - expect(root_child2.getComputedTop()).toBe(89); - expect(root_child2.getComputedWidth()).toBe(100); - expect(root_child2.getComputedHeight()).toBe(24); + expect(rootChild2.getComputedLeft()).toBe(0); + expect(rootChild2.getComputedTop()).toBe(89); + expect(rootChild2.getComputedWidth()).toBe(100); + expect(rootChild2.getComputedHeight()).toBe(24); }); test('rounding_fractial_input_2', () => { @@ -515,21 +515,21 @@ describe('Rounding', () => { root.setWidth(100); root.setHeight(113.6); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setFlexBasis(50); - root_child0.setHeight(20); - root.insertChild(root_child0, 0); - - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(1); - root_child1.setHeight(10); - root.insertChild(root_child1, 1); - - const root_child2 = Yoga.Node.create(); - root_child2.setFlexGrow(1); - root_child2.setHeight(10); - root.insertChild(root_child2, 2); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setFlexBasis(50); + rootChild0.setHeight(20); + root.insertChild(rootChild0, 0); + + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(1); + rootChild1.setHeight(10); + root.insertChild(rootChild1, 1); + + const rootChild2 = Yoga.Node.create(); + rootChild2.setFlexGrow(1); + rootChild2.setHeight(10); + root.insertChild(rootChild2, 2); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); @@ -537,20 +537,20 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(114); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(100); - expect(root_child0.getComputedHeight()).toBe(65); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(100); + expect(rootChild0.getComputedHeight()).toBe(65); - expect(root_child1.getComputedLeft()).toBe(0); - expect(root_child1.getComputedTop()).toBe(65); - expect(root_child1.getComputedWidth()).toBe(100); - expect(root_child1.getComputedHeight()).toBe(24); + expect(rootChild1.getComputedLeft()).toBe(0); + expect(rootChild1.getComputedTop()).toBe(65); + expect(rootChild1.getComputedWidth()).toBe(100); + expect(rootChild1.getComputedHeight()).toBe(24); - expect(root_child2.getComputedLeft()).toBe(0); - expect(root_child2.getComputedTop()).toBe(89); - expect(root_child2.getComputedWidth()).toBe(100); - expect(root_child2.getComputedHeight()).toBe(25); + expect(rootChild2.getComputedLeft()).toBe(0); + expect(rootChild2.getComputedTop()).toBe(89); + expect(rootChild2.getComputedWidth()).toBe(100); + expect(rootChild2.getComputedHeight()).toBe(25); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -559,20 +559,20 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(114); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(100); - expect(root_child0.getComputedHeight()).toBe(65); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(100); + expect(rootChild0.getComputedHeight()).toBe(65); - expect(root_child1.getComputedLeft()).toBe(0); - expect(root_child1.getComputedTop()).toBe(65); - expect(root_child1.getComputedWidth()).toBe(100); - expect(root_child1.getComputedHeight()).toBe(24); + expect(rootChild1.getComputedLeft()).toBe(0); + expect(rootChild1.getComputedTop()).toBe(65); + expect(rootChild1.getComputedWidth()).toBe(100); + expect(rootChild1.getComputedHeight()).toBe(24); - expect(root_child2.getComputedLeft()).toBe(0); - expect(root_child2.getComputedTop()).toBe(89); - expect(root_child2.getComputedWidth()).toBe(100); - expect(root_child2.getComputedHeight()).toBe(25); + expect(rootChild2.getComputedLeft()).toBe(0); + expect(rootChild2.getComputedTop()).toBe(89); + expect(rootChild2.getComputedWidth()).toBe(100); + expect(rootChild2.getComputedHeight()).toBe(25); }); test('rounding_fractial_input_3', () => { @@ -581,21 +581,21 @@ describe('Rounding', () => { root.setWidth(100); root.setHeight(113.4); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setFlexBasis(50); - root_child0.setHeight(20); - root.insertChild(root_child0, 0); - - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(1); - root_child1.setHeight(10); - root.insertChild(root_child1, 1); - - const root_child2 = Yoga.Node.create(); - root_child2.setFlexGrow(1); - root_child2.setHeight(10); - root.insertChild(root_child2, 2); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setFlexBasis(50); + rootChild0.setHeight(20); + root.insertChild(rootChild0, 0); + + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(1); + rootChild1.setHeight(10); + root.insertChild(rootChild1, 1); + + const rootChild2 = Yoga.Node.create(); + rootChild2.setFlexGrow(1); + rootChild2.setHeight(10); + root.insertChild(rootChild2, 2); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); @@ -603,20 +603,20 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(114); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(100); - expect(root_child0.getComputedHeight()).toBe(65); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(100); + expect(rootChild0.getComputedHeight()).toBe(65); - expect(root_child1.getComputedLeft()).toBe(0); - expect(root_child1.getComputedTop()).toBe(64); - expect(root_child1.getComputedWidth()).toBe(100); - expect(root_child1.getComputedHeight()).toBe(24); + expect(rootChild1.getComputedLeft()).toBe(0); + expect(rootChild1.getComputedTop()).toBe(64); + expect(rootChild1.getComputedWidth()).toBe(100); + expect(rootChild1.getComputedHeight()).toBe(24); - expect(root_child2.getComputedLeft()).toBe(0); - expect(root_child2.getComputedTop()).toBe(89); - expect(root_child2.getComputedWidth()).toBe(100); - expect(root_child2.getComputedHeight()).toBe(25); + expect(rootChild2.getComputedLeft()).toBe(0); + expect(rootChild2.getComputedTop()).toBe(89); + expect(rootChild2.getComputedWidth()).toBe(100); + expect(rootChild2.getComputedHeight()).toBe(25); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -625,20 +625,20 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(114); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(100); - expect(root_child0.getComputedHeight()).toBe(65); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(100); + expect(rootChild0.getComputedHeight()).toBe(65); - expect(root_child1.getComputedLeft()).toBe(0); - expect(root_child1.getComputedTop()).toBe(64); - expect(root_child1.getComputedWidth()).toBe(100); - expect(root_child1.getComputedHeight()).toBe(24); + expect(rootChild1.getComputedLeft()).toBe(0); + expect(rootChild1.getComputedTop()).toBe(64); + expect(rootChild1.getComputedWidth()).toBe(100); + expect(rootChild1.getComputedHeight()).toBe(24); - expect(root_child2.getComputedLeft()).toBe(0); - expect(root_child2.getComputedTop()).toBe(89); - expect(root_child2.getComputedWidth()).toBe(100); - expect(root_child2.getComputedHeight()).toBe(25); + expect(rootChild2.getComputedLeft()).toBe(0); + expect(rootChild2.getComputedTop()).toBe(89); + expect(rootChild2.getComputedWidth()).toBe(100); + expect(rootChild2.getComputedHeight()).toBe(25); }); test('rounding_fractial_input_4', () => { @@ -647,21 +647,21 @@ describe('Rounding', () => { root.setWidth(100); root.setHeight(113.4); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setFlexBasis(50); - root_child0.setHeight(20); - root.insertChild(root_child0, 0); - - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(1); - root_child1.setHeight(10); - root.insertChild(root_child1, 1); - - const root_child2 = Yoga.Node.create(); - root_child2.setFlexGrow(1); - root_child2.setHeight(10); - root.insertChild(root_child2, 2); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setFlexBasis(50); + rootChild0.setHeight(20); + root.insertChild(rootChild0, 0); + + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(1); + rootChild1.setHeight(10); + root.insertChild(rootChild1, 1); + + const rootChild2 = Yoga.Node.create(); + rootChild2.setFlexGrow(1); + rootChild2.setHeight(10); + root.insertChild(rootChild2, 2); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); @@ -669,20 +669,20 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(113); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(100); - expect(root_child0.getComputedHeight()).toBe(64); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(100); + expect(rootChild0.getComputedHeight()).toBe(64); - expect(root_child1.getComputedLeft()).toBe(0); - expect(root_child1.getComputedTop()).toBe(64); - expect(root_child1.getComputedWidth()).toBe(100); - expect(root_child1.getComputedHeight()).toBe(25); + expect(rootChild1.getComputedLeft()).toBe(0); + expect(rootChild1.getComputedTop()).toBe(64); + expect(rootChild1.getComputedWidth()).toBe(100); + expect(rootChild1.getComputedHeight()).toBe(25); - expect(root_child2.getComputedLeft()).toBe(0); - expect(root_child2.getComputedTop()).toBe(89); - expect(root_child2.getComputedWidth()).toBe(100); - expect(root_child2.getComputedHeight()).toBe(24); + expect(rootChild2.getComputedLeft()).toBe(0); + expect(rootChild2.getComputedTop()).toBe(89); + expect(rootChild2.getComputedWidth()).toBe(100); + expect(rootChild2.getComputedHeight()).toBe(24); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -691,20 +691,20 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(113); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(100); - expect(root_child0.getComputedHeight()).toBe(64); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(100); + expect(rootChild0.getComputedHeight()).toBe(64); - expect(root_child1.getComputedLeft()).toBe(0); - expect(root_child1.getComputedTop()).toBe(64); - expect(root_child1.getComputedWidth()).toBe(100); - expect(root_child1.getComputedHeight()).toBe(25); + expect(rootChild1.getComputedLeft()).toBe(0); + expect(rootChild1.getComputedTop()).toBe(64); + expect(rootChild1.getComputedWidth()).toBe(100); + expect(rootChild1.getComputedHeight()).toBe(25); - expect(root_child2.getComputedLeft()).toBe(0); - expect(root_child2.getComputedTop()).toBe(89); - expect(root_child2.getComputedWidth()).toBe(100); - expect(root_child2.getComputedHeight()).toBe(24); + expect(rootChild2.getComputedLeft()).toBe(0); + expect(rootChild2.getComputedTop()).toBe(89); + expect(rootChild2.getComputedWidth()).toBe(100); + expect(rootChild2.getComputedHeight()).toBe(24); }); test('rounding_inner_node_controversy_horizontal', () => { @@ -712,25 +712,25 @@ describe('Rounding', () => { root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW); root.setWidth(320); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setHeight(10); - root.insertChild(root_child0, 0); - - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(1); - root_child1.setHeight(10); - root.insertChild(root_child1, 1); - - const root_child1_child0 = Yoga.Node.create(); - root_child1_child0.setFlexGrow(1); - root_child1_child0.setHeight(10); - root_child1.insertChild(root_child1_child0, 0); - - const root_child2 = Yoga.Node.create(); - root_child2.setFlexGrow(1); - root_child2.setHeight(10); - root.insertChild(root_child2, 2); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setHeight(10); + root.insertChild(rootChild0, 0); + + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(1); + rootChild1.setHeight(10); + root.insertChild(rootChild1, 1); + + const rootChild1Child0 = Yoga.Node.create(); + rootChild1Child0.setFlexGrow(1); + rootChild1Child0.setHeight(10); + rootChild1.insertChild(rootChild1Child0, 0); + + const rootChild2 = Yoga.Node.create(); + rootChild2.setFlexGrow(1); + rootChild2.setHeight(10); + root.insertChild(rootChild2, 2); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); @@ -738,25 +738,25 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(320); expect(root.getComputedHeight()).toBe(10); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(107); - expect(root_child0.getComputedHeight()).toBe(10); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(107); + expect(rootChild0.getComputedHeight()).toBe(10); - expect(root_child1.getComputedLeft()).toBe(107); - expect(root_child1.getComputedTop()).toBe(0); - expect(root_child1.getComputedWidth()).toBe(106); - expect(root_child1.getComputedHeight()).toBe(10); + expect(rootChild1.getComputedLeft()).toBe(107); + expect(rootChild1.getComputedTop()).toBe(0); + expect(rootChild1.getComputedWidth()).toBe(106); + expect(rootChild1.getComputedHeight()).toBe(10); - expect(root_child1_child0.getComputedLeft()).toBe(0); - expect(root_child1_child0.getComputedTop()).toBe(0); - expect(root_child1_child0.getComputedWidth()).toBe(106); - expect(root_child1_child0.getComputedHeight()).toBe(10); + expect(rootChild1Child0.getComputedLeft()).toBe(0); + expect(rootChild1Child0.getComputedTop()).toBe(0); + expect(rootChild1Child0.getComputedWidth()).toBe(106); + expect(rootChild1Child0.getComputedHeight()).toBe(10); - expect(root_child2.getComputedLeft()).toBe(213); - expect(root_child2.getComputedTop()).toBe(0); - expect(root_child2.getComputedWidth()).toBe(107); - expect(root_child2.getComputedHeight()).toBe(10); + expect(rootChild2.getComputedLeft()).toBe(213); + expect(rootChild2.getComputedTop()).toBe(0); + expect(rootChild2.getComputedWidth()).toBe(107); + expect(rootChild2.getComputedHeight()).toBe(10); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -765,50 +765,50 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(320); expect(root.getComputedHeight()).toBe(10); - expect(root_child0.getComputedLeft()).toBe(213); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(107); - expect(root_child0.getComputedHeight()).toBe(10); - - expect(root_child1.getComputedLeft()).toBe(107); - expect(root_child1.getComputedTop()).toBe(0); - expect(root_child1.getComputedWidth()).toBe(106); - expect(root_child1.getComputedHeight()).toBe(10); - - expect(root_child1_child0.getComputedLeft()).toBe(0); - expect(root_child1_child0.getComputedTop()).toBe(0); - expect(root_child1_child0.getComputedWidth()).toBe(106); - expect(root_child1_child0.getComputedHeight()).toBe(10); - - expect(root_child2.getComputedLeft()).toBe(0); - expect(root_child2.getComputedTop()).toBe(0); - expect(root_child2.getComputedWidth()).toBe(107); - expect(root_child2.getComputedHeight()).toBe(10); + expect(rootChild0.getComputedLeft()).toBe(213); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(107); + expect(rootChild0.getComputedHeight()).toBe(10); + + expect(rootChild1.getComputedLeft()).toBe(107); + expect(rootChild1.getComputedTop()).toBe(0); + expect(rootChild1.getComputedWidth()).toBe(106); + expect(rootChild1.getComputedHeight()).toBe(10); + + expect(rootChild1Child0.getComputedLeft()).toBe(0); + expect(rootChild1Child0.getComputedTop()).toBe(0); + expect(rootChild1Child0.getComputedWidth()).toBe(106); + expect(rootChild1Child0.getComputedHeight()).toBe(10); + + expect(rootChild2.getComputedLeft()).toBe(0); + expect(rootChild2.getComputedTop()).toBe(0); + expect(rootChild2.getComputedWidth()).toBe(107); + expect(rootChild2.getComputedHeight()).toBe(10); }); test('rounding_inner_node_controversy_vertical', () => { const root = Yoga.Node.create(); root.setHeight(320); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setWidth(10); - root.insertChild(root_child0, 0); - - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(1); - root_child1.setWidth(10); - root.insertChild(root_child1, 1); - - const root_child1_child0 = Yoga.Node.create(); - root_child1_child0.setFlexGrow(1); - root_child1_child0.setWidth(10); - root_child1.insertChild(root_child1_child0, 0); - - const root_child2 = Yoga.Node.create(); - root_child2.setFlexGrow(1); - root_child2.setWidth(10); - root.insertChild(root_child2, 2); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setWidth(10); + root.insertChild(rootChild0, 0); + + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(1); + rootChild1.setWidth(10); + root.insertChild(rootChild1, 1); + + const rootChild1Child0 = Yoga.Node.create(); + rootChild1Child0.setFlexGrow(1); + rootChild1Child0.setWidth(10); + rootChild1.insertChild(rootChild1Child0, 0); + + const rootChild2 = Yoga.Node.create(); + rootChild2.setFlexGrow(1); + rootChild2.setWidth(10); + root.insertChild(rootChild2, 2); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); @@ -816,25 +816,25 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(10); expect(root.getComputedHeight()).toBe(320); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(10); - expect(root_child0.getComputedHeight()).toBe(107); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(10); + expect(rootChild0.getComputedHeight()).toBe(107); - expect(root_child1.getComputedLeft()).toBe(0); - expect(root_child1.getComputedTop()).toBe(107); - expect(root_child1.getComputedWidth()).toBe(10); - expect(root_child1.getComputedHeight()).toBe(106); + expect(rootChild1.getComputedLeft()).toBe(0); + expect(rootChild1.getComputedTop()).toBe(107); + expect(rootChild1.getComputedWidth()).toBe(10); + expect(rootChild1.getComputedHeight()).toBe(106); - expect(root_child1_child0.getComputedLeft()).toBe(0); - expect(root_child1_child0.getComputedTop()).toBe(0); - expect(root_child1_child0.getComputedWidth()).toBe(10); - expect(root_child1_child0.getComputedHeight()).toBe(106); + expect(rootChild1Child0.getComputedLeft()).toBe(0); + expect(rootChild1Child0.getComputedTop()).toBe(0); + expect(rootChild1Child0.getComputedWidth()).toBe(10); + expect(rootChild1Child0.getComputedHeight()).toBe(106); - expect(root_child2.getComputedLeft()).toBe(0); - expect(root_child2.getComputedTop()).toBe(213); - expect(root_child2.getComputedWidth()).toBe(10); - expect(root_child2.getComputedHeight()).toBe(107); + expect(rootChild2.getComputedLeft()).toBe(0); + expect(rootChild2.getComputedTop()).toBe(213); + expect(rootChild2.getComputedWidth()).toBe(10); + expect(rootChild2.getComputedHeight()).toBe(107); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -843,25 +843,25 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(10); expect(root.getComputedHeight()).toBe(320); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(10); - expect(root_child0.getComputedHeight()).toBe(107); - - expect(root_child1.getComputedLeft()).toBe(0); - expect(root_child1.getComputedTop()).toBe(107); - expect(root_child1.getComputedWidth()).toBe(10); - expect(root_child1.getComputedHeight()).toBe(106); - - expect(root_child1_child0.getComputedLeft()).toBe(0); - expect(root_child1_child0.getComputedTop()).toBe(0); - expect(root_child1_child0.getComputedWidth()).toBe(10); - expect(root_child1_child0.getComputedHeight()).toBe(106); - - expect(root_child2.getComputedLeft()).toBe(0); - expect(root_child2.getComputedTop()).toBe(213); - expect(root_child2.getComputedWidth()).toBe(10); - expect(root_child2.getComputedHeight()).toBe(107); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(10); + expect(rootChild0.getComputedHeight()).toBe(107); + + expect(rootChild1.getComputedLeft()).toBe(0); + expect(rootChild1.getComputedTop()).toBe(107); + expect(rootChild1.getComputedWidth()).toBe(10); + expect(rootChild1.getComputedHeight()).toBe(106); + + expect(rootChild1Child0.getComputedLeft()).toBe(0); + expect(rootChild1Child0.getComputedTop()).toBe(0); + expect(rootChild1Child0.getComputedWidth()).toBe(10); + expect(rootChild1Child0.getComputedHeight()).toBe(106); + + expect(rootChild2.getComputedLeft()).toBe(0); + expect(rootChild2.getComputedTop()).toBe(213); + expect(rootChild2.getComputedWidth()).toBe(10); + expect(rootChild2.getComputedHeight()).toBe(107); }); test('rounding_inner_node_controversy_combined', () => { @@ -870,40 +870,40 @@ describe('Rounding', () => { root.setWidth(640); root.setHeight(320); - const root_child0 = Yoga.Node.create(); - root_child0.setFlexGrow(1); - root_child0.setHeightPercent(100); - root.insertChild(root_child0, 0); - - const root_child1 = Yoga.Node.create(); - root_child1.setFlexGrow(1); - root_child1.setHeightPercent(100); - root.insertChild(root_child1, 1); - - const root_child1_child0 = Yoga.Node.create(); - root_child1_child0.setFlexGrow(1); - root_child1_child0.setWidthPercent(100); - root_child1.insertChild(root_child1_child0, 0); - - const root_child1_child1 = Yoga.Node.create(); - root_child1_child1.setFlexGrow(1); - root_child1_child1.setWidthPercent(100); - root_child1.insertChild(root_child1_child1, 1); - - const root_child1_child1_child0 = Yoga.Node.create(); - root_child1_child1_child0.setFlexGrow(1); - root_child1_child1_child0.setWidthPercent(100); - root_child1_child1.insertChild(root_child1_child1_child0, 0); - - const root_child1_child2 = Yoga.Node.create(); - root_child1_child2.setFlexGrow(1); - root_child1_child2.setWidthPercent(100); - root_child1.insertChild(root_child1_child2, 2); - - const root_child2 = Yoga.Node.create(); - root_child2.setFlexGrow(1); - root_child2.setHeightPercent(100); - root.insertChild(root_child2, 2); + const rootChild0 = Yoga.Node.create(); + rootChild0.setFlexGrow(1); + rootChild0.setHeightPercent(100); + root.insertChild(rootChild0, 0); + + const rootChild1 = Yoga.Node.create(); + rootChild1.setFlexGrow(1); + rootChild1.setHeightPercent(100); + root.insertChild(rootChild1, 1); + + const rootChild1Child0 = Yoga.Node.create(); + rootChild1Child0.setFlexGrow(1); + rootChild1Child0.setWidthPercent(100); + rootChild1.insertChild(rootChild1Child0, 0); + + const rootChild1Child1 = Yoga.Node.create(); + rootChild1Child1.setFlexGrow(1); + rootChild1Child1.setWidthPercent(100); + rootChild1.insertChild(rootChild1Child1, 1); + + const rootChild1Child1Child0 = Yoga.Node.create(); + rootChild1Child1Child0.setFlexGrow(1); + rootChild1Child1Child0.setWidthPercent(100); + rootChild1Child1.insertChild(rootChild1Child1Child0, 0); + + const rootChild1Child2 = Yoga.Node.create(); + rootChild1Child2.setFlexGrow(1); + rootChild1Child2.setWidthPercent(100); + rootChild1.insertChild(rootChild1Child2, 2); + + const rootChild2 = Yoga.Node.create(); + rootChild2.setFlexGrow(1); + rootChild2.setHeightPercent(100); + root.insertChild(rootChild2, 2); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); @@ -911,40 +911,40 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(640); expect(root.getComputedHeight()).toBe(320); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(213); - expect(root_child0.getComputedHeight()).toBe(320); - - expect(root_child1.getComputedLeft()).toBe(213); - expect(root_child1.getComputedTop()).toBe(0); - expect(root_child1.getComputedWidth()).toBe(214); - expect(root_child1.getComputedHeight()).toBe(320); - - expect(root_child1_child0.getComputedLeft()).toBe(0); - expect(root_child1_child0.getComputedTop()).toBe(0); - expect(root_child1_child0.getComputedWidth()).toBe(214); - expect(root_child1_child0.getComputedHeight()).toBe(107); - - expect(root_child1_child1.getComputedLeft()).toBe(0); - expect(root_child1_child1.getComputedTop()).toBe(107); - expect(root_child1_child1.getComputedWidth()).toBe(214); - expect(root_child1_child1.getComputedHeight()).toBe(106); - - expect(root_child1_child1_child0.getComputedLeft()).toBe(0); - expect(root_child1_child1_child0.getComputedTop()).toBe(0); - expect(root_child1_child1_child0.getComputedWidth()).toBe(214); - expect(root_child1_child1_child0.getComputedHeight()).toBe(106); - - expect(root_child1_child2.getComputedLeft()).toBe(0); - expect(root_child1_child2.getComputedTop()).toBe(213); - expect(root_child1_child2.getComputedWidth()).toBe(214); - expect(root_child1_child2.getComputedHeight()).toBe(107); - - expect(root_child2.getComputedLeft()).toBe(427); - expect(root_child2.getComputedTop()).toBe(0); - expect(root_child2.getComputedWidth()).toBe(213); - expect(root_child2.getComputedHeight()).toBe(320); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(213); + expect(rootChild0.getComputedHeight()).toBe(320); + + expect(rootChild1.getComputedLeft()).toBe(213); + expect(rootChild1.getComputedTop()).toBe(0); + expect(rootChild1.getComputedWidth()).toBe(214); + expect(rootChild1.getComputedHeight()).toBe(320); + + expect(rootChild1Child0.getComputedLeft()).toBe(0); + expect(rootChild1Child0.getComputedTop()).toBe(0); + expect(rootChild1Child0.getComputedWidth()).toBe(214); + expect(rootChild1Child0.getComputedHeight()).toBe(107); + + expect(rootChild1Child1.getComputedLeft()).toBe(0); + expect(rootChild1Child1.getComputedTop()).toBe(107); + expect(rootChild1Child1.getComputedWidth()).toBe(214); + expect(rootChild1Child1.getComputedHeight()).toBe(106); + + expect(rootChild1Child1Child0.getComputedLeft()).toBe(0); + expect(rootChild1Child1Child0.getComputedTop()).toBe(0); + expect(rootChild1Child1Child0.getComputedWidth()).toBe(214); + expect(rootChild1Child1Child0.getComputedHeight()).toBe(106); + + expect(rootChild1Child2.getComputedLeft()).toBe(0); + expect(rootChild1Child2.getComputedTop()).toBe(213); + expect(rootChild1Child2.getComputedWidth()).toBe(214); + expect(rootChild1Child2.getComputedHeight()).toBe(107); + + expect(rootChild2.getComputedLeft()).toBe(427); + expect(rootChild2.getComputedTop()).toBe(0); + expect(rootChild2.getComputedWidth()).toBe(213); + expect(rootChild2.getComputedHeight()).toBe(320); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -953,39 +953,39 @@ describe('Rounding', () => { expect(root.getComputedWidth()).toBe(640); expect(root.getComputedHeight()).toBe(320); - expect(root_child0.getComputedLeft()).toBe(427); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(213); - expect(root_child0.getComputedHeight()).toBe(320); - - expect(root_child1.getComputedLeft()).toBe(213); - expect(root_child1.getComputedTop()).toBe(0); - expect(root_child1.getComputedWidth()).toBe(214); - expect(root_child1.getComputedHeight()).toBe(320); - - expect(root_child1_child0.getComputedLeft()).toBe(0); - expect(root_child1_child0.getComputedTop()).toBe(0); - expect(root_child1_child0.getComputedWidth()).toBe(214); - expect(root_child1_child0.getComputedHeight()).toBe(107); - - expect(root_child1_child1.getComputedLeft()).toBe(0); - expect(root_child1_child1.getComputedTop()).toBe(107); - expect(root_child1_child1.getComputedWidth()).toBe(214); - expect(root_child1_child1.getComputedHeight()).toBe(106); - - expect(root_child1_child1_child0.getComputedLeft()).toBe(0); - expect(root_child1_child1_child0.getComputedTop()).toBe(0); - expect(root_child1_child1_child0.getComputedWidth()).toBe(214); - expect(root_child1_child1_child0.getComputedHeight()).toBe(106); - - expect(root_child1_child2.getComputedLeft()).toBe(0); - expect(root_child1_child2.getComputedTop()).toBe(213); - expect(root_child1_child2.getComputedWidth()).toBe(214); - expect(root_child1_child2.getComputedHeight()).toBe(107); - - expect(root_child2.getComputedLeft()).toBe(0); - expect(root_child2.getComputedTop()).toBe(0); - expect(root_child2.getComputedWidth()).toBe(213); - expect(root_child2.getComputedHeight()).toBe(320); + expect(rootChild0.getComputedLeft()).toBe(427); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(213); + expect(rootChild0.getComputedHeight()).toBe(320); + + expect(rootChild1.getComputedLeft()).toBe(213); + expect(rootChild1.getComputedTop()).toBe(0); + expect(rootChild1.getComputedWidth()).toBe(214); + expect(rootChild1.getComputedHeight()).toBe(320); + + expect(rootChild1Child0.getComputedLeft()).toBe(0); + expect(rootChild1Child0.getComputedTop()).toBe(0); + expect(rootChild1Child0.getComputedWidth()).toBe(214); + expect(rootChild1Child0.getComputedHeight()).toBe(107); + + expect(rootChild1Child1.getComputedLeft()).toBe(0); + expect(rootChild1Child1.getComputedTop()).toBe(107); + expect(rootChild1Child1.getComputedWidth()).toBe(214); + expect(rootChild1Child1.getComputedHeight()).toBe(106); + + expect(rootChild1Child1Child0.getComputedLeft()).toBe(0); + expect(rootChild1Child1Child0.getComputedTop()).toBe(0); + expect(rootChild1Child1Child0.getComputedWidth()).toBe(214); + expect(rootChild1Child1Child0.getComputedHeight()).toBe(106); + + expect(rootChild1Child2.getComputedLeft()).toBe(0); + expect(rootChild1Child2.getComputedTop()).toBe(213); + expect(rootChild1Child2.getComputedWidth()).toBe(214); + expect(rootChild1Child2.getComputedHeight()).toBe(107); + + expect(rootChild2.getComputedLeft()).toBe(0); + expect(rootChild2.getComputedTop()).toBe(0); + expect(rootChild2.getComputedWidth()).toBe(213); + expect(rootChild2.getComputedHeight()).toBe(320); }); }); diff --git a/packages/yoga/tests/sizeOverflow.test.js b/packages/yoga/tests/sizeOverflow.test.js index 79de2d9d4..42009bd78 100644 --- a/packages/yoga/tests/sizeOverflow.test.js +++ b/packages/yoga/tests/sizeOverflow.test.js @@ -6,13 +6,13 @@ describe('Size overflow', () => { root.setWidth(100); root.setHeight(100); - const root_child0 = Yoga.Node.create(); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + root.insertChild(rootChild0, 0); - const root_child0_child0 = Yoga.Node.create(); - root_child0_child0.setWidth(200); - root_child0_child0.setHeight(200); - root_child0.insertChild(root_child0_child0, 0); + const rootChild0Child0 = Yoga.Node.create(); + rootChild0Child0.setWidth(200); + rootChild0Child0.setHeight(200); + rootChild0.insertChild(rootChild0Child0, 0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); @@ -20,15 +20,15 @@ describe('Size overflow', () => { expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(100); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(100); - expect(root_child0.getComputedHeight()).toBe(200); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(100); + expect(rootChild0.getComputedHeight()).toBe(200); - expect(root_child0_child0.getComputedLeft()).toBe(0); - expect(root_child0_child0.getComputedTop()).toBe(0); - expect(root_child0_child0.getComputedWidth()).toBe(200); - expect(root_child0_child0.getComputedHeight()).toBe(200); + expect(rootChild0Child0.getComputedLeft()).toBe(0); + expect(rootChild0Child0.getComputedTop()).toBe(0); + expect(rootChild0Child0.getComputedWidth()).toBe(200); + expect(rootChild0Child0.getComputedHeight()).toBe(200); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -37,15 +37,15 @@ describe('Size overflow', () => { expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(100); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(100); - expect(root_child0.getComputedHeight()).toBe(200); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(100); + expect(rootChild0.getComputedHeight()).toBe(200); - expect(root_child0_child0.getComputedLeft()).toBe(-100); - expect(root_child0_child0.getComputedTop()).toBe(0); - expect(root_child0_child0.getComputedWidth()).toBe(200); - expect(root_child0_child0.getComputedHeight()).toBe(200); + expect(rootChild0Child0.getComputedLeft()).toBe(-100); + expect(rootChild0Child0.getComputedTop()).toBe(0); + expect(rootChild0Child0.getComputedWidth()).toBe(200); + expect(rootChild0Child0.getComputedHeight()).toBe(200); }); test('nested_overflowing_child_in_constraint_parent', () => { @@ -53,15 +53,15 @@ describe('Size overflow', () => { root.setWidth(100); root.setHeight(100); - const root_child0 = Yoga.Node.create(); - root_child0.setWidth(100); - root_child0.setHeight(100); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setWidth(100); + rootChild0.setHeight(100); + root.insertChild(rootChild0, 0); - const root_child0_child0 = Yoga.Node.create(); - root_child0_child0.setWidth(200); - root_child0_child0.setHeight(200); - root_child0.insertChild(root_child0_child0, 0); + const rootChild0Child0 = Yoga.Node.create(); + rootChild0Child0.setWidth(200); + rootChild0Child0.setHeight(200); + rootChild0.insertChild(rootChild0Child0, 0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); @@ -69,15 +69,15 @@ describe('Size overflow', () => { expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(100); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(100); - expect(root_child0.getComputedHeight()).toBe(100); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(100); + expect(rootChild0.getComputedHeight()).toBe(100); - expect(root_child0_child0.getComputedLeft()).toBe(0); - expect(root_child0_child0.getComputedTop()).toBe(0); - expect(root_child0_child0.getComputedWidth()).toBe(200); - expect(root_child0_child0.getComputedHeight()).toBe(200); + expect(rootChild0Child0.getComputedLeft()).toBe(0); + expect(rootChild0Child0.getComputedTop()).toBe(0); + expect(rootChild0Child0.getComputedWidth()).toBe(200); + expect(rootChild0Child0.getComputedHeight()).toBe(200); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -86,15 +86,15 @@ describe('Size overflow', () => { expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(100); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(100); - expect(root_child0.getComputedHeight()).toBe(100); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(100); + expect(rootChild0.getComputedHeight()).toBe(100); - expect(root_child0_child0.getComputedLeft()).toBe(-100); - expect(root_child0_child0.getComputedTop()).toBe(0); - expect(root_child0_child0.getComputedWidth()).toBe(200); - expect(root_child0_child0.getComputedHeight()).toBe(200); + expect(rootChild0Child0.getComputedLeft()).toBe(-100); + expect(rootChild0Child0.getComputedTop()).toBe(0); + expect(rootChild0Child0.getComputedWidth()).toBe(200); + expect(rootChild0Child0.getComputedHeight()).toBe(200); }); test('parent_wrap_child_size_overflowing_parent', () => { @@ -102,14 +102,14 @@ describe('Size overflow', () => { root.setWidth(100); root.setHeight(100); - const root_child0 = Yoga.Node.create(); - root_child0.setWidth(100); - root.insertChild(root_child0, 0); + const rootChild0 = Yoga.Node.create(); + rootChild0.setWidth(100); + root.insertChild(rootChild0, 0); - const root_child0_child0 = Yoga.Node.create(); - root_child0_child0.setWidth(100); - root_child0_child0.setHeight(200); - root_child0.insertChild(root_child0_child0, 0); + const rootChild0Child0 = Yoga.Node.create(); + rootChild0Child0.setWidth(100); + rootChild0Child0.setHeight(200); + rootChild0.insertChild(rootChild0Child0, 0); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_LTR); expect(root.getComputedLeft()).toBe(0); @@ -117,15 +117,15 @@ describe('Size overflow', () => { expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(100); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(100); - expect(root_child0.getComputedHeight()).toBe(200); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(100); + expect(rootChild0.getComputedHeight()).toBe(200); - expect(root_child0_child0.getComputedLeft()).toBe(0); - expect(root_child0_child0.getComputedTop()).toBe(0); - expect(root_child0_child0.getComputedWidth()).toBe(100); - expect(root_child0_child0.getComputedHeight()).toBe(200); + expect(rootChild0Child0.getComputedLeft()).toBe(0); + expect(rootChild0Child0.getComputedTop()).toBe(0); + expect(rootChild0Child0.getComputedWidth()).toBe(100); + expect(rootChild0Child0.getComputedHeight()).toBe(200); root.calculateLayout(undefined, undefined, Yoga.DIRECTION_RTL); @@ -134,14 +134,14 @@ describe('Size overflow', () => { expect(root.getComputedWidth()).toBe(100); expect(root.getComputedHeight()).toBe(100); - expect(root_child0.getComputedLeft()).toBe(0); - expect(root_child0.getComputedTop()).toBe(0); - expect(root_child0.getComputedWidth()).toBe(100); - expect(root_child0.getComputedHeight()).toBe(200); + expect(rootChild0.getComputedLeft()).toBe(0); + expect(rootChild0.getComputedTop()).toBe(0); + expect(rootChild0.getComputedWidth()).toBe(100); + expect(rootChild0.getComputedHeight()).toBe(200); - expect(root_child0_child0.getComputedLeft()).toBe(0); - expect(root_child0_child0.getComputedTop()).toBe(0); - expect(root_child0_child0.getComputedWidth()).toBe(100); - expect(root_child0_child0.getComputedHeight()).toBe(200); + expect(rootChild0Child0.getComputedLeft()).toBe(0); + expect(rootChild0Child0.getComputedTop()).toBe(0); + expect(rootChild0Child0.getComputedWidth()).toBe(100); + expect(rootChild0Child0.getComputedHeight()).toBe(200); }); });