mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 10:51:06 +00:00
test(unordered-list): add unit tests
This commit is contained in:
parent
3cf1112e52
commit
2156eee6be
3 changed files with 158 additions and 39 deletions
30
tests/UnorderedList/UnorderedList.test.svelte
Normal file
30
tests/UnorderedList/UnorderedList.test.svelte
Normal file
|
@ -0,0 +1,30 @@
|
|||
<script lang="ts">
|
||||
import { UnorderedList, ListItem } from "carbon-components-svelte";
|
||||
|
||||
export let nested = false;
|
||||
export let expressive = false;
|
||||
export let items: string[] = ["Item 1", "Item 2", "Item 3"];
|
||||
export let nestedItems: string[] = [];
|
||||
</script>
|
||||
|
||||
<UnorderedList
|
||||
{nested}
|
||||
{expressive}
|
||||
on:click
|
||||
on:mouseover
|
||||
on:mouseenter
|
||||
on:mouseleave
|
||||
>
|
||||
{#each items as item}
|
||||
<ListItem>
|
||||
{item}
|
||||
{#if nested && nestedItems.length > 0}
|
||||
<UnorderedList nested>
|
||||
{#each nestedItems as nestedItem}
|
||||
<ListItem>{nestedItem}</ListItem>
|
||||
{/each}
|
||||
</UnorderedList>
|
||||
{/if}
|
||||
</ListItem>
|
||||
{/each}
|
||||
</UnorderedList>
|
Loading…
Add table
Add a link
Reference in a new issue