mirror of https://github.com/sveltejs/svelte
parent
be68cd9de2
commit
945d8ce526
@ -0,0 +1 @@
|
||||
<input bind:value=$name>
|
@ -0,0 +1,28 @@
|
||||
import Store from '../../../../store.js';
|
||||
|
||||
const store = new Store({
|
||||
name: 'world'
|
||||
});
|
||||
|
||||
export default {
|
||||
store,
|
||||
|
||||
html: `
|
||||
<h1>Hello world!</h1>
|
||||
<input>
|
||||
`,
|
||||
|
||||
test(assert, component, target, window) {
|
||||
const input = target.querySelector('input');
|
||||
const event = new window.Event('input');
|
||||
|
||||
input.value = 'everybody';
|
||||
input.dispatchEvent(event);
|
||||
|
||||
assert.equal(store.get('name'), 'everybody');
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<h1>Hello everybody!</h1>
|
||||
<input>
|
||||
`);
|
||||
}
|
||||
};
|
@ -0,0 +1,10 @@
|
||||
<h1>Hello {{$name}}!</h1>
|
||||
<NameInput/>
|
||||
|
||||
<script>
|
||||
import NameInput from './NameInput.html';
|
||||
|
||||
export default {
|
||||
components: { NameInput }
|
||||
};
|
||||
</script>
|
Loading…
Reference in new issue