test(tooltip): add unit tests

This commit is contained in:
Eric Liu 2025-03-02 14:10:00 -08:00
commit b8bff110a5
10 changed files with 263 additions and 54 deletions

View file

@ -0,0 +1,27 @@
<script lang="ts">
import { Tooltip } from "carbon-components-svelte";
let openCount = 0;
let closeCount = 0;
function handleOpen() {
openCount += 1;
}
function handleClose() {
closeCount += 1;
}
</script>
<div>
<p>Open events: {openCount}</p>
<p>Close events: {closeCount}</p>
<Tooltip
iconDescription="Information"
on:open={handleOpen}
on:close={handleClose}
>
Interact with this tooltip to trigger events
</Tooltip>
</div>