|
|
@ -5,6 +5,8 @@ const values = [
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
|
|
|
|
solo: 1,
|
|
|
|
|
|
|
|
|
|
|
|
props: {
|
|
|
|
props: {
|
|
|
|
values,
|
|
|
|
values,
|
|
|
|
selected: values[1]
|
|
|
|
selected: values[1]
|
|
|
@ -25,18 +27,18 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
<p>Beta</p>`,
|
|
|
|
<p>Beta</p>`,
|
|
|
|
|
|
|
|
|
|
|
|
test ( assert, component, target, window ) {
|
|
|
|
async test(assert, component, target, window) {
|
|
|
|
const inputs = target.querySelectorAll( 'input' );
|
|
|
|
const inputs = target.querySelectorAll('input');
|
|
|
|
assert.equal( inputs[0].checked, false );
|
|
|
|
assert.equal(inputs[0].checked, false);
|
|
|
|
assert.equal( inputs[1].checked, true );
|
|
|
|
assert.equal(inputs[1].checked, true);
|
|
|
|
assert.equal( inputs[2].checked, false );
|
|
|
|
assert.equal(inputs[2].checked, false);
|
|
|
|
|
|
|
|
|
|
|
|
const event = new window.Event( 'change' );
|
|
|
|
const event = new window.Event('change');
|
|
|
|
|
|
|
|
|
|
|
|
inputs[0].checked = true;
|
|
|
|
inputs[0].checked = true;
|
|
|
|
inputs[0].dispatchEvent( event );
|
|
|
|
await inputs[0].dispatchEvent(event);
|
|
|
|
|
|
|
|
|
|
|
|
assert.htmlEqual( target.innerHTML, `
|
|
|
|
assert.htmlEqual(target.innerHTML, `
|
|
|
|
<label>
|
|
|
|
<label>
|
|
|
|
<input type="radio" value="[object Object]"> Alpha
|
|
|
|
<input type="radio" value="[object Object]"> Alpha
|
|
|
|
</label>
|
|
|
|
</label>
|
|
|
@ -50,18 +52,18 @@ export default {
|
|
|
|
</label>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
|
|
<p>Alpha</p>
|
|
|
|
<p>Alpha</p>
|
|
|
|
` );
|
|
|
|
`);
|
|
|
|
|
|
|
|
|
|
|
|
assert.equal( inputs[0].checked, true );
|
|
|
|
assert.equal(inputs[0].checked, true);
|
|
|
|
assert.equal( inputs[1].checked, false );
|
|
|
|
assert.equal(inputs[1].checked, false);
|
|
|
|
assert.equal( inputs[2].checked, false );
|
|
|
|
assert.equal(inputs[2].checked, false);
|
|
|
|
|
|
|
|
|
|
|
|
component.selected = values[2];
|
|
|
|
component.selected = values[2];
|
|
|
|
assert.equal( inputs[0].checked, false );
|
|
|
|
assert.equal(inputs[0].checked, false);
|
|
|
|
assert.equal( inputs[1].checked, false );
|
|
|
|
assert.equal(inputs[1].checked, false);
|
|
|
|
assert.equal( inputs[2].checked, true );
|
|
|
|
assert.equal(inputs[2].checked, true);
|
|
|
|
|
|
|
|
|
|
|
|
assert.htmlEqual( target.innerHTML, `
|
|
|
|
assert.htmlEqual(target.innerHTML, `
|
|
|
|
<label>
|
|
|
|
<label>
|
|
|
|
<input type="radio" value="[object Object]"> Alpha
|
|
|
|
<input type="radio" value="[object Object]"> Alpha
|
|
|
|
</label>
|
|
|
|
</label>
|
|
|
@ -75,6 +77,6 @@ export default {
|
|
|
|
</label>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
|
|
<p>Gamma</p>
|
|
|
|
<p>Gamma</p>
|
|
|
|
` );
|
|
|
|
`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|