mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 02:41:05 +00:00
test(toast-notification): add unit tests
This commit is contained in:
parent
35de0fe0d6
commit
bdaf67c332
5 changed files with 214 additions and 38 deletions
33
tests/ToastNotification/ToastNotification.test.svelte
Normal file
33
tests/ToastNotification/ToastNotification.test.svelte
Normal 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);
|
||||
}}
|
||||
/>
|
Loading…
Add table
Add a link
Reference in a new issue