release: WRNexusJS 0.2.28
This commit is contained in:
@@ -212,3 +212,34 @@ component ParentCard {
|
||||
|
||||
expect(output).toContain('title="${__wireAttr(title)}"');
|
||||
});
|
||||
|
||||
test("parses a layout block", () => {
|
||||
const ast = parse(`
|
||||
layout AppLayout {
|
||||
view {
|
||||
<main>{content}</main>
|
||||
}
|
||||
}
|
||||
`);
|
||||
|
||||
expect(ast.kind).toBe("layout");
|
||||
expect(ast.name).toBe("AppLayout");
|
||||
});
|
||||
|
||||
test("layouts compile as reusable render modules", () => {
|
||||
const output = generate(
|
||||
parse(`
|
||||
layout AppLayout {
|
||||
view {
|
||||
<main>{content}</main>
|
||||
}
|
||||
}
|
||||
`),
|
||||
);
|
||||
|
||||
expect(output).toContain('export const __wrnexusLayout = "AppLayout"');
|
||||
|
||||
expect(output).toContain("${__wireRaw(content)}");
|
||||
|
||||
expect(output).toContain("export function render");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user