Adds unit test on ignore-driving-mode.
authorSalvatore Iovene <salvatore.iovene@intel.com>
Thu, 17 Jan 2013 12:51:11 +0000 (14:51 +0200)
committerSalvatore Iovene <salvatore.iovene@intel.com>
Thu, 17 Jan 2013 12:51:11 +0000 (14:51 +0200)
tests/unit/cowhide-button.js

index 01f1534..87e6d38 100644 (file)
@@ -21,6 +21,21 @@ $(function () {
         }, 0)
       })
 
+      test("should support ignore-driving-mode", function () {
+        var page = $('<div class="page"></div>')
+        var btn = $('<button class="btn" data-ignore-driving-mode="true">test</button>')
+        btn.appendTo(page)
+        btn.ch_button()
+        $.cowhide.setDrivingMode(true)
+        stop()
+        setTimeout(function () {
+          ok(!btn.attr('disabled'), 'btn is disabled')
+          ok(!btn.hasClass('disabled'), 'btn has disabled class')
+          start()
+        }, 0)
+      })
+
+
       test("should have marquee element if marquee is enabled", function() {
         var page = $('<div class="page"></div>')
         var btn = $('<button class="btn" data-marquee="true">this is some really long text, for a button, is it not?</button>')