Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Thornton <jacobthornton@gmail.com>2012-04-05 01:58:04 +0400
committerJacob Thornton <jacobthornton@gmail.com>2012-04-05 01:58:04 +0400
commit4bd611884a5f1dd02878f73bccd51d85c1e49186 (patch)
tree524cdf0b5618f1e8de7c878129d754af63ebf243 /js/tests/unit/bootstrap-tooltip.js
parent2dc979a2029d909945011a8e6dac3543aa9f0198 (diff)
detect if title in tooltip is text or html. if text - use `text` method to prevent xss.
all add a few notes to js readme about updated event
Diffstat (limited to 'js/tests/unit/bootstrap-tooltip.js')
-rw-r--r--js/tests/unit/bootstrap-tooltip.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/js/tests/unit/bootstrap-tooltip.js b/js/tests/unit/bootstrap-tooltip.js
index 8543162c6a..f6e00089b1 100644
--- a/js/tests/unit/bootstrap-tooltip.js
+++ b/js/tests/unit/bootstrap-tooltip.js
@@ -59,4 +59,28 @@ $(function () {
ok(!$(".tooltip").length, 'tooltip removed')
})
+ test("should detect if title string is html or text: foo", function () {
+ ok(!$.fn.tooltip.Constructor.prototype.isHTML('foo'), 'correctly detected html')
+ })
+
+ test("should detect if title string is html or text: &amp;lt;foo&amp;gt;", function () {
+ ok(!$.fn.tooltip.Constructor.prototype.isHTML('&lt;foo&gt;'), 'correctly detected html')
+ })
+
+ test("should detect if title string is html or text: &lt;div>foo&lt;/div>", function () {
+ ok($.fn.tooltip.Constructor.prototype.isHTML('<div>foo</div>'), 'correctly detected html')
+ })
+
+ test("should detect if title string is html or text: asdfa&lt;div>foo&lt;/div>asdfasdf", function () {
+ ok($.fn.tooltip.Constructor.prototype.isHTML('asdfa<div>foo</div>asdfasdf'), 'correctly detected html')
+ })
+
+ test("should detect if title string is html or text: document.createElement('div')", function () {
+ ok($.fn.tooltip.Constructor.prototype.isHTML(document.createElement('div')), 'correctly detected html')
+ })
+
+ test("should detect if title string is html or text: $('&lt;div />)", function () {
+ ok($.fn.tooltip.Constructor.prototype.isHTML($('<div></div>')), 'correctly detected html')
+ })
+
}) \ No newline at end of file