dac1f1f3bb5db9481f94d66fe8cdefc7cc60456c
[profile/ivi/cowhide.git] / tests / unit / cowhide-checkbox-input.js
1 $(function () {
2
3     module("cowhide-checkbox-input", {
4       setup: function() {
5         // Resets the driving state
6         $.cowhide.setDrivingMode(false)
7       }
8     })
9
10       test("should be disabled when driving", function () {
11         var page = $('<div class="page"></div>')
12         var input = $('<input type="checkbox">test</input>')
13         input.appendTo(page)
14         input.ch_checkbox_input()
15         $.cowhide.setDrivingMode(true)
16         stop()
17         setTimeout(function () {
18           ok(input.attr('disabled'), 'input is disabled')
19           ok(input.hasClass('disabled'), 'input has disabled class')
20           start()
21         }, 0)
22       })
23 })