0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 01:11:24 +01:00

add test for #643

This commit is contained in:
Rich Harris 2017-06-17 11:22:49 -04:00
parent e9516abffd
commit 78b3a1b079
5 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,22 @@
<div class="level1">
{{#each values as value}}
<h4>level 1 #{{value}}</h4>
<Level2 condition="{{value % 2}}">
<Level3>
<span>And more stuff goes in here</span>
</Level3>
</Level2>
{{/each}}
</div>
<script>
import Level2 from './Level2.html';
import Level3 from './Level3.html';
export default {
components: {
Level2,
Level3
}
};
</script>

View File

@ -0,0 +1,8 @@
<div class="level2" ref:wat>
<h4>level 2</h4>
{{#if condition}}
<span>TRUE! {{yield}}</span>
{{else}}
<span>FALSE! {{yield}}</span>
{{/if}}
</div>

View File

@ -0,0 +1,4 @@
<div class="level3" ref:thingy>
<h4>level 3</h4>
{{yield}}
</div>

View File

@ -0,0 +1,11 @@
export default {
solo: true,
data: {
values: [1, 2, 3, 4]
},
test(assert, component) {
component.set({ values: [2, 3] });
}
};

View File

@ -0,0 +1,11 @@
<Level1 :values/>
<script>
import Level1 from './Level1.html';
export default {
components: {
Level1
}
}
</script>