mirror of https://github.com/sveltejs/svelte
parent
d0d3b342e8
commit
be20e912d9
@ -0,0 +1,17 @@
|
||||
export default {
|
||||
html: '<input type="text"><input type="text"><input type="text">',
|
||||
async test({ assert, component, target }) {
|
||||
const input = target.querySelector('input');
|
||||
input.value = 'svelte';
|
||||
await input.dispatchEvent(new window.Event('input'));
|
||||
|
||||
assert.htmlEqual(
|
||||
target.innerHTML,
|
||||
`
|
||||
<input type="text"><input type="text"><input type="text">
|
||||
`
|
||||
);
|
||||
assert.deepEqual(component.data, { a: 'svelte', b: 'B', c: 'C' });
|
||||
assert.deepEqual(component.x, ['a', 'b', 'c']);
|
||||
},
|
||||
};
|
@ -0,0 +1,15 @@
|
||||
<script>
|
||||
export let x = ['a', 'b', 'c'];
|
||||
export let data = {
|
||||
'a': 'A',
|
||||
'b': 'B',
|
||||
'c': 'C',
|
||||
};
|
||||
export function getData() {
|
||||
return data;
|
||||
}
|
||||
</script>
|
||||
|
||||
{#each x as x}
|
||||
<input type=text bind:value={data[x]}>
|
||||
{/each}
|
Loading…
Reference in new issue