Add destructuring tests

pull/3534/head
Bryan Terce 5 years ago
parent 962c815111
commit 249b2a114c
No known key found for this signature in database
GPG Key ID: DF2E2829CA6E5BF4

@ -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: 'inital' }
]);
</script>
{#each $items as { text }, index}
<input bind:value={text}>
{/each}
<p>{$items[0].text}</p>
Loading…
Cancel
Save