mirror of https://github.com/sveltejs/svelte
parent
472a5f752d
commit
634ea662d3
@ -1,22 +1,22 @@
|
||||
const items = [ { id: 'a' }, { id: 'b' } ];
|
||||
|
||||
export default {
|
||||
'skip-ssr': true,
|
||||
'skip-ssr': true,
|
||||
|
||||
data: {
|
||||
foo: 'b',
|
||||
items
|
||||
},
|
||||
data: {
|
||||
foo: 'b',
|
||||
items
|
||||
},
|
||||
|
||||
test ( assert, component, target ) {
|
||||
const options = target.querySelectorAll( 'option' );
|
||||
test ( assert, component, target ) {
|
||||
const options = target.querySelectorAll( 'option' );
|
||||
|
||||
assert.equal( options[0].selected, false );
|
||||
assert.equal( options[1].selected, true );
|
||||
assert.equal( options[0].selected, false );
|
||||
assert.equal( options[1].selected, true );
|
||||
|
||||
component.set( { foo: items[0].id } );
|
||||
component.set( { foo: items[0].id } );
|
||||
|
||||
assert.equal( options[0].selected, true );
|
||||
assert.equal( options[1].selected, false );
|
||||
}
|
||||
assert.equal( options[0].selected, true );
|
||||
assert.equal( options[1].selected, false );
|
||||
}
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
<select bind:value="foo">
|
||||
{{#each items as item}}
|
||||
<option value='{{item.id}}'>{{item.id}}</option>
|
||||
{{/each}}
|
||||
{{#each items as item}}
|
||||
<option value='{{item.id}}'>{{item.id}}</option>
|
||||
{{/each}}
|
||||
</select>
|
||||
|
Loading…
Reference in new issue