test(truncate): add unit tests

This commit is contained in:
Eric Liu 2025-03-16 17:22:05 -07:00
commit 3cf1112e52
4 changed files with 123 additions and 22 deletions

View file

@ -0,0 +1,11 @@
<script lang="ts">
import { Truncate } from "carbon-components-svelte";
export let clamp: "end" | "front" = "end";
export let text =
"This is a long text that should be truncated when it exceeds the available space";
</script>
<Truncate {clamp}>
{text}
</Truncate>