mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
test(toggle): add more tests (#2185)
This commit is contained in:
parent
7b0e6f8b69
commit
94b4e30e26
2 changed files with 131 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
|||
import { Toggle } from "carbon-components-svelte";
|
||||
|
||||
let toggled = false;
|
||||
let initialToggled = true;
|
||||
</script>
|
||||
|
||||
<Toggle
|
||||
|
@ -23,3 +24,14 @@
|
|||
labelText="Hidden label toggle"
|
||||
aria-label="Hidden label toggle"
|
||||
/>
|
||||
|
||||
<Toggle
|
||||
bind:toggled={initialToggled}
|
||||
labelText="Initial toggled state"
|
||||
name="test-toggle"
|
||||
on:toggle={(e) => {
|
||||
console.log("initial toggled:", e.detail.toggled);
|
||||
}}
|
||||
/>
|
||||
|
||||
<Toggle labelText="Custom name toggle" name="custom-name-toggle" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue