Add parseDOM & (new) parseElement proto methods
This commit is contained in:
1 parent
90615f8ac8
commit
acc3d87911
3 files changed
+39
No files matched your search
@@ -0,0 +1,18 @@
|
||||
var tape = require("tape")
|
||||
|
||||
var parseElement = require("../../../../src/scripts/lib/proto/parse-element")
|
||||
var protoMock = {attachLink: function() { return true}}
|
||||
tape("test parse element prototype method", function(t) {
|
||||
|
||||
t.doesNotThrow(function() {
|
||||
var a = document.createElement("a")
|
||||
parseElement.call(protoMock, a)
|
||||
}, "<a> element can be parsed")
|
||||
|
||||
t.throws(function() {
|
||||
var form = document.createElement("form")
|
||||
parseElement.call(protoMock, form)
|
||||
}, "<form> cannot be used (for now)")
|
||||
|
||||
t.end()
|
||||
})
|
||||
Reference in new issue
Block a user