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/compiler/binding-input-checkbox/_config.js

24 lines
587 B

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