mirror of https://github.com/sveltejs/svelte
commit
fafb39093c
@ -0,0 +1,14 @@
|
||||
export default {
|
||||
async test({ assert, target, window }) {
|
||||
const input = target.querySelector('input');
|
||||
|
||||
const event = new window.Event('input');
|
||||
input.value = 'changed';
|
||||
await input.dispatchEvent(event);
|
||||
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<input>
|
||||
<p>changed</p>
|
||||
`);
|
||||
}
|
||||
};
|
@ -0,0 +1,13 @@
|
||||
<script>
|
||||
import { writable } from 'svelte/store';
|
||||
|
||||
const items = writable([
|
||||
{ id: 0, text: 'initial' }
|
||||
]);
|
||||
</script>
|
||||
|
||||
{#each $items as { text }}
|
||||
<input bind:value={text}>
|
||||
{/each}
|
||||
|
||||
<p>{$items[0].text}</p>
|
@ -0,0 +1,14 @@
|
||||
export default {
|
||||
async test({ assert, target, window }) {
|
||||
const input = target.querySelector('input');
|
||||
|
||||
const event = new window.Event('input');
|
||||
input.value = 'changed';
|
||||
await input.dispatchEvent(event);
|
||||
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<input>
|
||||
<p>changed</p>
|
||||
`);
|
||||
}
|
||||
};
|
@ -0,0 +1,13 @@
|
||||
<script>
|
||||
import { writable } from 'svelte/store';
|
||||
|
||||
const items = writable([
|
||||
{ id: 0, text: 'initial' }
|
||||
]);
|
||||
</script>
|
||||
|
||||
{#each $items as item}
|
||||
<input bind:value={item.text}>
|
||||
{/each}
|
||||
|
||||
<p>{$items[0].text}</p>
|
Loading…
Reference in new issue