Adds unit tests for scrollable widget.
authorSalvatore Iovene <salvatore.iovene@intel.com>
Wed, 16 Jan 2013 09:06:32 +0000 (11:06 +0200)
committerSalvatore Iovene <salvatore.iovene@intel.com>
Wed, 16 Jan 2013 09:06:32 +0000 (11:06 +0200)
tests/index.html
tests/unit/cowhide-scrollable.js [new file with mode: 0644]

index f88140c..0efe8c6 100644 (file)
@@ -5,7 +5,8 @@
 
   <!-- jquery -->
   <!--<script src="http://code.jquery.com/jquery-1.7.min.js"></script>-->
-  <script src="vendor/jquery-1.8.3.js"></script>
+  <script src="../lib/jquery-1.8.3.js"></script>
+  <script src="../lib/jquery.mCustomScrollbar.js"></script>
 
   <!-- qunit -->
   <link rel="stylesheet" href="vendor/qunit.css" type="text/css" media="screen" />
@@ -39,6 +40,7 @@
   <script src="../src/javascripts/cowhide-header.js"></script>
   <script src="../src/javascripts/cowhide-page.js"></script>
   <script src="../src/javascripts/cowhide-radio-input.js"></script>
+  <script src="../src/javascripts/cowhide-scrollable.js"></script>
 
   <!-- unit tests -->
   <script src="unit/bootstrap-transition.js"></script>
@@ -61,6 +63,7 @@
   <script src="unit/cowhide-header.js"></script>
   <script src="unit/cowhide-page.js"></script>
   <script src="unit/cowhide-radio-input.js"></script>
+  <script src="unit/cowhide-scrollable.js"></script>
 </head>
 <body>
   <div>
diff --git a/tests/unit/cowhide-scrollable.js b/tests/unit/cowhide-scrollable.js
new file mode 100644 (file)
index 0000000..7bf0e33
--- /dev/null
@@ -0,0 +1,14 @@
+$(function () {
+
+    module("cowhide-scrollable")
+
+      test("widget has been made scrollable", function () {
+        var page = $('<div class="page"></div>')
+        var scrollable = $('<div class="ch-scrollable"></div>')
+
+        scrollable.appendTo(page)
+        scrollable.ch_scrollable('enable')
+
+        ok(scrollable.hasClass('mCustomScrollbar'), "element has mCustomScrollbar class")
+      })
+})