]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Add a test case for issue #908 (twipsy doesn't respect custom classes) 907/head
authorNicklas Ansman Giertz <nicklas@ansman.se>
Fri, 6 Jan 2012 10:32:11 +0000 (11:32 +0100)
committerNicklas Ansman Giertz <nicklas@ansman.se>
Fri, 6 Jan 2012 10:33:18 +0000 (11:33 +0100)
The test case verifies that a custom class is respected.

js/tests/unit/bootstrap-twipsy.js

index 6623fc026ea34c8a47bb41ab879bf4c0a6a7ceac..08512ca97908ff5039ed901442a916fd9f393271 100644 (file)
@@ -48,4 +48,15 @@ $(function () {
         ok(!$(".twipsy").length, 'twipsy removed')
       })
 
+      test("should respect custom classes", function () {
+        var twipsy = $('<a href="#" rel="twipsy" title="Another twipsy"></a>')
+          .appendTo('#qunit-fixture')
+          .twipsy({ template: '<div class="twipsy some-class"><div class="twipsy-arrow"/><div class="twipsy-inner"/></div>'})
+          .twipsy('show')
+
+        ok($('.twipsy').hasClass('some-class'), 'custom class is present')
+        twipsy.twipsy('hide')
+        ok(!$(".twipsy").length, 'twipsy removed')
+      })
+
 })
\ No newline at end of file