adding render scheme
This commit is contained in:
@@ -2,12 +2,12 @@ window.testSuites.push( class testParse {
|
||||
|
||||
|
||||
testParseClassFieldsWithNoDefault() {
|
||||
class Space extends HTMLElement {
|
||||
class Space extends Shadow {
|
||||
form
|
||||
contents = []
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
constructor(...params) {
|
||||
super(...params)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ testParseClassFieldsWithNoDefault() {
|
||||
}
|
||||
|
||||
testParseClassFieldsWithEqualityCheck() {
|
||||
class Space extends HTMLElement {
|
||||
class Space extends Shadow {
|
||||
form = Forms.observe(window.location.pathname, this)
|
||||
|
||||
contents = [
|
||||
@@ -34,8 +34,8 @@ testParseClassFieldsWithEqualityCheck() {
|
||||
})
|
||||
]
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
constructor(...params) {
|
||||
super(...params)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ testParseClassFieldsWithEqualityCheck() {
|
||||
}
|
||||
|
||||
testParseClassFieldsWithInnerFunctionVariable() {
|
||||
class Space extends HTMLElement {
|
||||
class Space extends Shadow {
|
||||
form = Forms.observe(window.location.pathname, this)
|
||||
|
||||
contents = [
|
||||
@@ -64,8 +64,8 @@ testParseClassFieldsWithInnerFunctionVariable() {
|
||||
})
|
||||
]
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
constructor(...params) {
|
||||
super(...params)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
37
Test/shadow.test.js
Normal file
37
Test/shadow.test.js
Normal file
@@ -0,0 +1,37 @@
|
||||
window.testSuites.push( class testShadow {
|
||||
|
||||
testObjectAsStateField() {
|
||||
class File extends Shadow {
|
||||
$form
|
||||
|
||||
constructor(...params) {
|
||||
super(...params)
|
||||
}
|
||||
}
|
||||
|
||||
window.register(File, "file-el")
|
||||
let form = {data: "asdf"}
|
||||
const el = window.File(form)
|
||||
console.log(el, el.$form, el._form)
|
||||
if(!(el.form === form)) {
|
||||
return `State field does not match object passed in!`
|
||||
}
|
||||
}
|
||||
|
||||
testRegisterThrowsIfNoConstructorParams() {
|
||||
class File2 extends Shadow {
|
||||
$form
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
window.register(File2, "file2-el")
|
||||
} catch(e) {}
|
||||
|
||||
return "Error not thrown!"
|
||||
}
|
||||
|
||||
})
|
||||
@@ -2,6 +2,7 @@ console.log("Tests initializing.")
|
||||
window.testSuites = [];
|
||||
|
||||
import ("./parse.test.js")
|
||||
import ("./shadow.test.js")
|
||||
|
||||
window.test = async function() {
|
||||
// window.testSuites.sort();
|
||||
|
||||
Reference in New Issue
Block a user