feat(runtime-tests): integration test suite

21 test files covering components, composables, focus, lifecycle,
and scheduler through the public render() API.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yunfei He
2026-05-24 18:13:53 +08:00
parent 71c517b79f
commit a7f7d9957d
24 changed files with 997 additions and 0 deletions
@@ -0,0 +1,20 @@
import { expect, test } from "vite-plus/test";
import { render } from "@vue-tui/testing";
import { Text } from "@vue-tui/runtime";
test("nested Text renders inline without independent layout", async () => {
const { lastFrame } = await render(() => (
<Text>
Hello <Text color="red">world</Text>
</Text>
));
const frame = lastFrame()!;
expect(frame).toContain("Hello");
expect(frame).toContain("world");
});
test("CJK wide characters render without corruption", async () => {
const { lastFrame } = await render(() => <Text>中文测试</Text>, { columns: 20 });
const frame = lastFrame()!;
expect(frame).toContain("中文测试");
});