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/runtime/samples/dynamic-component-bindings/_config.js

33 lines
572 B

export default {
data: {
x: true
},
html: `
<p>foo</p>
<input>
`,
test(assert, component, target, window) {
let input = target.querySelector('input');
input.value = 'abc';
input.dispatchEvent(new window.Event('input'));
assert.equal(component.get('y'), 'abc');
component.set({
x: false
});
assert.htmlEqual(target.innerHTML, `
<p>bar</p>
<input type='checkbox'>
`);
input = target.querySelector('input');
input.checked = true;
input.dispatchEvent(new window.Event('change'));
assert.equal(component.get('z'), true);
}
};