test(toast-notification): add unit tests

This commit is contained in:
Eric Liu 2025-03-20 12:27:37 -07:00
commit bdaf67c332
5 changed files with 214 additions and 38 deletions

View file

@ -0,0 +1,33 @@
<script lang="ts">
import { ToastNotification } from "carbon-components-svelte";
import type { ComponentProps } from "svelte";
export let kind: ComponentProps<ToastNotification>["kind"] = "error";
export let lowContrast = false;
export let timeout = 0;
export let role = "alert";
export let title = "Error";
export let subtitle = "An internal server error occurred.";
export let caption = "2024-03-21 12:00:00";
export let hideCloseButton = false;
export let fullWidth = false;
export let statusIconDescription = "";
export let closeButtonDescription = "";
</script>
<ToastNotification
{kind}
{lowContrast}
{timeout}
{role}
{title}
{subtitle}
{caption}
{hideCloseButton}
{fullWidth}
{statusIconDescription}
{closeButtonDescription}
on:close={(e) => {
console.log("close", e.detail);
}}
/>