mirror of https://github.com/sveltejs/svelte
parent
4e525d9e11
commit
c766af7541
@ -0,0 +1,8 @@
|
||||
<script>
|
||||
const slot = $$slots.default({ value: 'foo' })
|
||||
let target
|
||||
$: target && slot.mount(target)
|
||||
</script>
|
||||
|
||||
<button on:click={e => slot.update({ value: 'bar' })}>Click me</button>
|
||||
<div bind:this={target} />
|
@ -0,0 +1,18 @@
|
||||
export default {
|
||||
async test({ assert, target, window, }) {
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<button>Click me</button>
|
||||
<div>foo</div>
|
||||
`);
|
||||
|
||||
const btn = target.querySelector('button');
|
||||
const clickEvent = new window.MouseEvent('click');
|
||||
|
||||
await btn.dispatchEvent(clickEvent);
|
||||
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<button>Click me</button>
|
||||
<div>bar</div>
|
||||
`);
|
||||
}
|
||||
};
|
@ -0,0 +1,7 @@
|
||||
<script>
|
||||
import Child from './Child.svelte'
|
||||
</script>
|
||||
|
||||
<Child let:value>
|
||||
{value}
|
||||
</Child>
|
Loading…
Reference in new issue