failing test for #2320

pull/2419/head
Richard Harris 5 years ago
parent e3b6040b33
commit 9b5615ffc2

@ -0,0 +1,17 @@
<script>
import { onDestroy } from 'svelte';
let count = 0;
function increment() {
count += 1;
}
</script>
<div>
<slot {count}></slot>
<slot name="foo" {count}></slot>
<slot name="bar"></slot>
<button on:click={increment}>+1</button>
</div>

@ -0,0 +1,25 @@
export default {
html: `
<div>
<p>count in default slot: 0</p>
<p slot="foo">count in foo slot: 0</p>
<p slot="bar">count in bar slot: 0</p>
<button>+1</button>
</div>
`,
async test({ assert, target, window }) {
const button = target.querySelector('button');
await button.dispatchEvent(new window.MouseEvent('click'));
assert.htmlEqual(target.innerHTML, `
<div>
<p>count in default slot: 1</p>
<p slot="foo">count in foo slot: 1</p>
<p slot="bar">count in bar slot: 1</p>
<button>+1</button>
</div>
`);
}
}

@ -0,0 +1,17 @@
<script>
import Nested from './Nested.svelte';
</script>
<Nested let:count>
<p>
count in default slot: {count}
</p>
<p slot="foo" let:count>
count in foo slot: {count}
</p>
<p slot="bar">
count in bar slot: {count}
</p>
</Nested>
Loading…
Cancel
Save