mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 10:51:06 +00:00
test(select): add unit tests (#2109)
This commit is contained in:
parent
b15bf65f88
commit
5522c5b0b2
5 changed files with 306 additions and 64 deletions
39
tests/Select/Select.test.svelte
Normal file
39
tests/Select/Select.test.svelte
Normal file
|
@ -0,0 +1,39 @@
|
|||
<script lang="ts">
|
||||
import { Select, SelectItem } from "carbon-components-svelte";
|
||||
|
||||
export let selected: string | number | undefined = undefined;
|
||||
export let disabled = false;
|
||||
export let invalid = false;
|
||||
export let invalidText = "";
|
||||
export let warn = false;
|
||||
export let warnText = "";
|
||||
export let helperText = "";
|
||||
export let hideLabel = false;
|
||||
export let labelText = "Select label";
|
||||
export let size: "sm" | "xl" | undefined = undefined;
|
||||
export let inline = false;
|
||||
export let light = false;
|
||||
</script>
|
||||
|
||||
<Select
|
||||
bind:selected
|
||||
{disabled}
|
||||
{invalid}
|
||||
{invalidText}
|
||||
{warn}
|
||||
{warnText}
|
||||
{helperText}
|
||||
{hideLabel}
|
||||
{labelText}
|
||||
{size}
|
||||
{inline}
|
||||
{light}
|
||||
data-testid="select"
|
||||
on:change={() => console.log("change")}
|
||||
on:input={() => console.log("input")}
|
||||
on:update={(e) => console.log("update", e.detail)}
|
||||
>
|
||||
<SelectItem value="option-1" text="Option 1" />
|
||||
<SelectItem value="option-2" text="Option 2" />
|
||||
<SelectItem value="option-3" text="Option 3" />
|
||||
</Select>
|
Loading…
Add table
Add a link
Reference in a new issue