test(overflow-menu): add unit tests

This commit is contained in:
Eric Liu 2025-01-29 19:28:16 -08:00
commit 306e09961f
4 changed files with 120 additions and 81 deletions

View file

@ -0,0 +1,30 @@
<script lang="ts">
import { OverflowMenu, OverflowMenuItem } from "carbon-components-svelte";
</script>
<OverflowMenu
on:close={(e) => {
console.log("close", e.detail); // { index: number; text: string; }
}}
>
<OverflowMenuItem
text="Manage credentials"
on:click={() => {
console.log("click", "Manage credentials");
}}
/>
<OverflowMenuItem
href="https://cloud.ibm.com/docs/api-gateway/"
text="API documentation"
on:click={() => {
console.log("click", "API documentation");
}}
/>
<OverflowMenuItem
danger
text="Delete service"
on:click={() => {
console.log("click", "Delete service");
}}
/>
</OverflowMenu>