Merge pull request #116 from MoOx/fix/blur

Fix element blurring (removing focus). Closes #4.
This commit was merged in pull request #116.
This commit is contained in:
Robin North
2018-01-29 20:03:24 +00:00
committed by GitHub
3 changed files with 30 additions and 4 deletions

View File

@@ -0,0 +1,16 @@
var tape = require("tape")
var contains = require("../../../lib/util/contains.js")
tape("test contains function", function(t) {
var tempDoc = document.implementation.createHTMLDocument()
tempDoc.body.innerHTML = "<div><p id='el' class='js-Pjax'></p></div><span></span>"
var selectors = ["div"]
var el = tempDoc.body.querySelector("#el")
t.equal(contains(tempDoc, selectors, el), true, "contains() returns true when a selector contains the element")
selectors = ["span"]
t.equal(contains(tempDoc, selectors, el), false, "contains() returns false when the selectors do not contain the element")
t.end()
})