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
17 changes: 17 additions & 0 deletions test/looping-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,22 @@ test("Test case from #175 nested webc:for", async t => {
</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>`,
);
});

test("Basic webc:for with bad syntax", async t => {
let component = new WebC();

Expand All @@ -242,3 +258,4 @@ test("Basic webc:for with bad syntax", async t => {
message:/attribute value: bad syntax/
});
});

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