pull/4699/head
pushkine 6 years ago
parent 10ec911ffa
commit 4b67469a7c

@ -11,7 +11,7 @@
let bool = true;
</script>
<button on:click={() => (condition = false)} id="1" />
<button on:click={() => (condition = false)} />
<button on:click={() => (bool = !bool)} />
{#if bool}
<div out:foo />

@ -1,6 +1,8 @@
export default {
test({ assert, target, window, raf }) {
target.querySelector("button").click();
async test({ assert, target, window, raf }) {
const button = target.querySelector("button");
const event = new window.MouseEvent("click");
await button.dispatchEvent(event);
raf.tick(500);
assert.htmlEqual(target.innerHTML, "");
},

@ -1,6 +1,6 @@
export default {
test({ assert, target, window, raf }) {
target.querySelector("button").click();
async test({ assert, target, component, raf }) {
await component.condition.set(false);
raf.tick(500);
assert.htmlEqual(target.innerHTML, "");
},

@ -1,7 +1,7 @@
<script>
import { writable } from "svelte/store";
import Component from "./Component.svelte";
let condition = writable(true);
export let condition = writable(true);
</script>
{#if $condition}

Loading…
Cancel
Save