mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
Add unit test
This commit is contained in:
parent
57c9f836ff
commit
db0fccbfb4
2 changed files with 13 additions and 0 deletions
|
@ -19,6 +19,7 @@
|
|||
export let invalidText = "";
|
||||
export let warnText = "";
|
||||
export let helperText = "";
|
||||
export let hideLabel = false;
|
||||
export let size: "sm" | "xl" | undefined = undefined;
|
||||
export let shouldFilterItem: ComponentProps<ComboBox>["shouldFilterItem"] = (
|
||||
item,
|
||||
|
@ -31,6 +32,7 @@
|
|||
<ComboBox
|
||||
{disabled}
|
||||
{helperText}
|
||||
{hideLabel}
|
||||
{invalid}
|
||||
{invalidText}
|
||||
{items}
|
||||
|
|
|
@ -96,6 +96,17 @@ describe("ComboBox", () => {
|
|||
expect(screen.getByText("Contact")).toHaveClass("bx--label--disabled");
|
||||
});
|
||||
|
||||
it("should handle hidden label", () => {
|
||||
render(ComboBox, {
|
||||
props: {
|
||||
titleText: "Hidden Label",
|
||||
hideLabel: true,
|
||||
},
|
||||
});
|
||||
|
||||
expect(screen.getByText("Hidden Label")).toHaveClass("bx--visually-hidden");
|
||||
});
|
||||
|
||||
it("should handle invalid state", () => {
|
||||
render(ComboBox, {
|
||||
props: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue