|
|
|
@ -56,5 +56,40 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
<p>selected: d</p>
|
|
|
|
<p>selected: d</p>
|
|
|
|
`);
|
|
|
|
`);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
component.selected = 'b'; // second option should now be selected
|
|
|
|
|
|
|
|
assert.equal(select.value, 'b');
|
|
|
|
|
|
|
|
assert.ok(options[1].selected);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assert.htmlEqual(target.innerHTML, `
|
|
|
|
|
|
|
|
<p>selected: b</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select>
|
|
|
|
|
|
|
|
<option value='a'>a</option>
|
|
|
|
|
|
|
|
<option value='b'>b</option>
|
|
|
|
|
|
|
|
<option value='c'>c</option>
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p>selected: b</p>
|
|
|
|
|
|
|
|
`);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
component.selected = undefined; // also doesn't match an option
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// now no option should be selected again
|
|
|
|
|
|
|
|
assert.equal(select.value, '');
|
|
|
|
|
|
|
|
assert.equal(select.selectedIndex, -1);
|
|
|
|
|
|
|
|
assert.ok(!options[0].selected);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assert.htmlEqual(target.innerHTML, `
|
|
|
|
|
|
|
|
<p>selected: undefined</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select>
|
|
|
|
|
|
|
|
<option value='a'>a</option>
|
|
|
|
|
|
|
|
<option value='b'>b</option>
|
|
|
|
|
|
|
|
<option value='c'>c</option>
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p>selected: undefined</p>
|
|
|
|
|
|
|
|
`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|