From 6eb96aadb82ed34fb7874b9deaee30cc8fad380c Mon Sep 17 00:00:00 2001 From: Dexter Date: Wed, 29 Mar 2017 15:43:56 +0200 Subject: [PATCH] Added test for binding bug --- .../component-binding-deep/Widget.html | 1 + .../samples/component-binding-deep/_config.js | 22 +++++++++++++++++++ .../samples/component-binding-deep/main.html | 21 ++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 test/generator/samples/component-binding-deep/Widget.html create mode 100644 test/generator/samples/component-binding-deep/_config.js create mode 100644 test/generator/samples/component-binding-deep/main.html diff --git a/test/generator/samples/component-binding-deep/Widget.html b/test/generator/samples/component-binding-deep/Widget.html new file mode 100644 index 000000000000..f24d608cd586 --- /dev/null +++ b/test/generator/samples/component-binding-deep/Widget.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/test/generator/samples/component-binding-deep/_config.js b/test/generator/samples/component-binding-deep/_config.js new file mode 100644 index 000000000000..eb8e489de616 --- /dev/null +++ b/test/generator/samples/component-binding-deep/_config.js @@ -0,0 +1,22 @@ +export default { + html: ` + +

foo

+ `, + + 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, ` + +

blah

+ ` ); + + component.destroy(); + } +}; diff --git a/test/generator/samples/component-binding-deep/main.html b/test/generator/samples/component-binding-deep/main.html new file mode 100644 index 000000000000..0064a6092dc3 --- /dev/null +++ b/test/generator/samples/component-binding-deep/main.html @@ -0,0 +1,21 @@ + + +

{{deep.name}}

+ +