test(breadcrumb): add unit tests

This commit is contained in:
Eric Liu 2025-02-26 19:41:32 -08:00
commit 63fdb75664
6 changed files with 153 additions and 35 deletions

View file

@ -0,0 +1,19 @@
<script lang="ts">
import { Breadcrumb, BreadcrumbItem } from "carbon-components-svelte";
type BreadcrumbItemType = { href?: string; text: string };
export let items: BreadcrumbItemType[] = [
{ href: "/", text: "Dashboard" },
{ href: "/reports", text: "Annual reports" },
{ href: "/reports/2019", text: "2019" },
];
</script>
<Breadcrumb>
{#each items as item, i}
<BreadcrumbItem href={item.href} isCurrentPage={i === items.length - 1}>
{item.text}
</BreadcrumbItem>
{/each}
</Breadcrumb>