Skip to content

Commit 184b2fc

Browse files
committed
failing test
1 parent fb50f9f commit 184b2fc

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { tick } from 'svelte';
2+
import { test } from '../../test';
3+
4+
export default test({
5+
mode: ['client', 'hydrate'],
6+
7+
async test({ assert, target }) {
8+
const [input] = target.querySelectorAll('input');
9+
10+
input.focus();
11+
input.value = 'Ab';
12+
input.dispatchEvent(new InputEvent('input', { bubbles: true }));
13+
14+
await tick();
15+
16+
assert.equal(input.value, 'AB');
17+
assert.htmlEqual(target.innerHTML, `<input /><p>AB</p>`);
18+
19+
input.focus();
20+
input.value = 'ABc';
21+
input.dispatchEvent(new InputEvent('input', { bubbles: true }));
22+
23+
await tick();
24+
25+
assert.equal(input.value, 'ABC');
26+
assert.htmlEqual(target.innerHTML, `<input /><p>ABC</p>`);
27+
}
28+
});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<script>
2+
let text = $state('A');
3+
</script>
4+
5+
<input bind:value={() => text, (v) => text = v.toUpperCase()} />
6+
<p>{text}</p>

0 commit comments

Comments
 (0)