mirror of https://github.com/sveltejs/svelte
prevent await block mounting inside removed if block - fixes #1496
parent
220515b605
commit
b7ba0d69ee
@ -0,0 +1,22 @@
|
||||
let fulfil;
|
||||
|
||||
const promise = new Promise(f => {
|
||||
fulfil = f;
|
||||
});
|
||||
|
||||
export default {
|
||||
props: {
|
||||
promise
|
||||
},
|
||||
|
||||
html: ``,
|
||||
|
||||
async test({ assert, component, target }) {
|
||||
component.condition = false;
|
||||
|
||||
fulfil();
|
||||
await new Promise(f => setTimeout(f, 0));
|
||||
|
||||
assert.htmlEqual(target.innerHTML, ``);
|
||||
}
|
||||
};
|
@ -0,0 +1,8 @@
|
||||
<script>
|
||||
export let promise;
|
||||
export let condition = true;
|
||||
</script>
|
||||
|
||||
{#if condition}
|
||||
{#await promise then _}hello{/await}
|
||||
{/if}
|
Loading…
Reference in new issue