mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
test(radio-button): add unit tests
This commit is contained in:
parent
6dccd5cbe2
commit
ec7d798783
4 changed files with 167 additions and 35 deletions
32
tests/RadioButton/RadioButton.test.svelte
Normal file
32
tests/RadioButton/RadioButton.test.svelte
Normal file
|
@ -0,0 +1,32 @@
|
|||
<script lang="ts">
|
||||
import { RadioButton } from "carbon-components-svelte";
|
||||
import type { ComponentProps } from "svelte";
|
||||
|
||||
export let value: ComponentProps<RadioButton>["value"] = "";
|
||||
export let checked: ComponentProps<RadioButton>["checked"] = false;
|
||||
export let disabled: ComponentProps<RadioButton>["disabled"] = false;
|
||||
export let required: ComponentProps<RadioButton>["required"] = false;
|
||||
export let labelPosition: ComponentProps<RadioButton>["labelPosition"] =
|
||||
"right";
|
||||
export let labelText: ComponentProps<RadioButton>["labelText"] = "Option 1";
|
||||
export let hideLabel: ComponentProps<RadioButton>["hideLabel"] = false;
|
||||
export let id: ComponentProps<RadioButton>["id"] = "ccs-test";
|
||||
export let name: ComponentProps<RadioButton>["name"] = "test-group";
|
||||
export let ref: ComponentProps<RadioButton>["ref"] = null;
|
||||
</script>
|
||||
|
||||
<RadioButton
|
||||
bind:value
|
||||
{checked}
|
||||
{disabled}
|
||||
{required}
|
||||
{labelPosition}
|
||||
{labelText}
|
||||
{hideLabel}
|
||||
{id}
|
||||
{name}
|
||||
{ref}
|
||||
on:change={() => {
|
||||
console.log("change");
|
||||
}}
|
||||
/>
|
Loading…
Add table
Add a link
Reference in a new issue