From 969fbe71504f6a8159688634cce774d7ffc7ac67 Mon Sep 17 00:00:00 2001 From: Nicklas Ansman Giertz <nicklas@ansman.se> Date: Fri, 6 Jan 2012 11:32:11 +0100 Subject: [PATCH] Add a test case for issue #908 (twipsy doesn't respect custom classes) The test case verifies that a custom class is respected. --- js/tests/unit/bootstrap-twipsy.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/tests/unit/bootstrap-twipsy.js b/js/tests/unit/bootstrap-twipsy.js index 6623fc026e..08512ca979 100644 --- a/js/tests/unit/bootstrap-twipsy.js +++ b/js/tests/unit/bootstrap-twipsy.js @@ -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 -- GitLab