mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
test(tooltip): add unit tests
This commit is contained in:
parent
e100429374
commit
b8bff110a5
10 changed files with 263 additions and 54 deletions
27
tests/Tooltip/TooltipEvents.test.svelte
Normal file
27
tests/Tooltip/TooltipEvents.test.svelte
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue