Files
yoga/javascript/tests/generated/grid_align_items_baseline_multiline_column.test.ts
zeekay 1c508dd3df publish the JavaScript package as @hanzo/layout 3.3.0
The package name is also the specifier every test and the playground import, so
it moves as one piece: package.json, the tsconfig path, the generator, and the
website workspace that depends on it. Generated tests are re-signed.

Dated blog posts keep the old name - they are a record of upstream's 2.0 and 3.0
releases, not instructions for this package.
2026-08-28 11:58:17 -07:00

155 lines
5.3 KiB
TypeScript

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<e872632455a5897a5712a863a4cc2415>>
* generated by gentest/src/GentestDriver.ts from gentest/fixtures/grid_align_items_baseline_multiline_column.html
*/
import { intrinsicSizeMeasureFunc } from '../tools/utils.ts'
import Yoga from '@hanzo/layout';
import {
Align,
BoxSizing,
Direction,
Display,
Edge,
Errata,
ExperimentalFeature,
FlexDirection,
GridTrackType,
Gutter,
Justify,
MeasureMode,
Overflow,
PositionType,
Unit,
Wrap,
} from '@hanzo/layout';
test('grid_align_items_baseline_multiline_column', () => {
const config = Yoga.Config.create();
const root = Yoga.Node.create(config);
root.setPositionType(PositionType.Absolute);
root.setDisplay(Display.Grid);
const rootGridTemplateColumns = [];
rootGridTemplateColumns.push({type: GridTrackType.Auto});
rootGridTemplateColumns.push({type: GridTrackType.Auto});
root.setGridTemplateColumns(rootGridTemplateColumns);
root.setWidth(100);
root.setHeight(100);
root.setAlignItems(Align.Baseline);
const root_child0 = Yoga.Node.create(config);
root_child0.setDisplay(Display.Grid);
root_child0.setWidth(50);
root_child0.setHeight(50);
root.insertChild(root_child0, 0);
const root_child1 = Yoga.Node.create(config);
root_child1.setDisplay(Display.Grid);
root_child1.setWidth(30);
root_child1.setHeight(50);
root.insertChild(root_child1, 1);
const root_child1_child0 = Yoga.Node.create(config);
root_child1_child0.setDisplay(Display.Grid);
root_child1_child0.setWidth(20);
root_child1_child0.setHeight(20);
root_child1.insertChild(root_child1_child0, 0);
const root_child2 = Yoga.Node.create(config);
root_child2.setDisplay(Display.Grid);
root_child2.setWidth(40);
root_child2.setHeight(70);
root.insertChild(root_child2, 2);
const root_child2_child0 = Yoga.Node.create(config);
root_child2_child0.setDisplay(Display.Grid);
root_child2_child0.setWidth(10);
root_child2_child0.setHeight(10);
root_child2.insertChild(root_child2_child0, 0);
const root_child3 = Yoga.Node.create(config);
root_child3.setDisplay(Display.Grid);
root_child3.setWidth(50);
root_child3.setHeight(20);
root.insertChild(root_child3, 3);
root.calculateLayout(undefined, undefined, Direction.LTR);
expect(root.getComputedLeft()).toBe(0);
expect(root.getComputedTop()).toBe(0);
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(50);
expect(root_child0.getComputedHeight()).toBe(50);
expect(root_child1.getComputedLeft()).toBe(50);
expect(root_child1.getComputedTop()).toBe(30);
expect(root_child1.getComputedWidth()).toBe(30);
expect(root_child1.getComputedHeight()).toBe(50);
expect(root_child1_child0.getComputedLeft()).toBe(0);
expect(root_child1_child0.getComputedTop()).toBe(0);
expect(root_child1_child0.getComputedWidth()).toBe(20);
expect(root_child1_child0.getComputedHeight()).toBe(20);
expect(root_child2.getComputedLeft()).toBe(0);
expect(root_child2.getComputedTop()).toBe(90);
expect(root_child2.getComputedWidth()).toBe(40);
expect(root_child2.getComputedHeight()).toBe(70);
expect(root_child2_child0.getComputedLeft()).toBe(0);
expect(root_child2_child0.getComputedTop()).toBe(0);
expect(root_child2_child0.getComputedWidth()).toBe(10);
expect(root_child2_child0.getComputedHeight()).toBe(10);
expect(root_child3.getComputedLeft()).toBe(50);
expect(root_child3.getComputedTop()).toBe(80);
expect(root_child3.getComputedWidth()).toBe(50);
expect(root_child3.getComputedHeight()).toBe(20);
root.calculateLayout(undefined, undefined, Direction.RTL);
expect(root.getComputedLeft()).toBe(0);
expect(root.getComputedTop()).toBe(0);
expect(root.getComputedWidth()).toBe(100);
expect(root.getComputedHeight()).toBe(100);
expect(root_child0.getComputedLeft()).toBe(50);
expect(root_child0.getComputedTop()).toBe(0);
expect(root_child0.getComputedWidth()).toBe(50);
expect(root_child0.getComputedHeight()).toBe(50);
expect(root_child1.getComputedLeft()).toBe(20);
expect(root_child1.getComputedTop()).toBe(30);
expect(root_child1.getComputedWidth()).toBe(30);
expect(root_child1.getComputedHeight()).toBe(50);
expect(root_child1_child0.getComputedLeft()).toBe(10);
expect(root_child1_child0.getComputedTop()).toBe(0);
expect(root_child1_child0.getComputedWidth()).toBe(20);
expect(root_child1_child0.getComputedHeight()).toBe(20);
expect(root_child2.getComputedLeft()).toBe(60);
expect(root_child2.getComputedTop()).toBe(90);
expect(root_child2.getComputedWidth()).toBe(40);
expect(root_child2.getComputedHeight()).toBe(70);
expect(root_child2_child0.getComputedLeft()).toBe(30);
expect(root_child2_child0.getComputedTop()).toBe(0);
expect(root_child2_child0.getComputedWidth()).toBe(10);
expect(root_child2_child0.getComputedHeight()).toBe(10);
expect(root_child3.getComputedLeft()).toBe(0);
expect(root_child3.getComputedTop()).toBe(80);
expect(root_child3.getComputedWidth()).toBe(50);
expect(root_child3.getComputedHeight()).toBe(20);
});