From d3d026a510a3b702d6113e04ce540b3beaf8ac00 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 14 Jun 2017 17:44:13 -0400 Subject: [PATCH 1/2] sync state with view, if special case if (type === 'radio') { diff --git a/test/runtime/samples/binding-select-initial-value-undefined/_config.js b/test/runtime/samples/binding-select-initial-value-undefined/_config.js new file mode 100644 index 000000000000..5328bf472748 --- /dev/null +++ b/test/runtime/samples/binding-select-initial-value-undefined/_config.js @@ -0,0 +1,26 @@ +export default { + solo: true, + show: true, + + html: ` +

selected: a

+ + + +

selected: a

+ `, + + test ( assert, component, target ) { + const select = target.querySelector( 'select' ); + const options = [ ...target.querySelectorAll( 'option' ) ]; + + assert.equal( select.value, 'a' ); + assert.ok( options[0].selected ); + + component.destroy(); + } +}; diff --git a/test/runtime/samples/binding-select-initial-value-undefined/main.html b/test/runtime/samples/binding-select-initial-value-undefined/main.html new file mode 100644 index 000000000000..ea154022401e --- /dev/null +++ b/test/runtime/samples/binding-select-initial-value-undefined/main.html @@ -0,0 +1,9 @@ +

selected: {{selected}}

+ + + +

selected: {{selected}}

\ No newline at end of file From 4b7b0503af1482af5234e1d3080350fac34d02b9 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 14 Jun 2017 17:45:25 -0400 Subject: [PATCH 2/2] skip failing SSR test for now --- .../samples/binding-select-initial-value-undefined/_config.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/runtime/samples/binding-select-initial-value-undefined/_config.js b/test/runtime/samples/binding-select-initial-value-undefined/_config.js index 5328bf472748..d5944ae81598 100644 --- a/test/runtime/samples/binding-select-initial-value-undefined/_config.js +++ b/test/runtime/samples/binding-select-initial-value-undefined/_config.js @@ -1,6 +1,5 @@ export default { - solo: true, - show: true, + 'skip-ssr': true, // TODO would be nice to fix this in SSR as well html: `

selected: a