mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
test(progress-indicator): add unit tests
This commit is contained in:
parent
bf4f370537
commit
2bb4e2f816
3 changed files with 282 additions and 83 deletions
35
tests/ProgressIndicator/ProgressIndicator.test.svelte
Normal file
35
tests/ProgressIndicator/ProgressIndicator.test.svelte
Normal file
|
@ -0,0 +1,35 @@
|
|||
<script lang="ts">
|
||||
import { ProgressIndicator, ProgressStep } from "carbon-components-svelte";
|
||||
|
||||
export let currentIndex = 0;
|
||||
export let vertical = false;
|
||||
export let spaceEqually = false;
|
||||
export let preventChangeOnClick = false;
|
||||
export let steps: Array<{
|
||||
label: string;
|
||||
description: string;
|
||||
complete: boolean;
|
||||
invalid?: boolean;
|
||||
disabled?: boolean;
|
||||
}> = [];
|
||||
</script>
|
||||
|
||||
<ProgressIndicator
|
||||
{currentIndex}
|
||||
{vertical}
|
||||
{spaceEqually}
|
||||
{preventChangeOnClick}
|
||||
on:change={(e) => {
|
||||
console.log("change", e.detail);
|
||||
}}
|
||||
>
|
||||
{#each steps as step}
|
||||
<ProgressStep
|
||||
label={step.label}
|
||||
description={step.description}
|
||||
complete={step.complete}
|
||||
invalid={step.invalid}
|
||||
disabled={step.disabled}
|
||||
/>
|
||||
{/each}
|
||||
</ProgressIndicator>
|
Loading…
Add table
Add a link
Reference in a new issue