mirror of https://github.com/sveltejs/svelte
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
507 B
30 lines
507 B
8 years ago
|
export default {
|
||
|
skip: true, // selectedOptions doesn't work in JSDOM???
|
||
|
|
||
|
html: `
|
||
|
<p>selected: b</p>
|
||
|
|
||
|
<select>
|
||
|
<option>a</option>
|
||
|
<option>b</option>
|
||
|
<option>c</option>
|
||
|
</select>
|
||
|
|
||
|
<p>selected: b</p>
|
||
|
`,
|
||
|
|
||
|
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 );
|
||
|
|
||
8 years ago
|
component.destroy();
|
||
8 years ago
|
}
|
||
|
};
|