Files
vue-tui/packages/runtime-tests/integration/quickstart.test.tsx
T
Yunfei He a7f7d9957d 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>
2026-05-24 18:13:53 +08:00

23 lines
639 B
TypeScript

import { defineComponent, ref } from "vue";
import { expect, test } from "vite-plus/test";
import { render } from "@vue-tui/testing";
import { Box, Text, useInput } from "@vue-tui/runtime";
test("README quickstart code runs to a Count: 0 frame", async () => {
const Counter = defineComponent(() => {
const count = ref(0);
useInput((input) => {
if (input === "+") count.value++;
if (input === "-") count.value--;
});
return () => (
<Box>
<Text>Count: {count.value}</Text>
</Box>
);
});
const { lastFrame } = await render(Counter);
expect(lastFrame()).toContain("Count: 0");
});