mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
test(multi-select): more unit tests
This commit is contained in:
parent
5e8c8b983c
commit
8ab77c99e2
4 changed files with 328 additions and 360 deletions
55
tests/MultiSelect/MultiSelect.test.svelte
Normal file
55
tests/MultiSelect/MultiSelect.test.svelte
Normal file
|
@ -0,0 +1,55 @@
|
|||
<script lang="ts">
|
||||
import { MultiSelect } from "carbon-components-svelte";
|
||||
import type { ComponentProps } from "svelte";
|
||||
|
||||
export let items: ComponentProps<MultiSelect>["items"] = [];
|
||||
export let selectedIds: ComponentProps<MultiSelect>["selectedIds"] = [];
|
||||
export let filterable = false;
|
||||
export let filterItem: ComponentProps<MultiSelect>["filterItem"] = undefined;
|
||||
export let placeholder = "";
|
||||
export let titleText = "";
|
||||
export let hideLabel = false;
|
||||
export let light = false;
|
||||
export let type: ComponentProps<MultiSelect>["type"] = "default";
|
||||
export let invalid = false;
|
||||
export let invalidText = "";
|
||||
export let warn = false;
|
||||
export let warnText = "";
|
||||
export let disabled = false;
|
||||
export let selectionFeedback: ComponentProps<MultiSelect>["selectionFeedback"] =
|
||||
"top-after-reopen";
|
||||
export let translateWithIdSelection: ComponentProps<MultiSelect>["translateWithIdSelection"] =
|
||||
undefined;
|
||||
export let itemToString: ComponentProps<MultiSelect>["itemToString"] = (
|
||||
item,
|
||||
) => item.text;
|
||||
export let itemToInput: ComponentProps<MultiSelect>["itemToInput"] =
|
||||
undefined;
|
||||
</script>
|
||||
|
||||
<MultiSelect
|
||||
{items}
|
||||
{selectedIds}
|
||||
{filterable}
|
||||
{filterItem}
|
||||
{placeholder}
|
||||
{titleText}
|
||||
{hideLabel}
|
||||
{light}
|
||||
{type}
|
||||
{invalid}
|
||||
{invalidText}
|
||||
{warn}
|
||||
{warnText}
|
||||
{disabled}
|
||||
{selectionFeedback}
|
||||
{translateWithIdSelection}
|
||||
{itemToString}
|
||||
{itemToInput}
|
||||
on:select={(e) => {
|
||||
console.log("select", e.detail);
|
||||
}}
|
||||
on:clear={(e) => {
|
||||
console.log("clear", e.detail);
|
||||
}}
|
||||
/>
|
Loading…
Add table
Add a link
Reference in a new issue