Add new unit tests.
authorSalvatore Iovene <salvatore@iovene.com>
Thu, 25 Jul 2013 11:26:02 +0000 (14:26 +0300)
committerSalvatore Iovene <salvatore@iovene.com>
Thu, 25 Jul 2013 11:26:02 +0000 (14:26 +0300)
tests/unit/cowhide-button.js
tests/unit/cowhide-checkbox-input.js
tests/unit/cowhide-header.js
tests/unit/cowhide-page.js
tests/unit/cowhide-radio-input.js
tests/unit/cowhide-select.js
tests/unit/cowhide-simple-scrollable.js

index 4a540be..4fef898 100644 (file)
@@ -13,6 +13,10 @@ $(function () {
         $.fn.ch_button = button
       })
 
+      test("should be defined on jquery object", function () {
+        ok($(document.body).ch_button, 'button method is defined')
+      })
+
       test("should be disabled when driving", function () {
         var page = $('<div class="page"></div>')
         var btn = $('<button class="btn">test</button>')
index fdd54be..adfa71b 100644 (file)
@@ -13,6 +13,10 @@ $(function () {
         $.fn.ch_checkbox_input = input
       })
 
+      test("should be defined on jquery object", function () {
+        ok($(document.body).ch_checkbox_input, 'checkbox_input method is defined')
+      })
+
       test("should be disabled when driving", function () {
         var page = $('<div class="page"></div>')
         var input = $('<input type="checkbox">test</input>')
index 3e5f06b..b813995 100644 (file)
@@ -8,6 +8,10 @@ $(function () {
         $.fn.ch_header = header
       })
 
+      test("should be defined on jquery object", function () {
+        ok($(document.body).ch_header, 'header method is defined')
+      })
+
       test("header contains h1 element", function () {
         var page = $('<div class="page"></div>')
         var header = $('<div class="ch-header">Test title</div>')
index 37f0624..7590709 100644 (file)
@@ -2,6 +2,10 @@ $(function () {
 
     module("cowhide-page")
 
+      test("should be defined on jquery object", function () {
+        ok($(document.body).ch_page, 'page method is defined')
+      })
+
       test("pages cannot be nested", function () {
         var page = $('<div class="page"></div>')
         var nested = $('<div class="page"></div>')
index caf114e..4e53f74 100644 (file)
@@ -13,6 +13,10 @@ $(function () {
         $.fn.ch_radio_input = input
       })
 
+      test("should be defined on jquery object", function () {
+        ok($(document.body).ch_radio_input, 'radio_input method is defined')
+      })
+
       test("should be disabled when driving", function () {
         var page = $('<div class="page"></div>')
         var input = $('<input type="radio">test</input>')
index 70e49f2..bcde4e2 100644 (file)
@@ -13,6 +13,10 @@ $(function () {
         $.fn.ch_select = select
       })
 
+      test("should be defined on jquery object", function () {
+        ok($(document.body).ch_select, 'select method is defined')
+      })
+
       test("should be disabled when driving", function () {
         var page = $('<div class="page"></div>')
         var input = $('<select><option>test</option></select>')
index 1276daf..b55b949 100644 (file)
@@ -8,6 +8,10 @@ $(function () {
         $.fn.ch_simple_scrollable = simple_scrollable
       })
 
+      test("should be defined on jquery object", function () {
+        ok($(document.body).ch_simple_scrollable, 'simple_scrollable method is defined')
+      })
+
       test("widget has been made scrollable", function () {
         var page = $('<div class="page"></div>')
         var scrollable = $('<div class="ch-simple-scrollable"><p>Test</p></div>')