mirror of https://github.com/sveltejs/svelte
parent
fbb6c9fd4e
commit
643aa41b9a
@ -0,0 +1,17 @@
|
|||||||
|
export default {
|
||||||
|
html: `
|
||||||
|
<button>Mutate a</button>
|
||||||
|
<div>{}</div>
|
||||||
|
`,
|
||||||
|
|
||||||
|
async test({ assert, target }) {
|
||||||
|
const button = target.querySelector('button');
|
||||||
|
const click = new window.MouseEvent('click');
|
||||||
|
|
||||||
|
await button.dispatchEvent(click);
|
||||||
|
assert.htmlEqual(target.innerHTML, `
|
||||||
|
<button>Mutate a</button>
|
||||||
|
<div>{"foo":42}</div>
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,9 @@
|
|||||||
|
<script>
|
||||||
|
const a = {};
|
||||||
|
const b = {};
|
||||||
|
$: b.foo = a.foo;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<button on:click={() => a.foo = 42}>Mutate a</button>
|
||||||
|
<div>{JSON.stringify(b)}</div>
|
||||||
|
|
Loading…
Reference in new issue