mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
test(radio-tile): add unit tests
This commit is contained in:
parent
13ce85b9eb
commit
ed8e2dc75b
6 changed files with 281 additions and 17 deletions
25
tests/RadioTile/RadioTile.group.test.svelte
Normal file
25
tests/RadioTile/RadioTile.group.test.svelte
Normal file
|
@ -0,0 +1,25 @@
|
|||
<script lang="ts">
|
||||
import { TileGroup, RadioTile, Button } from "carbon-components-svelte";
|
||||
|
||||
const values = ["Lite plan", "Standard plan", "Plus plan"];
|
||||
|
||||
let selected = values[1];
|
||||
</script>
|
||||
|
||||
<TileGroup legend="Service pricing tiers" name="plan" bind:selected>
|
||||
{#each values as value}
|
||||
<RadioTile {value}>{value}</RadioTile>
|
||||
{/each}
|
||||
</TileGroup>
|
||||
|
||||
<div>
|
||||
Selected: {selected}
|
||||
</div>
|
||||
|
||||
<Button
|
||||
size="small"
|
||||
disabled={selected === values[1]}
|
||||
on:click={() => (selected = values[1])}
|
||||
>
|
||||
Set to "{values[1]}"
|
||||
</Button>
|
Loading…
Add table
Add a link
Reference in a new issue