Added support do do a push-state ajax request with forms

This commit is contained in:
markusfluer
2017-09-18 14:13:39 +02:00
parent 109e78347f
commit 86e5a2281a
10 changed files with 214 additions and 14 deletions

View File

@@ -1,17 +1,21 @@
var tape = require("tape")
var parseElement = require("../../../lib/proto/parse-element")
var protoMock = {attachLink: function() { return true}}
var protoMock = {
attachLink: function() { return true },
attachForm: 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() {
t.doesNotThrow(function() {
var form = document.createElement("form")
parseElement.call(protoMock, form)
}, "<form> cannot be used (for now)")
}, "<form> element can be parsed")
t.end()
})