mirror of https://github.com/sveltejs/svelte
parent
6e1674e249
commit
fbef42f752
@ -0,0 +1,11 @@
|
||||
export default {
|
||||
async test({ assert, target, window }) {
|
||||
const div = target.querySelector('div');
|
||||
const click = new window.MouseEvent('click');
|
||||
|
||||
assert.htmlEqual(target.innerHTML, '<div style="background: red;"></div>');
|
||||
await div.dispatchEvent(click);
|
||||
await Promise.resolve();
|
||||
assert.htmlEqual(target.innerHTML, '<div style=""></div>');
|
||||
}
|
||||
};
|
||||
@ -0,0 +1,9 @@
|
||||
<script>
|
||||
let bg = "red";
|
||||
|
||||
const handle = () => {
|
||||
bg = undefined;
|
||||
};
|
||||
</script>
|
||||
|
||||
<div style:background={bg} on:click={handle}></div>
|
||||
Loading…
Reference in new issue