extra functions, new test from amplify lessons
This commit is contained in:
@@ -37,5 +37,43 @@ window.testSuites.push( class testStacks {
|
||||
return "Incorrect amount of children inside vstack!"
|
||||
}
|
||||
}
|
||||
|
||||
NestedStacks() {
|
||||
register(class File extends Shadow {
|
||||
$name
|
||||
|
||||
render = () => {
|
||||
VStack(() => {
|
||||
HStack(() => {
|
||||
p("hi")
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
}, randomName("file"))
|
||||
|
||||
const file = File("asdf")
|
||||
console.log(file)
|
||||
let fileStyle = Registry.styles.children[Registry.styles.children.length-1].sheet.cssRules
|
||||
if(fileStyle[0].cssText.includes("row")) {
|
||||
return "Should not be horizontal"
|
||||
}
|
||||
|
||||
console.log(file.innerHTML)
|
||||
if(!file.children[0].matches("div.HStack")) {
|
||||
return "The child is not an HStack"
|
||||
}
|
||||
|
||||
file.rerender()
|
||||
|
||||
if(!file.children[0].matches("div.HStack")) {
|
||||
return "The child is not an HStack"
|
||||
}
|
||||
|
||||
let fileStyle2 = Registry.styles.children[Registry.styles.children.length-1].sheet.cssRules
|
||||
if(fileStyle2[0].cssText.includes("row")) {
|
||||
return "Should not be horizontal"
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
Reference in New Issue
Block a user