Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion test/looping-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,22 @@ test("Test case from #175 nested webc:for", async t => {
</tr>
</tbody>
</table>`);
});
});


test("webc:for with multiple sub-elements", async (t) => {
let component = new WebC();

component.setInputPath("./test/stubs/looping/array-multiple-sub.webc");

let { html } = await component.compile();

t.is(
html.trim(),
`<div>
<div>1</div>
<div>2</div>
</div>`,
);
});

4 changes: 4 additions & 0 deletions test/stubs/looping/array-multiple-sub.webc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div webc:for="key of [{a:1,b:2}]">
<div @text="key.a" />
<div @text="key.b" />
</div>
Loading