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.
22 lines
555 B
22 lines
555 B
8 years ago
|
export default {
|
||
|
data: {
|
||
|
name: 'world'
|
||
|
},
|
||
|
html: `<input>\n<p>hello world</p>`,
|
||
8 years ago
|
test ( assert, component, target, window ) {
|
||
8 years ago
|
const input = target.querySelector( 'input' );
|
||
|
assert.equal( input.value, 'world' );
|
||
|
|
||
|
const event = new window.Event( 'input' );
|
||
|
|
||
|
input.value = 'everybody';
|
||
|
input.dispatchEvent( event );
|
||
|
|
||
|
assert.equal( target.innerHTML, `<input>\n<p>hello everybody</p>` );
|
||
|
|
||
|
component.set({ name: 'goodbye' });
|
||
|
assert.equal( input.value, 'goodbye' );
|
||
|
assert.equal( target.innerHTML, `<input>\n<p>hello goodbye</p>` );
|
||
|
}
|
||
|
};
|