This repository has been archived by the owner on Oct 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
degradeInputs.js
90 lines (62 loc) · 3.47 KB
/
degradeInputs.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
* degradeInputs unit tests
*/
(function($){
module('jquery.mobile.slider.js', {
setup: function() {
$('#test-container').html("");
}
});
test('input type color should not degrade when "create" event is triggered', function(){
$('#test-container').html('<input type="color" />').trigger("create");
same($('#test-container input').attr("type"), "color");
});
test('input type date should not degrade when "create" event is triggered', function(){
$('#test-container').html('<input type="date" />').trigger("create");
same($('#test-container input').attr("type"), "date");
});
test('input type datetime should not degrade when "create" event is triggered', function(){
$('#test-container').html('<input type="datetime" />').trigger("create");
same($('#test-container input').attr("type"), "datetime");
});
test('input type datetime-local should not degrade when "create" event is triggered', function(){
$('#test-container').html('<input type="datetime-local" />').trigger("create");
same($('#test-container input').attr("type"), "datetime-local");
});
test('input type email should not degrade when "create" event is triggered', function(){
$('#test-container').html('<input type="email" />').trigger("create");
same($('#test-container input').attr("type"), "email");
});
test('input type month should not degrade when "create" event is triggered', function(){
$('#test-container').html('<input type="month" />').trigger("create");
same($('#test-container input').attr("type"), "month");
});
test('input type number should not degrade when "create" event is triggered', function(){
$('#test-container').html('<input type="number" />').trigger("create");
same($('#test-container input').attr("type"), "number");
});
test('input type range should degrade to number when "create" event is triggered', function(){
$('#test-container').html('<input type="range" />').trigger("create");
same($('#test-container input').attr("type"), "number");
});
test('input type search should degrade to text when "create" event is triggered', function(){
$('#test-container').html('<input type="search" />').trigger("create");
same($('#test-container input').attr("type"), "text");
});
test('input type tel should not degrade when "create" event is triggered', function(){
$('#test-container').html('<input type="tel" />').trigger("create");
same($('#test-container input').attr("type"), "tel");
});
test('input type time should not degrade when "create" event is triggered', function(){
$('#test-container').html('<input type="time" />').trigger("create");
same($('#test-container input').attr("type"), "time");
});
test('input type url should not degrade when "create" event is triggered', function(){
$('#test-container').html('<input type="url" />').trigger("create");
same($('#test-container input').attr("type"), "url");
});
test('input type week should not degrade when "create" event is triggered', function(){
$('#test-container').html('<input type="week" />').trigger("create");
same($('#test-container input').attr("type"), "week");
});
})(jQuery);