mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
test(checkbox): test multiple checkbox reactivity for same object
Regression tests for #2177
This commit is contained in:
parent
863c30f3c8
commit
8e934fbcc6
2 changed files with 156 additions and 0 deletions
15
tests/Checkbox/MultipleCheckboxesObject.test.svelte
Normal file
15
tests/Checkbox/MultipleCheckboxesObject.test.svelte
Normal file
|
@ -0,0 +1,15 @@
|
|||
<script lang="ts">
|
||||
import { Checkbox } from "carbon-components-svelte";
|
||||
|
||||
export let obj = {
|
||||
a: false,
|
||||
b: false,
|
||||
};
|
||||
|
||||
$: console.log("object changed:", obj);
|
||||
</script>
|
||||
|
||||
<Checkbox bind:checked={obj.a} labelText="A" data-testid="checkbox-a" />
|
||||
<Checkbox bind:checked={obj.b} labelText="B" data-testid="checkbox-b" />
|
||||
|
||||
<span data-testid="object-values">{JSON.stringify(obj)}</span>
|
Loading…
Add table
Add a link
Reference in a new issue