mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
test(combo-box): more unit tests
This commit is contained in:
parent
9e3d83031e
commit
c67e095eaf
2 changed files with 36 additions and 4 deletions
|
@ -11,6 +11,7 @@
|
|||
];
|
||||
export let selectedId: string | undefined = undefined;
|
||||
export let direction: "top" | "bottom" = "bottom";
|
||||
export let clearOptions: { focus?: boolean } = {};
|
||||
export let shouldFilterItem = (item: ComboBoxItem, value: string) =>
|
||||
item.text.toLowerCase().includes(value.toLowerCase());
|
||||
export let itemToString = (item: ComboBoxItem) => item.text;
|
||||
|
@ -33,4 +34,6 @@
|
|||
<span>Item {item.text}</span>
|
||||
</ComboBox>
|
||||
|
||||
<button type="button" on:click={() => comboBoxRef.clear()}>Clear</button>
|
||||
<button type="button" on:click={() => comboBoxRef.clear(clearOptions)}>
|
||||
Clear
|
||||
</button>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue