Files
Quill/Test/Element/stacks.test.js
2024-09-25 22:03:32 -05:00

79 lines
2.2 KiB
JavaScript

window.testSuites.push( class testStacks {
NestedChildren() {
register(class File extends Shadow {
$name
render = () => {
p(this.name)
VStack(() => {
p("Learn to code inside of a startup")
p("➵")
.position("absolute")
.fontSize(30)
.left("50%")
.top("50%")
.transformOrigin("center")
.transform("translate(-50%, -50%) rotate(90deg)")
.transition("all 1s")
.userSelect("none")
.onAppear((self) => {
setTimeout(() => {
self.style.top = "88%"
}, 100)
})
})
}
constructor() {
super()
}
}, randomName("file"))
const file = File("asdf")
if(file.querySelector(".VStack")?.children.length !== 2) {
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"
}
}
})