mirror of https://github.com/sveltejs/svelte
parent
3ba4793728
commit
6eb96aadb8
@ -0,0 +1 @@
|
|||||||
|
<input bind:value>
|
@ -0,0 +1,22 @@
|
|||||||
|
export default {
|
||||||
|
html: `
|
||||||
|
<input>
|
||||||
|
<p>foo</p>
|
||||||
|
`,
|
||||||
|
|
||||||
|
test ( assert, component, target, window ) {
|
||||||
|
const event = new window.MouseEvent( 'input' );
|
||||||
|
const input = target.querySelector( 'input' );
|
||||||
|
|
||||||
|
input.value = 'blah';
|
||||||
|
input.dispatchEvent( event );
|
||||||
|
|
||||||
|
assert.deepEqual( component.get( 'deep' ), { name: 'blah' } );
|
||||||
|
assert.htmlEqual( target.innerHTML, `
|
||||||
|
<input>
|
||||||
|
<p>blah</p>
|
||||||
|
` );
|
||||||
|
|
||||||
|
component.destroy();
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,21 @@
|
|||||||
|
<Widget bind:value='deep.name'/>
|
||||||
|
|
||||||
|
<p>{{deep.name}}</p>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Widget from './Widget.html';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
deep: {
|
||||||
|
name: 'foo'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
components: {
|
||||||
|
Widget
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in new issue