2014-05-06 08:19:23 +02:00
|
|
|
var tape = require("tape")
|
|
|
|
|
|
2014-10-14 08:23:56 +02:00
|
|
|
var parseElement = require("../../../lib/proto/parse-element")
|
2017-09-18 14:13:39 +02:00
|
|
|
var protoMock = {
|
|
|
|
|
attachLink: function() { return true },
|
|
|
|
|
attachForm: function() { return true }
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-06 08:19:23 +02:00
|
|
|
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")
|
|
|
|
|
|
2017-09-18 14:13:39 +02:00
|
|
|
t.doesNotThrow(function() {
|
2014-05-06 08:19:23 +02:00
|
|
|
var form = document.createElement("form")
|
|
|
|
|
parseElement.call(protoMock, form)
|
2017-09-18 14:13:39 +02:00
|
|
|
}, "<form> element can be parsed")
|
2014-05-06 08:19:23 +02:00
|
|
|
|
|
|
|
|
t.end()
|
|
|
|
|
})
|