mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 10:51:06 +00:00
test(tooltip-definition): add unit tests
This commit is contained in:
parent
023b49d050
commit
46728fe065
3 changed files with 184 additions and 29 deletions
26
tests/TooltipDefinition/TooltipDefinition.test.svelte
Normal file
26
tests/TooltipDefinition/TooltipDefinition.test.svelte
Normal file
|
@ -0,0 +1,26 @@
|
|||
<script lang="ts">
|
||||
import { TooltipDefinition } from "carbon-components-svelte";
|
||||
|
||||
export let tooltipText = "Test tooltip text";
|
||||
export let open = false;
|
||||
export let align: "start" | "center" | "end" = "center";
|
||||
export let direction: "top" | "bottom" = "bottom";
|
||||
export let id = "test-tooltip";
|
||||
export let triggerContent = "Tooltip trigger";
|
||||
</script>
|
||||
|
||||
<TooltipDefinition
|
||||
{tooltipText}
|
||||
{open}
|
||||
{align}
|
||||
{direction}
|
||||
{id}
|
||||
on:open={() => {
|
||||
console.log("open");
|
||||
}}
|
||||
on:close={() => {
|
||||
console.log("close");
|
||||
}}
|
||||
>
|
||||
{triggerContent}
|
||||
</TooltipDefinition>
|
Loading…
Add table
Add a link
Reference in a new issue