feat(wrn): support native structured prop expressions
This commit is contained in:
@@ -464,6 +464,28 @@ component ParentCard {
|
||||
expect(output).toContain("function __wireProp");
|
||||
});
|
||||
|
||||
test("native array and object props serialize through component mounts", async () => {
|
||||
const mod = await compileAndImport(`
|
||||
component NativeProps {
|
||||
state items = [{"label":"Home","href":"/"}]
|
||||
view {
|
||||
<Navbar items={items} options={{"dense":true}} />
|
||||
<Sidebar items={[{"label":"Cases","href":"/cases"}]} />
|
||||
}
|
||||
}
|
||||
`);
|
||||
const render = mod.render as (props?: Record<string, unknown>) => string;
|
||||
const html = render();
|
||||
|
||||
expect(html).toContain(
|
||||
'items="[{"label":"Home","href":"/"}]"',
|
||||
);
|
||||
expect(html).toContain('options="{"dense":true}"');
|
||||
expect(html).toContain(
|
||||
'items="[{"label":"Cases","href":"/cases"}]"',
|
||||
);
|
||||
});
|
||||
|
||||
test("parses a layout block", () => {
|
||||
const ast = parse(`
|
||||
layout AppLayout {
|
||||
|
||||
Reference in New Issue
Block a user