diff --git a/test/runtime/samples/each-block-containing-component-in-if/Nested.html b/test/runtime/samples/each-block-containing-component-in-if/Nested.html new file mode 100644 index 0000000000..b9d76a696d --- /dev/null +++ b/test/runtime/samples/each-block-containing-component-in-if/Nested.html @@ -0,0 +1,5 @@ +{{#if show}} + {{#each fields as field}} + {{field}} + {{/each}} +{{/if}} \ No newline at end of file diff --git a/test/runtime/samples/each-block-containing-component-in-if/_config.js b/test/runtime/samples/each-block-containing-component-in-if/_config.js new file mode 100644 index 0000000000..bfee6beb20 --- /dev/null +++ b/test/runtime/samples/each-block-containing-component-in-if/_config.js @@ -0,0 +1,36 @@ +export default { + data: { + show: false, + fields: [1, 2] + }, + + html: `
`, + + test ( assert, component, target ) { + component.set({ + show: true, + fields: [1, 2, 3] + }); + + assert.htmlEqual( target.innerHTML, ` +
+ 1 + 2 + 3 +
+ ` ); + + component.set({ + fields: [1, 2, 3, 4] + }); + + assert.htmlEqual( target.innerHTML, ` +
+ 1 + 2 + 3 + 4 +
+ ` ); + } +}; diff --git a/test/runtime/samples/each-block-containing-component-in-if/main.html b/test/runtime/samples/each-block-containing-component-in-if/main.html new file mode 100644 index 0000000000..9a6bbfd10f --- /dev/null +++ b/test/runtime/samples/each-block-containing-component-in-if/main.html @@ -0,0 +1,13 @@ +
+ +
+ + \ No newline at end of file