mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
test(ordered-list): add unit tests
This commit is contained in:
parent
b6b5579f67
commit
79d50b1a83
3 changed files with 208 additions and 57 deletions
36
tests/OrderedList/OrderedList.test.svelte
Normal file
36
tests/OrderedList/OrderedList.test.svelte
Normal file
|
@ -0,0 +1,36 @@
|
|||
<svelte:options accessors />
|
||||
|
||||
<script lang="ts">
|
||||
import { OrderedList, ListItem } from "carbon-components-svelte";
|
||||
|
||||
export let nested = false;
|
||||
export let native = false;
|
||||
export let expressive = false;
|
||||
export let items: string[] = ["Item 1", "Item 2", "Item 3"];
|
||||
export let nestedItems: string[] = [];
|
||||
</script>
|
||||
|
||||
<div data-testid="list-wrapper">
|
||||
<OrderedList
|
||||
{nested}
|
||||
{native}
|
||||
{expressive}
|
||||
on:click
|
||||
on:mouseover
|
||||
on:mouseenter
|
||||
on:mouseleave
|
||||
>
|
||||
{#each items as item}
|
||||
<ListItem>
|
||||
{item}
|
||||
{#if nested && nestedItems.length > 0}
|
||||
<OrderedList nested>
|
||||
{#each nestedItems as nestedItem}
|
||||
<ListItem>{nestedItem}</ListItem>
|
||||
{/each}
|
||||
</OrderedList>
|
||||
{/if}
|
||||
</ListItem>
|
||||
{/each}
|
||||
</OrderedList>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue