test(search): add unit tests

This commit is contained in:
Eric Liu 2025-03-15 17:32:47 -07:00
commit e876553790
5 changed files with 130 additions and 21 deletions

View file

@ -0,0 +1,22 @@
<script lang="ts">
import { Search } from "carbon-components-svelte";
let expanded = false;
let value = "";
</script>
<Search
bind:expanded
bind:value
expandable
labelText="Expandable search"
placeholder="Search expandable..."
on:expand={() => {
console.log("expanded");
}}
on:collapse={() => {
console.log("collapsed");
}}
/>
<div>Status: {expanded ? "expanded" : "collapsed"}</div>