Skip to content

Commit

Permalink
Added test for binding bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dxlbnl committed Mar 29, 2017
1 parent 3ba4793 commit 6eb96aa
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/generator/samples/component-binding-deep/Widget.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<input bind:value>
22 changes: 22 additions & 0 deletions test/generator/samples/component-binding-deep/_config.js
Original file line number Diff line number Diff line change
@@ -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();
}
};
21 changes: 21 additions & 0 deletions test/generator/samples/component-binding-deep/main.html
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit 6eb96aa

Please sign in to comment.