[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 stretch-sizing

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

+30
+30
test/stretch-sizing.test.ts
··· 1 + import { describe, expect, it } from "./suite.ts"; 2 + import { createTerm } from "../term.ts"; 3 + import { close, fixed, open, text } from "../ops.ts"; 4 + 5 + describe("stretch sizing", () => { 6 + it("stretch sizing fills the container cross axis", async () => { 7 + let term = await createTerm({ width: 12, height: 5 }); 8 + let r = term.render([ 9 + open("root", { 10 + layout: { width: fixed(12), height: fixed(5), direction: "ttb" }, 11 + }), 12 + // stretch() on the cross axis should expand the fit-content child to 13 + // fill the container width; cast since the sizing type is proposed. 14 + open("child", { 15 + layout: { 16 + // deno-lint-ignore no-explicit-any 17 + width: { type: "stretch" } as any, 18 + height: fixed(3), 19 + }, 20 + }), 21 + text("X"), 22 + close(), 23 + close(), 24 + ]); 25 + 26 + // pins: a stretch child grows to the container's cross-axis width (12), 27 + // rather than the unstretched width it computes today 28 + expect(r.info.get("child")!.bounds.width).toBe(12); 29 + }); 30 + });