diff --git a/tests/lib/proto/attach-link.js b/tests/lib/proto/attach-link.js index 29202c1..fef1bfc 100644 --- a/tests/lib/proto/attach-link.js +++ b/tests/lib/proto/attach-link.js @@ -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() +})