Adding Group
This commit is contained in:
18
Test/Element/Group.test.js
Normal file
18
Test/Element/Group.test.js
Normal file
@@ -0,0 +1,18 @@
|
||||
window.testSuites.push( class testGroup {
|
||||
|
||||
BasicDivs() {
|
||||
let divs = Group(() => {
|
||||
div()
|
||||
div()
|
||||
div()
|
||||
})
|
||||
|
||||
if(!(divs instanceof HTMLElement)) {
|
||||
return `Did not receive an element!`
|
||||
}
|
||||
if(!(divs.children.length === 3)) {
|
||||
return `Incorrect amount of children!`
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
41
Test/Element/stacks.test.js
Normal file
41
Test/Element/stacks.test.js
Normal file
@@ -0,0 +1,41 @@
|
||||
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!"
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
Reference in New Issue
Block a user