Add noConflict to many widgets.
[profile/ivi/cowhide.git] / tests / unit / cowhide-select.js
1 $(function () {
2
3     module("cowhide-select", {
4       setup: function() {
5         // Resets the driving state
6         $.cowhide.setDrivingMode(false)
7       }
8     })
9
10       test("should provide no conflict", function () {
11         var select = $.fn.ch_select.noConflict()
12         ok(!$.fn.ch_select, 'select was set back to undefined (org value)')
13         $.fn.ch_select = select
14       })
15
16       test("should be disabled when driving", function () {
17         var page = $('<div class="page"></div>')
18         var input = $('<select><option>test</option></select>')
19         input.appendTo(page)
20         input.ch_select()
21         $.cowhide.setDrivingMode(true)
22         stop()
23         setTimeout(function () {
24           ok(input.attr('disabled'), 'input is disabled')
25           ok(input.hasClass('disabled'), 'input has disabled class')
26           start()
27         }, 0)
28       })
29 })