From 52a30dc8e3b50540c75c897284068d0f0acad7f2 Mon Sep 17 00:00:00 2001 From: Rich-Harris Date: Tue, 18 Apr 2017 21:34:20 -0400 Subject: [PATCH] failing test for #495 --- .../_config.js | 36 +++++++++++++++++++ .../binding-input-text-deconflicted/main.html | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 test/runtime/samples/binding-input-text-deconflicted/_config.js create mode 100644 test/runtime/samples/binding-input-text-deconflicted/main.html diff --git a/test/runtime/samples/binding-input-text-deconflicted/_config.js b/test/runtime/samples/binding-input-text-deconflicted/_config.js new file mode 100644 index 000000000000..0b705d35204b --- /dev/null +++ b/test/runtime/samples/binding-input-text-deconflicted/_config.js @@ -0,0 +1,36 @@ +export default { + solo: true, + + data: { + component: { + name: 'world' + } + }, + + html: ` +

Hello world!

+ + `, + + test ( assert, component, target, window ) { + const input = target.querySelector( 'input' ); + assert.equal( input.value, 'world' ); + + const event = new window.Event( 'input' ); + + input.value = 'everybody'; + input.dispatchEvent( event ); + + assert.equal( target.innerHTML, ` +

Hello everybody!

+ + ` ); + + component.set({ name: 'goodbye' }); + assert.equal( input.value, 'goodbye' ); + assert.equal( target.innerHTML, ` +

Hello goodbye!

+ + ` ); + } +}; diff --git a/test/runtime/samples/binding-input-text-deconflicted/main.html b/test/runtime/samples/binding-input-text-deconflicted/main.html new file mode 100644 index 000000000000..391a47c3f1b7 --- /dev/null +++ b/test/runtime/samples/binding-input-text-deconflicted/main.html @@ -0,0 +1,2 @@ +

Hello {{component.name}}!

+ \ No newline at end of file