Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Tests for BigText noConflict

  • Loading branch information...
commit eb412967c825d631486ac495954a1439634dea88 1 parent 3efdd90
@zachleat authored
Showing with 20 additions and 2 deletions.
  1. +4 −1 demo/simpleDemoDiv.html
  2. +16 −1 test/bigtextTest.js
View
5 demo/simpleDemoDiv.html
@@ -20,7 +20,10 @@
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
<script src="../bigtext.js"></script>
<script>
- $('#test').bigtext();
+ var bt = BigText.noConflict(true);
+ $.fn.bt = bt.jQueryMethod;
+
+ $('#test').bt();
</script>
</body>
</html>
View
17 test/bigtextTest.js
@@ -163,7 +163,7 @@ BigTextTest.prototype.testUnbrokenSingleWord = function()
BigTextTest.prototype.testTwoLinesButOneExempt = function()
{
- $(document.body).append('<div id="test" style="width:400px"><div class="bigtext-exempt">a longer second line</div></div>');
+ $(document.body).append('<div id="test" style="width:400px"><div>This is</div><div class="bigtext-exempt">a longer second line</div></div>');
this.linesTest('#test', 400);
};
@@ -189,4 +189,19 @@ BigTextTest.prototype.testMaxWidth = function()
$(document.body).append('<div id="test" style="max-width:600px"><div>This is a single line.</div></div>');
this.linesTest('#test', 600);
+};
+
+BigTextTest.prototype.testNoConflict = function()
+{
+ $(document.body).append('<div id="test" style="width:600px"><div>This is a single line.</div></div>');
+
+ var BT = BigText.noConflict();
+ $.fn.bt = BT.jQueryMethod;
+
+ $('#test').bt();
+
+ var defaultDocumentFontSize = $('<div/>').appendTo(document.body).css('font-size'),
+ childFontSize = $('#test > div').css('font-size');
+
+ assertNotEquals('Font size must not equal the default.', defaultDocumentFontSize, childFontSize);
};
Please sign in to comment.
Something went wrong with that request. Please try again.