mirror of https://github.com/sveltejs/svelte
parent
d41952f689
commit
5086420c2e
@ -0,0 +1,14 @@
|
|||||||
|
export default {
|
||||||
|
html: `
|
||||||
|
<h1>2</h1>
|
||||||
|
<button>Increment</button>
|
||||||
|
`,
|
||||||
|
async test({ assert, target }) {
|
||||||
|
await target.querySelector('button').dispatchEvent(new window.MouseEvent('click'));
|
||||||
|
|
||||||
|
assert.htmlEqual(target.innerHTML, `
|
||||||
|
<h1>4</h1>
|
||||||
|
<button>Increment</button>
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
<script>
|
||||||
|
let count = 1;
|
||||||
|
// Could be a let or simplified, but this tests that it still works like this
|
||||||
|
$: indirect_double = 2;
|
||||||
|
$: if (count > 0) {
|
||||||
|
indirect_double = count * 2;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<h1>{indirect_double}</h1>
|
||||||
|
<button on:click={() => count++}>Increment</button>
|
||||||
Loading…
Reference in new issue