mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 02:41:05 +00:00
test(tabs): add unit tests
This commit is contained in:
parent
150e03e1fd
commit
0c6a171a24
3 changed files with 158 additions and 48 deletions
29
tests/Tabs/Tabs.test.svelte
Normal file
29
tests/Tabs/Tabs.test.svelte
Normal file
|
@ -0,0 +1,29 @@
|
|||
<script lang="ts">
|
||||
import { Tabs, Tab, TabContent } from "carbon-components-svelte";
|
||||
|
||||
export let selected = 0;
|
||||
export let type: "default" | "container" = "default";
|
||||
export let autoWidth = false;
|
||||
export let iconDescription = "Show menu options";
|
||||
export let triggerHref = "#";
|
||||
</script>
|
||||
|
||||
<Tabs
|
||||
{selected}
|
||||
{type}
|
||||
{autoWidth}
|
||||
{iconDescription}
|
||||
{triggerHref}
|
||||
on:change={({ detail }) => {
|
||||
console.log("change event", detail);
|
||||
}}
|
||||
>
|
||||
<Tab label="Tab 1" />
|
||||
<Tab label="Tab 2" disabled />
|
||||
<Tab label="Tab 3" />
|
||||
<svelte:fragment slot="content">
|
||||
<TabContent>Content 1</TabContent>
|
||||
<TabContent>Content 2</TabContent>
|
||||
<TabContent>Content 3</TabContent>
|
||||
</svelte:fragment>
|
||||
</Tabs>
|
Loading…
Add table
Add a link
Reference in a new issue