mirror of
https://github.com/sveltejs/svelte.git
synced 2024-12-01 01:11:24 +01:00
Merge branch 'master' of https://github.com/saibotsivad/svelte into taylorzane-hotfix/initialize-select-element
This commit is contained in:
commit
472a5f752d
22
test/runtime/samples/select-bind-array/_config.js
Normal file
22
test/runtime/samples/select-bind-array/_config.js
Normal file
@ -0,0 +1,22 @@
|
||||
const items = [ { id: 'a' }, { id: 'b' } ];
|
||||
|
||||
export default {
|
||||
'skip-ssr': true,
|
||||
|
||||
data: {
|
||||
foo: 'b',
|
||||
items
|
||||
},
|
||||
|
||||
test ( assert, component, target ) {
|
||||
const options = target.querySelectorAll( 'option' );
|
||||
|
||||
assert.equal( options[0].selected, false );
|
||||
assert.equal( options[1].selected, true );
|
||||
|
||||
component.set( { foo: items[0].id } );
|
||||
|
||||
assert.equal( options[0].selected, true );
|
||||
assert.equal( options[1].selected, false );
|
||||
}
|
||||
};
|
5
test/runtime/samples/select-bind-array/main.html
Normal file
5
test/runtime/samples/select-bind-array/main.html
Normal file
@ -0,0 +1,5 @@
|
||||
<select bind:value="foo">
|
||||
{{#each items as item}}
|
||||
<option value='{{item.id}}'>{{item.id}}</option>
|
||||
{{/each}}
|
||||
</select>
|
Loading…
Reference in New Issue
Block a user