[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-content

Nate Moore (Jun 4, 2026, 1:26 AM -0500) 88e97db4 d75fb4b6

+39
+39
test/align-content.test.ts
··· 1 + import { describe, expect, it } from "./suite.ts"; 2 + import { createTerm } from "../term.ts"; 3 + import { close, fit, fixed, open, type OpenElement, text } from "../ops.ts"; 4 + import { print } from "./print.ts"; 5 + 6 + const decode = (b: Uint8Array) => new TextDecoder().decode(b); 7 + const trim = (s: string) => s.split("\n").map((l) => l.trimEnd()).join("\n"); 8 + 9 + // flexWrap/alignContent are not layout keys yet; this shim lets the file 10 + // type-check today. The extra keys are dropped by pack(), so they are inert 11 + // at runtime against the current build. 12 + const layout = (l: Record<string, unknown>): OpenElement["layout"] => 13 + l as unknown as OpenElement["layout"]; 14 + 15 + describe("alignContent", () => { 16 + it("alignContent flex-end pushes flex lines to the cross-axis end", async () => { 17 + // 4 single-cell children in a 2-wide x 6-tall wrap container => 2 lines. 18 + let term = await createTerm({ width: 4, height: 6 }); 19 + let res = term.render([ 20 + open("root", { 21 + layout: layout({ 22 + width: fixed(2), 23 + height: fixed(6), 24 + direction: "ltr", 25 + flexWrap: "wrap", 26 + alignContent: "flex-end", 27 + }), 28 + }), 29 + ...["A", "B", "C", "D"].flatMap((ch) => [ 30 + open(ch.toLowerCase(), { layout: { width: fit(), height: fit() } }), 31 + text(ch), 32 + close(), 33 + ]), 34 + close(), 35 + ]); 36 + // pins: 2 free cross-axis rows pushed above; the two lines land on rows 4-5. 37 + expect(trim(print(decode(res.output), 4, 6))).toBe("\n\n\n\nAB\nCD"); 38 + }); 39 + });