-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
98 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
test/runtime/samples/dynamic-component-nulled-out-intro/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default { | ||
test({ component }) { | ||
component.visible = true; | ||
} | ||
}; |
7 changes: 7 additions & 0 deletions
7
test/runtime/samples/dynamic-component-nulled-out-intro/main.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<script> | ||
export let visible = false; | ||
</script> | ||
|
||
{#if visible} | ||
<svelte:component this={null}/> | ||
{/if} |
1 change: 1 addition & 0 deletions
1
test/runtime/samples/each-block-component-no-props/Child.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>hello</p> |
16 changes: 16 additions & 0 deletions
16
test/runtime/samples/each-block-component-no-props/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export default { | ||
html: ` | ||
<p>hello</p> | ||
`, | ||
|
||
async test({ assert, component, target }) { | ||
await component.remove(); | ||
assert.htmlEqual(target.innerHTML, ``); | ||
|
||
await component.add(); | ||
assert.htmlEqual(target.innerHTML, `<p>hello</p>`); | ||
|
||
await component.remove(); | ||
assert.htmlEqual(target.innerHTML, ``); | ||
} | ||
}; |
17 changes: 17 additions & 0 deletions
17
test/runtime/samples/each-block-component-no-props/main.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<script> | ||
import Child from './Child.svelte'; | ||
let items = [1]; | ||
export function add() { | ||
items = [1]; | ||
} | ||
export function remove() { | ||
items = []; | ||
} | ||
</script> | ||
|
||
{#each items as item} | ||
<Child/> | ||
{/each} |
18 changes: 18 additions & 0 deletions
18
test/runtime/samples/event-handler-shorthand-sanitized/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export default { | ||
html: ` | ||
<button>click me now</button> | ||
`, | ||
|
||
test({ assert, component, target, window }) { | ||
const button = target.querySelector('button'); | ||
const event = new window.Event('click-now'); | ||
|
||
let clicked; | ||
component.$on('click-now', () => { | ||
clicked = true; | ||
}); | ||
|
||
button.dispatchEvent(event); | ||
assert.ok(clicked); | ||
} | ||
}; |
1 change: 1 addition & 0 deletions
1
test/runtime/samples/event-handler-shorthand-sanitized/main.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<button on:click-now>click me now</button> |