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.
svelte/test/generator/samples/binding-input-checkbox/_config.js

24 lines
562 B

export default {
data: {
foo: true
},
html: `<input type="checkbox">\n<p>true</p>`,
test ( assert, component, target, window ) {
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>` );
}
};