From 2a48dd9c97cfe87702c1abb02a502a97d5430455 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Mon, 27 Feb 2017 14:44:13 -0500 Subject: [PATCH] add (skipped) test for #301 --- .../binding-select-initial-value/_config.js | 29 +++++++++++++++++++ .../binding-select-initial-value/main.html | 9 ++++++ 2 files changed, 38 insertions(+) create mode 100644 test/generator/binding-select-initial-value/_config.js create mode 100644 test/generator/binding-select-initial-value/main.html diff --git a/test/generator/binding-select-initial-value/_config.js b/test/generator/binding-select-initial-value/_config.js new file mode 100644 index 0000000000..b49c1135af --- /dev/null +++ b/test/generator/binding-select-initial-value/_config.js @@ -0,0 +1,29 @@ +export default { + skip: true, // selectedOptions doesn't work in JSDOM??? + + html: ` +

selected: b

+ + + +

selected: b

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

selected: {{selected}}

+ + + +

selected: {{selected}}

\ No newline at end of file