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.
24 lines
562 B
24 lines
562 B
8 years ago
|
export default {
|
||
|
data: {
|
||
|
foo: true
|
||
|
},
|
||
8 years ago
|
|
||
8 years ago
|
html: `<input type="checkbox">\n<p>true</p>`,
|
||
8 years ago
|
|
||
8 years ago
|
test ( assert, component, target, window ) {
|
||
8 years ago
|
const input = target.querySelector( 'input' );
|
||
|
assert.equal( input.checked, true );
|
||
|
|
||
|
const event = new window.Event( 'change' );
|
||
|
|
||
|
input.checked = false;
|
||
|
input.dispatchEvent( event );
|
||
|
|
||
|
assert.equal( target.innerHTML, `<input type="checkbox">\n<p>false</p>` );
|
||
|
|
||
|
component.set({ foo: true });
|
||
|
assert.equal( input.checked, true );
|
||
|
assert.equal( target.innerHTML, `<input type="checkbox">\n<p>true</p>` );
|
||
|
}
|
||
|
};
|