add tests for custom functions
This commit is contained in:
@ -185,45 +185,55 @@ func createTestAST() lang.AST {
|
||||
Name: "HomePage",
|
||||
Path: "/",
|
||||
Layout: "public",
|
||||
Components: []lang.Component{
|
||||
{Type: "header"},
|
||||
{Type: "footer"},
|
||||
},
|
||||
Sections: []lang.Section{
|
||||
Elements: []lang.PageElement{
|
||||
{
|
||||
Name: "hero",
|
||||
Type: strPtr("container"),
|
||||
Elements: []lang.SectionElement{
|
||||
{
|
||||
Component: &lang.Component{
|
||||
Type: "carousel",
|
||||
Component: &lang.Component{
|
||||
Type: "header",
|
||||
},
|
||||
},
|
||||
{
|
||||
Component: &lang.Component{
|
||||
Type: "footer",
|
||||
},
|
||||
},
|
||||
{
|
||||
Section: &lang.Section{
|
||||
Name: "hero",
|
||||
Type: strPtr("container"),
|
||||
Elements: []lang.SectionElement{
|
||||
{
|
||||
Component: &lang.Component{
|
||||
Type: "carousel",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Section: &lang.Section{
|
||||
Name: "banner",
|
||||
Type: strPtr("panel"),
|
||||
{
|
||||
Section: &lang.Section{
|
||||
Name: "banner",
|
||||
Type: strPtr("panel"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "content",
|
||||
Type: strPtr("container"),
|
||||
Elements: []lang.SectionElement{
|
||||
{
|
||||
Component: &lang.Component{
|
||||
Type: "article",
|
||||
Section: &lang.Section{
|
||||
Name: "content",
|
||||
Type: strPtr("container"),
|
||||
Elements: []lang.SectionElement{
|
||||
{
|
||||
Component: &lang.Component{
|
||||
Type: "article",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Section: &lang.Section{
|
||||
Name: "sidebar",
|
||||
Type: strPtr("panel"),
|
||||
Elements: []lang.SectionElement{
|
||||
{
|
||||
Component: &lang.Component{
|
||||
Type: "widget",
|
||||
{
|
||||
Section: &lang.Section{
|
||||
Name: "sidebar",
|
||||
Type: strPtr("panel"),
|
||||
Elements: []lang.SectionElement{
|
||||
{
|
||||
Component: &lang.Component{
|
||||
Type: "widget",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -240,10 +250,12 @@ func createTestAST() lang.AST {
|
||||
Name: "AdminPage",
|
||||
Path: "/admin",
|
||||
Layout: "admin",
|
||||
Sections: []lang.Section{
|
||||
Elements: []lang.PageElement{
|
||||
{
|
||||
Name: "dashboard",
|
||||
Type: strPtr("container"),
|
||||
Section: &lang.Section{
|
||||
Name: "dashboard",
|
||||
Type: strPtr("container"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user