This commit is contained in:
darylteo
2016-01-04 23:45:25 +11:00
parent 97c8b2d749
commit 791400ed20

View File

@@ -56,3 +56,22 @@ tape("test attach link prototype method", function(t) {
t.end()
})
tape("test attach link preventDefaulted events", function(t) {
var callbacked = false
var a = document.createElement("a")
attachLink.call({
options: {},
loadUrl: function() {
callbacked = true
}
}, a)
a.href = "#"
on(a, "click", preventDefault)
trigger(a, "click")
t.equal(callbacked, false, "events that are preventDefaulted should not fire callback")
t.end()
})