mirror of https://github.com/sveltejs/svelte
parent
4c2fdcf657
commit
f13c2272df
@ -1 +1,11 @@
|
||||
<script>
|
||||
import { onDestroy, createEventDispatcher } from 'svelte';
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
onDestroy(() => {
|
||||
dispatch('destroy');
|
||||
});
|
||||
</script>
|
||||
|
||||
<p>i am a widget</p>
|
@ -1,5 +1,5 @@
|
||||
export default {
|
||||
test(assert, component) {
|
||||
component.l1.destroy();
|
||||
component.l1.$destroy();
|
||||
}
|
||||
};
|
||||
|
@ -1,5 +1,7 @@
|
||||
<script>
|
||||
import Level1 from './Level1.html';
|
||||
|
||||
export let l1;
|
||||
</script>
|
||||
|
||||
<Level1 ref:l1 />
|
@ -1,4 +1,4 @@
|
||||
<div class="level3" ref:thingy>
|
||||
<div class="level3">
|
||||
<h4>level 3</h4>
|
||||
<slot></slot>
|
||||
</div>
|
@ -1,7 +1,8 @@
|
||||
export default {
|
||||
html: '<div><p>i am a widget</p></div>',
|
||||
test ( assert, component ) {
|
||||
const widget = component.widget;
|
||||
assert.ok( widget.isWidget );
|
||||
|
||||
test(assert, component) {
|
||||
const { widget } = component;
|
||||
assert.ok(widget.isWidget);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in new issue