a7f7d9957d
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>
22 lines
637 B
TypeScript
22 lines
637 B
TypeScript
import { defineComponent } from "vue";
|
|
import { expect, test } from "vite-plus/test";
|
|
import { render } from "@vue-tui/testing";
|
|
import { Text, useTerminalSize } from "@vue-tui/runtime";
|
|
|
|
test("useTerminalSize reacts to resize event", async () => {
|
|
const App = defineComponent(() => {
|
|
const { columns, rows } = useTerminalSize();
|
|
return () => (
|
|
<Text>
|
|
{columns.value}x{rows.value}
|
|
</Text>
|
|
);
|
|
});
|
|
|
|
const { lastFrame, terminal } = await render(App, { columns: 80, rows: 24 });
|
|
expect(lastFrame()).toContain("80x24");
|
|
|
|
await terminal.resize(120, 40);
|
|
expect(lastFrame()).toContain("120x40");
|
|
});
|