Skip to content

Commit 7122eba

Browse files
committed
chore: add test for binding event reactive context
1 parent b72fd2b commit 7122eba

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { test } from '../../test';
2+
3+
export default test({
4+
test({ target, assert, logs }) {
5+
const input = /** @type {HTMLInputElement} */ (target.querySelector('input'));
6+
input.value = 'everybody';
7+
input.dispatchEvent(new window.Event('input'));
8+
9+
assert.deepEqual(logs, [false]);
10+
}
11+
});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<script>
2+
let bar = $state('');
3+
4+
const foo = {
5+
set bar(v) {
6+
7+
console.log($effect.tracking());
8+
9+
bar = v;
10+
},
11+
get bar() {
12+
return bar;
13+
}
14+
}
15+
</script>
16+
17+
<input type="text" bind:value={foo.bar}>

0 commit comments

Comments
 (0)