272f1f0c32
Change Box-in-Text validation from dev-only warn+skip to unconditional throw, matching Ink's reconciler behavior. Add text-outside-Text validation that throws when non-empty text-leaf nodes are inserted into box/root/static containers outside a Text context. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
15 lines
406 B
TypeScript
15 lines
406 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("<Box> inside <Text> throws an error", async () => {
|
||
const App = defineComponent(() => () => (
|
||
<Text>
|
||
<Box />
|
||
</Text>
|
||
));
|
||
|
||
await expect(render(App)).rejects.toThrow("can’t be nested inside <Text>");
|
||
});
|