-
-
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.
Browse files
Browse the repository at this point in the history
fix placement of each-else block, and clarify node references in source
- Loading branch information
Showing
3 changed files
with
94 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export default { | ||
html: ` | ||
<p>nothing</p> | ||
<p>after</p> | ||
`, | ||
|
||
test({ assert, component, target }) { | ||
component.visible = false; | ||
assert.htmlEqual(target.innerHTML, ``); | ||
|
||
component.visible = true; | ||
assert.htmlEqual(target.innerHTML, ` | ||
<p>nothing</p> | ||
<p>after</p> | ||
`); | ||
} | ||
}; |
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,14 @@ | ||
<script> | ||
export let visible = true; | ||
const empty = []; | ||
</script> | ||
|
||
{#if visible} | ||
{#each empty as item} | ||
<p>{item}</p> | ||
{:else} | ||
<p>nothing</p> | ||
{/each} | ||
|
||
<p>after</p> | ||
{/if} |