22ecbe0f80
Translates flex, direction, wrap, align, justify, gap, padding, margin, width-height, position, display, and overflow tests from Ink. Adds trimLines mode and trailing-newline strip to test helper. Fixes Box type for alignContent (space-between/around/evenly) and alignSelf (stretch/baseline). 21 tests fail due to behavioral differences (overflow clipping, percentage dimensions, relative position offsets, align-content space-* variants). These represent real gaps to investigate. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
35 lines
866 B
TypeScript
35 lines
866 B
TypeScript
import { defineComponent } from "vue";
|
|
import { expect, test } from "vite-plus/test";
|
|
import { render } from "@vue-tui/testing";
|
|
import { Box, Text } from "@vue-tui/runtime";
|
|
|
|
test("display flex", async () => {
|
|
const { lastFrame } = await render(
|
|
defineComponent(() => () => (
|
|
<Box display="flex">
|
|
<Text>X</Text>
|
|
</Box>
|
|
)),
|
|
{ columns: 100 },
|
|
);
|
|
expect(lastFrame({ trimLines: true })).toBe("X");
|
|
});
|
|
|
|
test("display none", async () => {
|
|
const { lastFrame } = await render(
|
|
defineComponent(() => () => (
|
|
<Box flexDirection="column">
|
|
<Box display="none">
|
|
<Text>Kitty!</Text>
|
|
</Box>
|
|
<Text>Doggo</Text>
|
|
</Box>
|
|
)),
|
|
{ columns: 100 },
|
|
);
|
|
expect(lastFrame({ trimLines: true })).toBe("Doggo");
|
|
});
|
|
|
|
// Skipped: display flex - concurrent
|
|
// Skipped: display none - concurrent
|