[READ-ONLY] Mirror of https://github.com/bombshell-dev/tty. Platform independent 2D layout engine for terminal applications based on Clay
5

Configure Feed

Select the types of activity you want to include in your feed.

test: failing repro for align-self

Nate Moore (Jun 4, 2026, 10:01 AM -0500) f3a938ba d75fb4b6

+32
+32
test/align-self.test.ts
··· 1 + import { describe, expect, it } from "./suite.ts"; 2 + import { createTerm } from "../term.ts"; 3 + import { close, fit, fixed, open, text } from "../ops.ts"; 4 + 5 + describe("per-child align-self", () => { 6 + it("per-child alignSelf overrides parent cross-axis alignment", async () => { 7 + let term = await createTerm({ width: 12, height: 3 }); 8 + let r = term.render([ 9 + // container default cross-axis alignment (left) 10 + open("root2", { 11 + layout: { width: fixed(12), height: fixed(3), direction: "ttb" }, 12 + }), 13 + // child A keeps the parent default (left) 14 + open("a", { layout: { width: fit(), height: fixed(1) } }), 15 + text("A"), 16 + close(), 17 + // child B overrides to end (right) via the proposed alignSelf field 18 + open("b", { 19 + // deno-lint-ignore no-explicit-any 20 + layout: { width: fit(), height: fixed(1), alignSelf: 1 } as any, 21 + }), 22 + text("B"), 23 + close(), 24 + close(), 25 + ]); 26 + 27 + // pins: A stays at the left edge under the parent default 28 + expect(r.info.get("a")!.bounds.x).toBe(0); 29 + // pins: B diverges to the right edge via its own alignSelf 30 + expect(r.info.get("b")!.bounds.x).toBe(11); 31 + }); 32 + });