aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dom_tests/dom_tests.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'tests/dom_tests/dom_tests.coffee')
-rw-r--r--tests/dom_tests/dom_tests.coffee29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/dom_tests/dom_tests.coffee b/tests/dom_tests/dom_tests.coffee
index 58fa26f9..eab47546 100644
--- a/tests/dom_tests/dom_tests.coffee
+++ b/tests/dom_tests/dom_tests.coffee
@@ -134,6 +134,35 @@ context "False positives in link-hint",
for hintMarker in hintMarkers
assert.equal "clickable", hintMarker.linkText
+context "jsaction matching",
+
+ setup ->
+ stubSettings "filterLinkHints", true
+ testContent = '<p id="test-paragraph">clickable</p>'
+ document.getElementById("test-div").innerHTML = testContent
+ @element = document.getElementById("test-paragraph")
+
+ tearDown ->
+ document.getElementById("test-div").innerHTML = ""
+
+ should "select jsaction elements", ->
+ for text in ["click:namespace.actionName", "namespace.actionName"]
+ @element.setAttribute "jsaction", text
+ linkHints = activateLinkHintsMode()
+ hintMarkers = getHintMarkers().filter (marker) -> marker.linkText != "Frame."
+ linkHints.deactivateMode()
+ assert.equal 1, hintMarkers.length
+ assert.equal "clickable", hintMarkers[0].linkText
+ assert.equal @element, hintMarkers[0].localHintDescriptor.element
+
+ should "not select inactive jsaction elements", ->
+ for text in ["mousedown:namespace.actionName", "click:namespace._", "none", "namespace:_"]
+ @element.setAttribute "jsaction", text
+ linkHints = activateLinkHintsMode()
+ hintMarkers = getHintMarkers().filter (marker) -> marker.linkText != "Frame."
+ linkHints.deactivateMode()
+ assert.equal 0, hintMarkers.length
+
inputs = []
context "Test link hints for focusing input elements correctly",